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::shared_ptr< OptionValueBase > > | OptionItems |
Private Member Functions | |
template<typename T > | |
OptionsItemType | getType () const |
template<> | |
OptionsItemType | getType () const |
template<> | |
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 67 of file options_list.hpp.
|
private |
Type for options items.
Definition at line 212 of file options_list.hpp.
BEGIN_NAMESPACE_ACADO OptionsList::OptionsList | ( | ) |
Default constructor.
Definition at line 48 of file options_list.cpp.
OptionsList::OptionsList | ( | const OptionsList & | rhs | ) |
Copy constructor (deep copy).
@param[in] rhs Right-hand side object.
Definition at line 54 of file options_list.cpp.
OptionsList::~OptionsList | ( | ) |
Destructor.
Definition at line 61 of file options_list.cpp.
|
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 237 of file options_list.hpp.
|
inline |
Declares all options to be unchanged.
|
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 251 of file options_list.hpp.
|
inline |
Returns total number of option items in list.
|
inlineprivate |
A helper function to determine type of an option.
Definition at line 221 of file options_list.hpp.
|
inlineprivate |
Definition at line 225 of file options_list.hpp.
|
inlineprivate |
Definition at line 229 of file options_list.hpp.
|
inline |
Determines whether a given option exists or not.
@param[in] name Name of option item. @param[in] type Internal type of option item.
|
inline |
Determines whether options have been modified.
\return BT_TRUE iff options have been modified, \n BT_FALSE otherwise
OptionsList & OptionsList::operator= | ( | const OptionsList & | rhs | ) |
Assignment operator (deep copy).
@param[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.
|
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 271 of file options_list.hpp.
|
private |
Option items.
Definition at line 214 of file options_list.hpp.
|
private |
Flag indicating whether the value of at least one option item has been changed.
Definition at line 187 of file options_list.hpp.