torc::generic::ParameterMap Class Reference

#include <ParameterMap.hpp>

List of all members.

Public Types

typedef SymTab< std::string,
ParameterSharedPtr, true > 
TabParams
typedef boost::shared_ptr
< TabParams
TabParamsPtr

Public Member Functions

ParameterSharedPtr get (const ParameterContext &inContext, const std::string &inName) const throw ()
void set (const ParameterContext &inContext, const std::string &inName, const ParameterSharedPtr &inParam) throw ()
void getAllParameters (const ParameterContext &inContext, std::map< std::string, ParameterSharedPtr > &outParams) const throw ()
void getOverriddenParameters (const ParameterContext &inContext, std::map< std::string, ParameterSharedPtr > &outParams) const throw ()
template<typename _Action>
void applyOnAllParameters (const ParameterContext &inContext, const _Action &action) throw (Error)
template<typename _Action>
void applyOnOverriddenParameters (const ParameterContext &inContext, const _Action &action) throw (Error)
ParameterContext getNewContext () throw ()
void registerContext (const ParameterContext &inContext, const ParameterContext &inParentContext=ParameterContext()) throw (Error)
bool isContextRegistered (const ParameterContext &inContext) const throw ()
void unregisterContext (const ParameterContext &inContext) throw ()
 ParameterMap (const ParameterMap &source) throw ()
ParameterMapoperator= (const ParameterMap &source) throw ()

Private Types

typedef boost::shared_ptr
< ParamData > 
ParamDataPtr

Private Attributes

SymTab< ParameterContext,
ParamDataPtr > 
mParameters
ParameterContext mNextContext

Classes

struct  ParamData


Detailed Description

Stores Name-Parameter mappings. This map can be used to get and set values for different parameters.

Definition at line 37 of file ParameterMap.hpp.


Member Function Documentation

ParameterSharedPtr torc::generic::ParameterMap::get ( const ParameterContext &  inContext,
const std::string &  inName 
) const throw ()

Get a named parameter or null if none exists

Returns:
The parameter

Definition at line 31 of file ParameterMap.cpp.

void torc::generic::ParameterMap::set ( const ParameterContext &  inContext,
const std::string &  inName,
const ParameterSharedPtr &  inParam 
) throw ()

Saves a parameter by name. Overrides existing parameters if it exists.

Parameters:
[in] inContext the context for which the param is valid
[in] inName name of param
[in] inParam pointer to the parameter

Definition at line 56 of file ParameterMap.cpp.

void torc::generic::ParameterMap::getAllParameters ( const ParameterContext &  inContext,
std::map< std::string, ParameterSharedPtr > &  outParams 
) const throw ()

Get all parameter name-value-pairs

Parameters:
[in] inContext the context for which the param is valid
[out] outParams Map to be populated

Definition at line 73 of file ParameterMap.cpp.

void torc::generic::ParameterMap::getOverriddenParameters ( const ParameterContext &  inContext,
std::map< std::string, ParameterSharedPtr > &  outParams 
) const throw ()

Get all parameter name-value-pairs that have been overridden in this context. For a view context this will return an empty map.

Parameters:
[in] inContext the context for which the param is valid
[out] outParams Map to be populated

Definition at line 114 of file ParameterMap.cpp.

template<typename _Action>
void torc::generic::ParameterMap::applyOnAllParameters ( const ParameterContext &  inContext,
const _Action &  action 
) throw (Error) [inline]

Apply action on all parameters.

Parameters:
[in] inContext the context for which the param is valid
[in] action Action to be applied

Definition at line 145 of file ParameterMap.hpp.

template<typename _Action>
void torc::generic::ParameterMap::applyOnOverriddenParameters ( const ParameterContext &  inContext,
const _Action &  action 
) throw (Error) [inline]

Apply action on overridden parameters

Parameters:
[in] inContext the context for which the param is valid
[in] action Action to be applied

Definition at line 177 of file ParameterMap.hpp.


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

Generated on Thu Oct 13 16:50:14 2011 for TORC by  doxygen 1.5.6