hpx/program_options/variables_map.hpp¶
See Public API for a list of names and headers that are part of the public HPX API.
-
namespace
hpx
-
namespace
program_options
Functions
-
void
store
(const basic_parsed_options<char> &options, variables_map &m, bool utf8 = false)¶ Stores in ‘m’ all options that are defined in ‘options’. If ‘m’ already has a non-defaulted value of an option, that value is not changed, even if ‘options’ specify some value.
-
void
store
(const basic_parsed_options<wchar_t> &options, variables_map &m)¶ Stores in ‘m’ all options that are defined in ‘options’. If ‘m’ already has a non-defaulted value of an option, that value is not changed, even if ‘options’ specify some value. This is wide character variant.
-
void
notify
(variables_map &m)¶ Runs all ‘notify’ function for options in ‘m’.
-
class
abstract_variables_map
¶ - #include <variables_map.hpp>
Implements string->string mapping with convenient value casting facilities.
Subclassed by hpx::program_options::variables_map
Public Functions
-
abstract_variables_map
()¶
-
abstract_variables_map
(const abstract_variables_map *next)¶
-
virtual
~abstract_variables_map
()¶
-
const variable_value &
operator[]
(const std::string &name) const¶ Obtains the value of variable ‘name’, from *this and possibly from the chain of variable maps.
if there’s no value in *this.
if there’s next variable map, returns value from it
otherwise, returns empty value
if there’s defaulted value
if there’s next variable map, which has a non-defaulted value, return that
otherwise, return value from *this
if there’s a non-defaulted value, returns it.
-
void
next
(abstract_variables_map *next)¶ Sets next variable map, which will be used to find variables not found in *this.
Private Functions
-
virtual const variable_value &
get
(const std::string &name) const = 0¶ Returns value of variable ‘name’ stored in *this, or empty value otherwise.
Private Members
-
const abstract_variables_map *
m_next
¶
-
-
class
variable_value
¶ - #include <variables_map.hpp>
Class holding value of option. Contains details about how the value is set and allows to conveniently obtain the value.
Public Functions
-
variable_value
()¶
-
variable_value
(const hpx::any_nonser &xv, bool xdefaulted)¶
-
template<class
T
>
const T &as
() const¶ If stored value if of type T, returns that value. Otherwise, throws boost::bad_any_cast exception.
-
template<class
T
>
T &as
()¶ This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
-
bool
empty
() const¶ Returns true if no value is stored.
-
bool
defaulted
() const¶ Returns true if the value was not explicitly given, but has default value.
-
hpx::any_nonser &
value
() const¶ Returns the contained value.
-
hpx::any_nonser &
value
()¶ Returns the contained value.
Private Members
-
hpx::any_nonser
v
¶
-
bool
m_defaulted
¶
-
std::shared_ptr<const value_semantic>
m_value_semantic
¶
Friends
-
friend
hpx::program_options::variables_map
-
void
store
(const basic_parsed_options<char> &options, variables_map &m, bool utf8)¶ Stores in ‘m’ all options that are defined in ‘options’. If ‘m’ already has a non-defaulted value of an option, that value is not changed, even if ‘options’ specify some value.
-
-
class
variables_map
: public hpx::program_options::abstract_variables_map, public std::map<std::string, variable_value>¶ - #include <variables_map.hpp>
Concrete variables map which store variables in real map.
This class is derived from std::map<std::string, variable_value>, so you can use all map operators to examine its content.
Public Functions
-
variables_map
()¶
-
variables_map
(const abstract_variables_map *next)¶
-
const variable_value &
operator[]
(const std::string &name) const¶
-
void
clear
()¶
-
void
notify
()¶
Private Functions
-
const variable_value &
get
(const std::string &name) const¶ Implementation of abstract_variables_map::get which does ‘find’ in *this.
Private Members
-
std::set<std::string>
m_final
¶ Names of option with ‘final’ values – which should not be changed by subsequence assignments.
-
std::map<std::string, std::string>
m_required
¶ Names of required options, filled by parser which has access to options_description. The map values are the “canonical” names for each corresponding option. This is useful in creating diagnostic messages when the option is absent.
Friends
-
void
store
(const basic_parsed_options<char> &options, variables_map &xm, bool utf8) Stores in ‘m’ all options that are defined in ‘options’. If ‘m’ already has a non-defaulted value of an option, that value is not changed, even if ‘options’ specify some value.
-
-
void
-
namespace