Classes | Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members

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
 
OptionsListoperator= (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
 

Detailed Description

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.

Note
Parts of the public functionality of the OptionsList class are tunnelled via the Options class into the AlgorithmicBase class to be used in derived classes. In case public functionality is modified or added to this class, the Options class as well as the AlgorithmicBase class have to be adapted accordingly.
Author
Hans Joachim Ferreau, Boris Houska, Milan Vukov

Definition at line 67 of file options_list.hpp.

Member Typedef Documentation

typedef std::map<std::pair<OptionsName, OptionsItemType>, std::shared_ptr< OptionValueBase > > OptionsList::OptionItems
private

Type for options items.

Definition at line 212 of file options_list.hpp.

Constructor & Destructor Documentation

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.

Member Function Documentation

template<typename T >
returnValue OptionsList::add ( OptionsName  name,
const T value 
)
inline

Add an option item with a given value.

Template Parameters
TOption data type.
Parameters
[in]nameName of new option item.
[in]valueDefault value of new option.
Returns
SUCCESSFUL_RETURN,
RET_OPTION_ALREADY_EXISTS,
RET_OPTIONS_LIST_CORRUPTED

Definition at line 237 of file options_list.hpp.

returnValue OptionsList::declareOptionsUnchanged ( )
inline

Declares all options to be unchanged.

Returns
SUCCESSFUL_RETURN
template<typename T >
returnValue OptionsList::get ( OptionsName  name,
T value 
) const
inline

Returns value of an existing option item of integer type.

Template Parameters
TOption data type.
Parameters
[in]nameName of option item.
[out]valueValue of option.
Returns
SUCCESSFUL_RETURN,
RET_OPTION_DOESNT_EXISTS

Definition at line 251 of file options_list.hpp.

uint OptionsList::getNumber ( ) const
inline

Returns total number of option items in list.

Returns
Total number of options in list
template<typename T >
OptionsItemType OptionsList::getType ( ) const
inlineprivate

A helper function to determine type of an option.

Definition at line 221 of file options_list.hpp.

template<>
OptionsItemType OptionsList::getType ( ) const
inlineprivate

Definition at line 225 of file options_list.hpp.

template<>
OptionsItemType OptionsList::getType ( ) const
inlineprivate

Definition at line 229 of file options_list.hpp.

BooleanType OptionsList::hasOption ( OptionsName  name,
OptionsItemType  type 
) const
inline

Determines whether a given option exists or not.

@param[in] name             Name of option item.
@param[in] type             Internal type of option item.
Returns
BT_TRUE iff option item exists,
BT_FALSE otherwise
BooleanType OptionsList::haveOptionsChanged ( ) const
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.

Returns
SUCCESSFUL_RETURN

Definition at line 77 of file options_list.cpp.

template<typename T >
returnValue OptionsList::set ( OptionsName  name,
const T value 
)
inline

Sets value of an existing option item of integer type to a given value.

Template Parameters
TOption data type.
Parameters
[in]nameName of option item.
[in]valueNew value of option.
Returns
SUCCESSFUL_RETURN,
RET_OPTION_DOESNT_EXISTS,
RET_OPTIONS_LIST_CORRUPTED

Definition at line 271 of file options_list.hpp.

Member Data Documentation

OptionItems OptionsList::items
private

Option items.

Definition at line 214 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 187 of file options_list.hpp.


The documentation for this class was generated from the following files:


acado
Author(s): Milan Vukov, Rien Quirynen
autogenerated on Mon Jun 10 2019 12:35:25