|
This class maps parameters from several source dictionaries to one input dictionary. The mapping depends on an instance of ParameterMappingIceBase, in which the mapping is specified.
More...
#include <ArmarXCore/statechart/ParameterMapping.h>
Public Member Functions | |
void | addMappingEntry (MappingSource mappingSource, const std::string &sourceKey, const std::string &targetKey, VariantContainerBasePtr value=nullptr) |
virtual ParameterMappingPtr | clone () const |
Returns a new instance of ParameterMapping with the contents of this instance. More... | |
::Ice::ObjectPtr | ice_clone () const override |
Returns a new instance of ParameterMapping with the contents of this instance. More... | |
ParameterMappingPtr | mapFromDataField (const DataFieldIdentifierBasePtr &dataFieldIdentifier, const std::string &targetKey, const Ice::Current &c=Ice::emptyCurrent) |
Adds an entry to the ParameterMapping, that maps the value of the datafield entry to the targetKey's value of the target dictionary. More... | |
ParameterMappingPtr | mapFromEvent (const std::string &bothKeys, const Ice::Current &c=Ice::emptyCurrent) |
ParameterMappingPtr | mapFromEvent (const std::string &eventKey, const std::string &targetKey, const Ice::Current &c=Ice::emptyCurrent) |
Adds an entry to the ParameterMapping, that maps the sourceKey's value from the event parameters of the transition to the targetKey's value of the target dictionary. More... | |
ParameterMappingPtr | mapFromOutput (const std::string &bothKeys, const Ice::Current &c=Ice::emptyCurrent) |
ParameterMappingPtr | mapFromOutput (const std::string &sourceKey, const std::string &targetKey, const Ice::Current &c=Ice::emptyCurrent) |
Adds an entry to the ParameterMapping, that maps the sourceKey's value from the output parameters of the last state to the targetKey's value of the target dictionary. More... | |
ParameterMappingPtr | mapFromParent (const std::string &bothKeys, const Ice::Current &c=Ice::emptyCurrent) |
ParameterMappingPtr | mapFromParent (const std::string &parentKey, const std::string &targetKey, const Ice::Current &c=Ice::emptyCurrent) |
Adds an entry to the ParameterMapping, that maps the sourceKey's value from the parent's input parameters of the current state to the targetKey's value of the target dictionary. More... | |
ParameterMapping & | operator= (const ParameterMapping &rhs) |
ParameterMappingPtr | setSourcePriority (int priorityLevel, MappingSource mappingSrc, const Ice::Current &c=Ice::emptyCurrent) |
Adds a priority for a specific source dictionary to the mapping. More... | |
ParameterMappingPtr | setTargetDictToGreedy (bool on=true) |
Sets the behaviour of the mapping into the target dictionary to greedy. More... | |
Public Member Functions inherited from Logging | |
SpamFilterDataPtr | deactivateSpam (float deactivationDurationSec=10.0f, const std::string &identifier="", bool deactivate=true) const |
disables the logging for the current line for the given amount of seconds. More... | |
MessageTypeT | getEffectiveLoggingLevel () const |
Logging () | |
void | setLocalMinimumLoggingLevel (MessageTypeT level) |
With setLocalMinimumLoggingLevel the minimum verbosity-level of log-messages can be set. More... | |
void | setTag (const LogTag &tag) |
void | setTag (const std::string &tagName) |
virtual | ~Logging () |
Static Public Member Functions | |
static ParameterMappingPtr | createMapping () |
Creates a new instance of a ParameterMapping. Since the constructors are private, this method must be used, to create a new ParameterMapping. More... | |
static std::string | MappingSourceToString (MappingSource mappingSource) |
static MappingSource | StringToMappingSource (const std::string &mappingSourceString) |
Protected Member Functions | |
ParameterMappingPtr | _addSourceDictionary (MappingSource mappingSrc, const StringVariantContainerBaseMap &sourceDict, const Ice::Current &c=Ice::emptyCurrent) |
void | _applyMapping (StateParameterMap &targetDictionary) |
This function applies a given mapping to the given inputdictionary. More... | |
void | _fillFromDataField (StateParameterMap &targetDictionary) |
void | _fillFromValues (StateParameterMap &targetDictionary) |
StringVariantContainerBaseMap::const_iterator | _findSourceEntry (const std::string sourceKey, const StringVariantContainerBaseMap &sourceDict, int destWildcardIndex, const Ice::StringSeq &fieldsDest) |
void | _greedyMapping (StateParameterMap &targetDictionary, StringVariantContainerBaseMap &sourceDictionary) |
StringVariantContainerBaseMap::const_iterator | _hasMappingEntry (const std::string &keyDestination, const StringVariantContainerBaseMap &sourceDict, MappingSource allowedMappingSource) |
Checks wether the mapping has an entry like keyDestination that maps onto a parameter of mapSource. More... | |
~ParameterMapping () override | |
Protected Member Functions inherited from Logging | |
bool | checkLogLevel (MessageTypeT level) const |
const LogSenderPtr & | getLogSender () const |
Retrieve log sender. More... | |
LogSenderPtr | loghelper (const char *file, int line, const char *function) const |
Static Protected Member Functions | |
static void | _addMissingSources (PriorityMap &priorityMap) |
static Ice::StringSeq | _getFields (std::string source, char seperator='.') |
Takes a string and seperates the string by the seperator-char. More... | |
static void | _setStatechartContext (StatechartContext *__context) |
Friends | |
template<class EventType , class StateType > | |
class | FinalStateBase |
class | StateBase |
class | StatechartContext |
class | StateController |
Additional Inherited Members | |
Protected Attributes inherited from Logging | |
MessageTypeT | minimumLoggingLevel |
SpamFilterDataPtr | spamFilter |
LogTag | tag |
This class maps parameters from several source dictionaries to one input dictionary. The mapping depends on an instance of ParameterMappingIceBase, in which the mapping is specified.
An example mapping looks like this:
sourceKey: State1.timeout
targetKey: State2.globaltimeout
This would map the value of the outputparameter of a state named "State1.timeout" on the value of the inputparameter of a state named "State2.globaltimeout".
Also wildcards are possible.
sourceKey: State1.*
targetKey: State2.*
This mapping would try to map all parameters of a source on the inputparameters of a target state. But only those that are matching exactly on the wildcard level.
Definition at line 64 of file ParameterMapping.h.
|
inlineoverrideprotected |
Definition at line 165 of file ParameterMapping.h.
|
staticprotected |
|
protected |
Definition at line 518 of file ParameterMapping.cpp.
|
protected |
This function applies a given mapping to the given inputdictionary.
All source-dictionary pointers can be set to NULL if the dictionary should not be considered. The function applyStandardMapping() is executed everytime a mapping is applied with this function. Afterwards the specified (if any) mapping is applied and overwrites the standard mapping.
Definition at line 50 of file ParameterMapping.cpp.
|
protected |
|
protected |
Definition at line 216 of file ParameterMapping.cpp.
|
protected |
Definition at line 388 of file ParameterMapping.cpp.
|
staticprotected |
Takes a string and seperates the string by the seperator-char.
Inserts all strings between the seperator-chars into a vector of strings (without the seperator-char).
E.g. 'State.angle' transforms the 'State' and 'angle'
Definition at line 446 of file ParameterMapping.cpp.
|
protected |
Definition at line 151 of file ParameterMapping.cpp.
|
protected |
Checks wether the mapping has an entry like keyDestination that maps onto a parameter of mapSource.
Definition at line 324 of file ParameterMapping.cpp.
|
staticprotected |
Definition at line 595 of file ParameterMapping.cpp.
void addMappingEntry | ( | MappingSource | mappingSource, |
const std::string & | sourceKey, | ||
const std::string & | targetKey, | ||
VariantContainerBasePtr | value = nullptr |
||
) |
Definition at line 525 of file ParameterMapping.cpp.
|
virtual |
Returns a new instance of ParameterMapping with the contents of this instance.
Definition at line 248 of file ParameterMapping.cpp.
|
static |
Creates a new instance of a ParameterMapping. Since the constructors are private, this method must be used, to create a new ParameterMapping.
Definition at line 539 of file ParameterMapping.cpp.
|
override |
Returns a new instance of ParameterMapping with the contents of this instance.
Definition at line 242 of file ParameterMapping.cpp.
ParameterMappingPtr mapFromDataField | ( | const DataFieldIdentifierBasePtr & | dataFieldIdentifier, |
const std::string & | targetKey, | ||
const Ice::Current & | c = Ice::emptyCurrent |
||
) |
Adds an entry to the ParameterMapping, that maps the value of the datafield entry to the targetKey's value of the target dictionary.
sourceKey | The key in the source dictionary. |
targetKey | The key in the target dictionary. |
Definition at line 582 of file ParameterMapping.cpp.
ParameterMappingPtr mapFromEvent | ( | const std::string & | bothKeys, |
const Ice::Current & | c = Ice::emptyCurrent |
||
) |
ParameterMappingPtr mapFromEvent | ( | const std::string & | eventKey, |
const std::string & | targetKey, | ||
const Ice::Current & | c = Ice::emptyCurrent |
||
) |
Adds an entry to the ParameterMapping, that maps the sourceKey's value from the event parameters of the transition to the targetKey's value of the target dictionary.
sourceKey | The key in the source dictionary. |
targetKey | The key in the target dictionary. |
Definition at line 570 of file ParameterMapping.cpp.
ParameterMappingPtr mapFromOutput | ( | const std::string & | bothKeys, |
const Ice::Current & | c = Ice::emptyCurrent |
||
) |
ParameterMappingPtr mapFromOutput | ( | const std::string & | sourceKey, |
const std::string & | targetKey, | ||
const Ice::Current & | c = Ice::emptyCurrent |
||
) |
Adds an entry to the ParameterMapping, that maps the sourceKey's value from the output parameters of the last state to the targetKey's value of the target dictionary.
sourceKey | The key in the source dictionary. |
targetKey | The key in the target dictionary. |
Definition at line 546 of file ParameterMapping.cpp.
ParameterMappingPtr mapFromParent | ( | const std::string & | bothKeys, |
const Ice::Current & | c = Ice::emptyCurrent |
||
) |
ParameterMappingPtr mapFromParent | ( | const std::string & | parentKey, |
const std::string & | targetKey, | ||
const Ice::Current & | c = Ice::emptyCurrent |
||
) |
Adds an entry to the ParameterMapping, that maps the sourceKey's value from the parent's input parameters of the current state to the targetKey's value of the target dictionary.
sourceKey | The key in the source dictionary. |
targetKey | The key in the target dictionary. |
Definition at line 558 of file ParameterMapping.cpp.
|
static |
Definition at line 271 of file ParameterMapping.cpp.
ParameterMapping & operator= | ( | const ParameterMapping & | rhs | ) |
ParameterMappingPtr setSourcePriority | ( | int | priorityLevel, |
MappingSource | mappingSrc, | ||
const Ice::Current & | c = Ice::emptyCurrent |
||
) |
Adds a priority for a specific source dictionary to the mapping.
The priorities determine which source dictionary is chosen, if two entries of different source dictionaries map onto the same target parameter. Each priority level can only be used once. If the priority level already exists, an eLogicError exception is thrown.
eLogicError |
priorityLevel | Any int value possible. High value -> Higher Priority |
mappingSrc | The mapping source for which this priority level should apply. |
Definition at line 503 of file ParameterMapping.cpp.
ParameterMappingPtr setTargetDictToGreedy | ( | bool | on = true | ) |
Sets the behaviour of the mapping into the target dictionary to greedy.
Greedy means, that all parameters of all source dictionaries that have the same key value will be mapped into the target dictionary, whether or not they are specified in the mapping.
on | If true, the mapping is greedy. |
Definition at line 589 of file ParameterMapping.cpp.
|
static |
Definition at line 295 of file ParameterMapping.cpp.
|
friend |
Definition at line 161 of file ParameterMapping.h.
|
friend |
Definition at line 159 of file ParameterMapping.h.
|
friend |
Definition at line 162 of file ParameterMapping.h.
|
friend |
Definition at line 160 of file ParameterMapping.h.