ALPSCore reference
Namespaces | Classes | Functions
alps::params_ns Namespace Reference

Namespaces

 exception
 

Classes

class  dict_value
 
class  dictionary
 Python-like dictionary. More...
 
class  params
 Parse sectioned INI file or HDF5 or command line, provide the results as dictionary. More...
 

Functions

bool operator== (const dictionary &lhs, const dictionary &rhs)
 
bool operator!= (const dictionary &lhs, const dictionary &rhs)
 
template<typename F >
F::result_type apply_visitor (F &visitor, dictionary::const_iterator it)
 Const-access visitor to a value by an iterator. More...
 
template<typename F >
F::result_type apply_visitor (const F &visitor, dictionary::const_iterator it)
 Const-access visitor to a value by an iterator. More...
 
paramsdefine_convenience_parameters (params &parameters)
 Defines a number of frequently-used parameters. Defines size_t timelimt, string outputfile, string checkpoint. More...
 
std::ostream & operator<< (std::ostream &os, const dict_value &dv)
 Print the value together with type in some human-readable format. More...
 
template<typename F >
F::result_type apply_visitor (F &visitor, const dict_value &dv)
 Const-access visitor to the bound value. More...
 
template<typename F >
F::result_type apply_visitor (const F &visitor, const dict_value &dv)
 Const-access visitor to the bound value. More...
 
template<typename T >
bool operator== (const T &lhs, const dict_value &rhs)
 
template<typename T >
bool operator!= (const T &lhs, const dict_value &rhs)
 
template<typename T >
bool operator== (const dict_value &lhs, const T &rhs)
 
template<typename T >
bool operator!= (const dict_value &lhs, const T &rhs)
 
bool operator== (const dict_value &lhs, const dict_value &rhs)
 
bool operator!= (const dict_value &lhs, const dict_value &rhs)
 
bool operator== (const dict_value &lhs, const char *rhs)
 
bool operator!= (const dict_value &lhs, const char *rhs)
 
bool operator== (const char *lhs, const dict_value &rhs)
 
bool operator!= (const char *lhs, const dict_value &rhs)
 
void swap (params &p1, params &p2)
 
std::string origin_name (const params &p)
 Convenience function to obtain the "origin" filename associated with the parameters object. More...
 
std::ostream & print (std::ostream &s, const dict_value &dv, bool terse)
 
std::ostream & operator<< (std::ostream &s, const dictionary &d)
 
std::ostream & operator<< (std::ostream &s, const params &p)
 

Function Documentation

template<typename F >
F::result_type alps::params_ns::apply_visitor ( F &  visitor,
dictionary::const_iterator  it 
)
inline

Const-access visitor to a value by an iterator.

Parameters
visitorA functor that should be callable as R result=visitor(bound_value_const_ref)
itIterator to the dictionary
Template Parameters
FThe functor type; must define typename F::result_type.

Definition at line 110 of file dictionary.hpp.

template<typename F >
F::result_type alps::params_ns::apply_visitor ( const F &  visitor,
dictionary::const_iterator  it 
)
inline

Const-access visitor to a value by an iterator.

Parameters
visitorA functor that should be callable as R result=visitor(bound_value_const_ref)
itIterator to the dictionary
Template Parameters
FThe functor type; must define typename F::result_type.

Definition at line 120 of file dictionary.hpp.

template<typename F >
F::result_type alps::params_ns::apply_visitor ( F &  visitor,
const dict_value dv 
)
inline

Const-access visitor to the bound value.

Parameters
visitorfunctor should be callable as R result=visitor(bound_value_const_ref)
dvthe dictionary value to access

The functor type F must define typename F::result_type.

Definition at line 438 of file dict_value_impl.hpp.

template<typename F >
F::result_type alps::params_ns::apply_visitor ( const F &  visitor,
const dict_value dv 
)
inline

Const-access visitor to the bound value.

Parameters
visitorfunctor should be callable as R result=visitor(bound_value_const_ref)
dvthe dictionary value to access

The functor type F must define typename F::result_type.

Definition at line 450 of file dict_value_impl.hpp.

params& alps::params_ns::define_convenience_parameters ( params parameters)
inline

Defines a number of frequently-used parameters. Defines size_t timelimt, string outputfile, string checkpoint.

Definition at line 17 of file convenience_params.hpp.

bool alps::params_ns::operator!= ( const dictionary lhs,
const dictionary rhs 
)
inline

Definition at line 100 of file dictionary.hpp.

template<typename T >
bool alps::params_ns::operator!= ( const T &  lhs,
const dict_value rhs 
)
inline

Definition at line 465 of file dict_value_impl.hpp.

template<typename T >
bool alps::params_ns::operator!= ( const dict_value lhs,
const T &  rhs 
)
inline

Definition at line 483 of file dict_value_impl.hpp.

bool alps::params_ns::operator!= ( const dict_value lhs,
const dict_value rhs 
)
inline

Definition at line 497 of file dict_value_impl.hpp.

bool alps::params_ns::operator!= ( const dict_value lhs,
const char *  rhs 
)
inline

Definition at line 509 of file dict_value_impl.hpp.

bool alps::params_ns::operator!= ( const char *  lhs,
const dict_value rhs 
)
inline

Definition at line 521 of file dict_value_impl.hpp.

std::ostream& alps::params_ns::operator<< ( std::ostream &  s,
const dictionary d 
)

Definition at line 84 of file dictionary.cpp.

std::ostream& alps::params_ns::operator<< ( std::ostream &  os,
const dict_value dv 
)
inline

Print the value together with type in some human-readable format.

Definition at line 160 of file dict_value.hpp.

std::ostream& alps::params_ns::operator<< ( std::ostream &  s,
const params p 
)

Definition at line 482 of file params.cpp.

bool alps::params_ns::operator== ( const dictionary lhs,
const dictionary rhs 
)
inline

Definition at line 96 of file dictionary.hpp.

template<typename T >
bool alps::params_ns::operator== ( const T &  lhs,
const dict_value rhs 
)
inline

Definition at line 456 of file dict_value_impl.hpp.

template<typename T >
bool alps::params_ns::operator== ( const dict_value lhs,
const T &  rhs 
)
inline

Definition at line 474 of file dict_value_impl.hpp.

bool alps::params_ns::operator== ( const dict_value lhs,
const dict_value rhs 
)
inline

Definition at line 491 of file dict_value_impl.hpp.

bool alps::params_ns::operator== ( const dict_value lhs,
const char *  rhs 
)
inline

Definition at line 503 of file dict_value_impl.hpp.

bool alps::params_ns::operator== ( const char *  lhs,
const dict_value rhs 
)
inline

Definition at line 515 of file dict_value_impl.hpp.

std::string alps::params_ns::origin_name ( const params p)

Convenience function to obtain the "origin" filename associated with the parameters object.

The "origin" name can be used to generate, e.g., sensible output file names based on the parameter file names that passed to the program.

  • If the parameters object is restored from an archive, the archive name is its origin.
  • If the parameters object is constructed from INI file(s), the first INI file is its origin.
  • If the parameters object is constructed from the command line without INI files, the origin is the executable name (if available) stripped of its path.
  • Otherwise, the origin name is empty.

Definition at line 505 of file params.cpp.

std::ostream& alps::params_ns::print ( std::ostream &  s,
const dict_value dv,
bool  terse 
)

Definition at line 186 of file dict_value.cpp.

void alps::params_ns::swap ( params p1,
params p2 
)
inline

Definition at line 152 of file params_impl.hpp.