Runtime config options provider. More...
#include <config.hpp>
Public Member Functions | |
void | init () |
Initialize program options. More... | |
Static Public Member Functions | |
static void | add_option (const string &group, const string &option, const string &help) |
Adds a new boolean flag. More... | |
template<typename T > | |
static void | add_option (const string &group, const string &option, const string &help) |
Adds a new parameter with an expected value of type T . More... | |
Static Public Attributes | |
static const size_t | LINE_WIDTH = 100 |
line width of help and usage information More... | |
Private Member Functions | |
options () | |
options (const options &)=delete | |
void | operator= (const options &)=delete |
Private Attributes | |
po::options_description | all_options |
map< string, po::options_description > | option_groups |
po::variables_map | variables_map |
vector< string > | unrecognized_args |
bool | initialized = false |
static options & | get_instance () |
Accessor to the singleton instance. More... | |
po::variables_map & | get_variables_map () |
po::options_description & | get_all_options () |
vector< string > & | get_unrecognized_args () |
Runtime config options provider.
This singleton provides easy access to command line parameters at runtime.
Definition at line 65 of file config.hpp.
|
private |
Definition at line 13 of file config_impl.hpp.
|
privatedelete |
|
static |
Adds a new boolean flag.
[in] | group | string identifying the parameter group |
[in] | option | Name of the command line parameter. It is possible to specify a long and optional short option name by comma-separation. Short option names are identified by being only a single character. They are automatically parsed as '-[SHORT] ' by boost::program_options in contrast to '--[LONG] '. |
[in] | help | help text to be displayed in the help and usage information |
Definition at line 41 of file config_impl.hpp.
|
static |
Adds a new parameter with an expected value of type T
.
T | type of the specified parameter |
[in] | group | string identifying the parameter group |
[in] | option | Name of the command line parameter. It is possible to specify a long and optional short option name by comma-separation. Short option names are identified by being only a single character. They are automatically parsed as '-[SHORT] ' by boost::program_options in contrast to '--[LONG] '. |
[in] | help | help text to be displayed in the help and usage information |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 57 of file config_impl.hpp.
po::options_description & pfasst::config::options::get_all_options | ( | ) |
Definition at line 27 of file config_impl.hpp.
|
static |
Accessor to the singleton instance.
Definition at line 16 of file config_impl.hpp.
Referenced by pfasst::log::add_custom_logger(), and pfasst::log::set_global_logging_options().
vector< string > & pfasst::config::options::get_unrecognized_args | ( | ) |
Definition at line 32 of file config_impl.hpp.
po::variables_map & pfasst::config::options::get_variables_map | ( | ) |
Definition at line 22 of file config_impl.hpp.
Referenced by pfasst::log::add_custom_logger(), and pfasst::log::set_global_logging_options().
void pfasst::config::options::init | ( | ) |
Initialize program options.
This initializes boost::program_options
with all previously added options and groups.
Definition at line 72 of file config_impl.hpp.
References pfasst::log::initialized.
|
privatedelete |
|
private |
Definition at line 72 of file config.hpp.
|
private |
Definition at line 76 of file config.hpp.
|
static |
line width of help and usage information
Definition at line 69 of file config.hpp.
|
private |
Definition at line 73 of file config.hpp.
|
private |
Definition at line 75 of file config.hpp.
|
private |
Definition at line 74 of file config.hpp.