Cambridge SMT System
|
#include <registrypo.hpp>
Public Member Functions | |
std::string | dump (const std::string &decorator_start="", const std::string &decorator_end="") |
Dumps all configuration parameters into a string with a reasonably pretty format. More... | |
RegistryPO (const bpo::variables_map &vm) | |
Trivial Constructor. More... | |
RegistryPO (int argc, const char *argv[]) | |
Constructor Runs init_param_options to parse and store in a bpo::variables_map all the values. Once this object is loaded, all command-line/config parameters have been parsed and we know it is safe to get values. More... | |
RegistryPO (const std::unordered_map< std::string, boost::any > &v) | |
Constructor Forces a set of values using program_options. The hashmap can contain either bools, (u)ints, chars or strings, floats. Possibly there is a better way to fill in manually program_options::variables_map variable. This constructor is only recommended for testing purposes. More... | |
template<typename T > | |
T | get (const std::string &key) const |
Returns parsed value associated to key. More... | |
std::string | getString (const std::string &key) const |
Performs get<string> and checks whether the real value is to be loaded from file (–param=file://.....) More... | |
bool | getBool (const std::string &key) const |
To handle yes|no program option values. More... | |
bool | exists (const std::string &key) const |
Determines whether a program option (key) has been defined by the user. More... | |
std::vector< std::string > | getVectorString (const std::string &key) const |
Convenience method that returns a vector of strings taking "," as the separator character. More... | |
std::string | getVectorString (const std::string &key, uint index) const |
Convenience method that returns a vector of strings taking "," as the separator character. More... | |
unordered_set< std::string > | getSetString (const std::string &key) const |
Convenience method that returns a set of strings taking "," as the separator character. More... | |
template<typename NumberT > | |
unordered_set< NumberT > | getSetNumber (const std::string &key) const |
Templated method that returns a set of numbers taking "," as the separator character. More... | |
unordered_map< uint, std::string > | getMappedIndexString (const std::string &key) const |
Convenience method that returns a hash of strings indexed by position and taking "," as the separator character. More... | |
unordered_map< std::string, uint > | getMappedStringIndex (const std::string &key) const |
Convenience method that returns a hash of indices indexed by string and taking "," as the separator character. More... | |
unordered_map< std::string, uint > | getPairMappedStringUInt (const std::string &key) const |
Convenience method that builds a hash with pairs taking "," as the separator character. Pair elements assumed to be unsigned integers. For instance, –param=X,3,T,5 => hash["X"]=3 and hash["T"]=5. More... | |
Definition at line 95 of file registrypo.hpp.
|
inline |
Trivial Constructor.
Definition at line 134 of file registrypo.hpp.
|
inline |
Constructor Runs init_param_options to parse and store in a bpo::variables_map all the values. Once this object is loaded, all command-line/config parameters have been parsed and we know it is safe to get values.
argc | parameter counter (identical to that of main function) |
argv | holds command-line parameter values (identical to that of main function) |
Definition at line 143 of file registrypo.hpp.
|
inline |
Constructor Forces a set of values using program_options. The hashmap can contain either bools, (u)ints, chars or strings, floats. Possibly there is a better way to fill in manually program_options::variables_map variable. This constructor is only recommended for testing purposes.
Definition at line 155 of file registrypo.hpp.
|
inline |
Dumps all configuration parameters into a string with a reasonably pretty format.
decorator_start | : A user-defined string prepended as a head to the parameter list |
decorator_end | : user-defined string appended as a foot to the parameter list |
Definition at line 108 of file registrypo.hpp.
|
inline |
Determines whether a program option (key) has been defined by the user.
Definition at line 235 of file registrypo.hpp.
|
inline |
Returns parsed value associated to key.
Definition at line 194 of file registrypo.hpp.
|
inline |
To handle yes|no program option values.
Definition at line 225 of file registrypo.hpp.
|
inline |
Convenience method that returns a hash of strings indexed by position and taking "," as the separator character.
key | key to query. |
Definition at line 308 of file registrypo.hpp.
|
inline |
Convenience method that returns a hash of indices indexed by string and taking "," as the separator character.
key | key to query. |
Definition at line 323 of file registrypo.hpp.
|
inline |
Convenience method that builds a hash with pairs taking "," as the separator character. Pair elements assumed to be unsigned integers. For instance, –param=X,3,T,5 => hash["X"]=3 and hash["T"]=5.
key | key to query. |
Definition at line 340 of file registrypo.hpp.
|
inline |
Templated method that returns a set of numbers taking "," as the separator character.
key | key to query. |
Definition at line 294 of file registrypo.hpp.
|
inline |
Convenience method that returns a set of strings taking "," as the separator character.
key | key to query. |
Definition at line 279 of file registrypo.hpp.
|
inline |
Performs get<string> and checks whether the real value is to be loaded from file (–param=file://.....)
Definition at line 205 of file registrypo.hpp.
|
inline |
Convenience method that returns a vector of strings taking "," as the separator character.
key | key to query. |
Definition at line 245 of file registrypo.hpp.
|
inline |
Convenience method that returns a vector of strings taking "," as the separator character.
key | key to query. |
index | Points to index-th element in the vector |
Definition at line 261 of file registrypo.hpp.