Provides a generic list of options (for internal use). More...
#include <options_list.hpp>
Classes | |
struct | OptionValue |
struct | OptionValueBase |
Public Member Functions | |
template<typename T > | |
returnValue | add (OptionsName name, const T &value) |
returnValue | declareOptionsUnchanged () |
template<typename T > | |
returnValue | get (OptionsName name, T &value) const |
uint | getNumber () const |
BooleanType | hasOption (OptionsName name, OptionsItemType type) const |
BooleanType | haveOptionsChanged () const |
OptionsList & | operator= (const OptionsList &rhs) |
OptionsList () | |
OptionsList (const OptionsList &rhs) | |
returnValue | printOptionsList () const |
template<typename T > | |
returnValue | set (OptionsName name, const T &value) |
~OptionsList () | |
Private Types | |
typedef std::map< std::pair < OptionsName, OptionsItemType > , std::tr1::shared_ptr < OptionValueBase > > | OptionItems |
Private Member Functions | |
template<typename T > | |
OptionsItemType | getType () const |
Private Attributes | |
OptionItems | items |
BooleanType | optionsHaveChanged |
Provides a generic list of options (for internal use).
The class OptionsList provides a generic options list that allows to dynamically setup and extend option lists. It is intended for internal use only, as all user-functionality is encapsulated within the class Options.
Definition at line 71 of file options_list.hpp.
typedef std::map<std::pair<OptionsName, OptionsItemType>, std::tr1::shared_ptr< OptionValueBase > > OptionsList::OptionItems [private] |
Type for options items.
Definition at line 216 of file options_list.hpp.
Default constructor.
Definition at line 48 of file options_list.cpp.
OptionsList::OptionsList | ( | const OptionsList & | rhs | ) |
Copy constructor (deep copy).
[in] | rhs | Right-hand side object. |
Definition at line 54 of file options_list.cpp.
Destructor.
Definition at line 61 of file options_list.cpp.
returnValue OptionsList::add | ( | OptionsName | name, |
const T & | value | ||
) | [inline] |
Add an option item with a given value.
T | Option data type. |
[in] | name | Name of new option item. |
[in] | value | Default value of new option. |
Definition at line 241 of file options_list.hpp.
returnValue OptionsList::declareOptionsUnchanged | ( | ) | [inline] |
Declares all options to be unchanged.
returnValue OptionsList::get | ( | OptionsName | name, |
T & | value | ||
) | const [inline] |
Returns value of an existing option item of integer type.
T | Option data type. |
[in] | name | Name of option item. |
[out] | value | Value of option. |
Definition at line 255 of file options_list.hpp.
uint OptionsList::getNumber | ( | ) | const [inline] |
Returns total number of option items in list.
OptionsItemType OptionsList::getType< double > | ( | ) | const [inline, private] |
A helper function to determine type of an option.
Definition at line 225 of file options_list.hpp.
BooleanType OptionsList::hasOption | ( | OptionsName | name, |
OptionsItemType | type | ||
) | const [inline] |
Determines whether a given option exists or not.
[in] | name | Name of option item. |
[in] | type | Internal type of option item. |
BooleanType OptionsList::haveOptionsChanged | ( | ) | const [inline] |
Determines whether options have been modified.
OptionsList & OptionsList::operator= | ( | const OptionsList & | rhs | ) |
Assignment operator (deep copy).
[in] | rhs | Right-hand side object. |
Definition at line 65 of file options_list.cpp.
returnValue OptionsList::printOptionsList | ( | ) | const |
Prints a list of all available options.
Definition at line 77 of file options_list.cpp.
returnValue OptionsList::set | ( | OptionsName | name, |
const T & | value | ||
) | [inline] |
Sets value of an existing option item of integer type to a given value.
T | Option data type. |
[in] | name | Name of option item. |
[in] | value | New value of option. |
Definition at line 275 of file options_list.hpp.
OptionItems OptionsList::items [private] |
Option items.
Definition at line 218 of file options_list.hpp.
BooleanType OptionsList::optionsHaveChanged [private] |
Flag indicating whether the value of at least one option item has been changed.
Definition at line 191 of file options_list.hpp.