JayBeams
0.1
Another project to have fun coding.
|
Helper class to easily define configuration attributes. More...
#include <config_attribute.hpp>
Public Types | |
typedef C | container_type |
typedef T | value_type |
Public Member Functions | |
void | swap (config_attribute< container_type, value_type > &rhs) |
Swap values, containers are not changed. More... | |
value_type const & | operator() () const |
Accessor. More... | |
container_type & | operator() (value_type const &x) |
Modify value. More... | |
container_type & | operator() (value_type &&x) |
Modify value with move semantics. More... | |
![]() | |
virtual | ~attribute_base ()=0 |
Destructor. More... | |
attribute_descriptor const & | descriptor () const |
std::string const & | name () const |
std::string const & | class_name () const |
std::string const & | help () const |
bool | positional () const |
Private Member Functions | |
Configuration object recursion functions. | |
void | apply_overrides (YAML::Node const &by_name, class_overrides const &by_class) override |
Call the right version of jb::apply_overrides for the contained value. More... | |
void | add_options (boost::program_options::options_description &options, std::string const &prefix, config_object::attribute_descriptor const &d) const override |
Call the right version of jb::add_options for the contained value. More... | |
void | apply_cmdline_values (boost::program_options::variables_map const &vm, std::string const &name) override |
Call the right version of jb::apply_cmdline_values. More... | |
void | validate () const override |
Call the right version of jb::validate. More... | |
YAML::Node | to_yaml () const override |
Print out the configuration settings in YAML format. More... | |
Private Attributes | |
container_type *const | container_ |
value_type | value_ |
Friends | |
struct | config_recurse |
Additional Inherited Members | |
![]() | |
attribute_base (attribute_descriptor const &d, config_object *container) | |
Constructor. More... | |
template<typename container_type > | |
attribute_base (container_type *) | |
Helper class to easily define configuration attributes.
The Jaybeams configuration framework requires all configuration objects to define accessors and modifiers for each attribute that follow this pattern:
This is a helper class to create such attributes easily.
C | the type of the object that contains the attribute |
T | the type of the object contained in this attribute |
Definition at line 54 of file config_attribute.hpp.
typedef C jb::config_attribute< C, T >::container_type |
Definition at line 56 of file config_attribute.hpp.
typedef T jb::config_attribute< C, T >::value_type |
Definition at line 57 of file config_attribute.hpp.
|
inlineexplicitprivate |
Definition at line 89 of file config_attribute.hpp.
Referenced by jb::config_attribute< jb::testing::microbenchmark_config, bool >::config_attribute().
|
inlineprivate |
Definition at line 94 of file config_attribute.hpp.
|
inlineprivate |
Definition at line 101 of file config_attribute.hpp.
|
inlineprivate |
Definition at line 107 of file config_attribute.hpp.
|
inlineprivate |
Definition at line 115 of file config_attribute.hpp.
|
inlineprivate |
Definition at line 121 of file config_attribute.hpp.
|
inlineprivate |
Definition at line 130 of file config_attribute.hpp.
|
inlineprivate |
Definition at line 137 of file config_attribute.hpp.
|
inlineprivate |
Definition at line 145 of file config_attribute.hpp.
|
inlineprivate |
Definition at line 153 of file config_attribute.hpp.
|
privatedelete |
|
privatedelete |
|
inlineoverrideprivatevirtual |
Call the right version of jb::add_options for the contained value.
Implements jb::config_object::attribute_base.
Definition at line 189 of file config_attribute.hpp.
|
inlineoverrideprivatevirtual |
Call the right version of jb::apply_cmdline_values.
Implements jb::config_object::attribute_base.
Definition at line 197 of file config_attribute.hpp.
Referenced by jb::config_recurse::apply_cmdline_values().
|
inlineoverrideprivatevirtual |
Call the right version of jb::apply_overrides for the contained value.
Implements jb::config_object::attribute_base.
Definition at line 183 of file config_attribute.hpp.
Referenced by jb::config_recurse::apply_overrides().
|
inline |
Accessor.
Definition at line 65 of file config_attribute.hpp.
|
inline |
Modify value.
Definition at line 70 of file config_attribute.hpp.
|
inline |
Modify value with move semantics.
Definition at line 76 of file config_attribute.hpp.
|
inlineprivate |
Definition at line 166 of file config_attribute.hpp.
|
inlineprivate |
Definition at line 171 of file config_attribute.hpp.
|
inline |
Swap values, containers are not changed.
Definition at line 60 of file config_attribute.hpp.
|
inlineoverrideprivatevirtual |
Print out the configuration settings in YAML format.
Implements jb::config_object::attribute_base.
Definition at line 209 of file config_attribute.hpp.
Referenced by jb::config_recurse::to_yaml().
|
inlineoverrideprivatevirtual |
Call the right version of jb::validate.
Implements jb::config_object::attribute_base.
Definition at line 204 of file config_attribute.hpp.
Referenced by jb::config_recurse::validate().
|
friend |
Definition at line 177 of file config_attribute.hpp.
|
private |
Definition at line 215 of file config_attribute.hpp.
Referenced by jb::config_attribute< jb::testing::microbenchmark_config, bool >::operator()().
|
private |
Definition at line 88 of file config_attribute.hpp.
|
private |
Definition at line 216 of file config_attribute.hpp.
Referenced by jb::config_attribute< jb::testing::microbenchmark_config, bool >::add_options(), jb::config_attribute< jb::testing::microbenchmark_config, bool >::apply_cmdline_values(), jb::config_attribute< jb::testing::microbenchmark_config, bool >::apply_overrides(), jb::config_attribute< jb::testing::microbenchmark_config, bool >::operator()(), jb::config_attribute< jb::testing::microbenchmark_config, bool >::operator=(), jb::config_attribute< jb::testing::microbenchmark_config, bool >::swap(), jb::config_attribute< jb::testing::microbenchmark_config, bool >::to_yaml(), and jb::config_attribute< jb::testing::microbenchmark_config, bool >::validate().