ParameterMapping.cpp
Go to the documentation of this file.
1 /*
2 * This file is part of ArmarX.
3 *
4 * Copyright (C) 2011-2016, High Performance Humanoid Technologies (H2T), Karlsruhe Institute of Technology (KIT), all rights reserved.
5 *
6 * ArmarX is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * ArmarX is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 *
18 * @package ArmarXCore::Statechart
19 * @author Mirko Waechter( mirko.waechter at kit dot edu)
20 * @date 2012
21 * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
22 * GNU General Public License
23 */
24 #include "ParameterMapping.h"
25 
26 #include "StateUtilFunctions.h"
27 #include "StatechartContext.h"
28 #include "StateParameter.h"
29 #include "Exception.h"
30 
32 
33 namespace armarx
34 {
35 
36  StatechartContext* ParameterMapping::__context = nullptr;
37 
38  ParameterMapping::ParameterMapping(const ParameterMapping& source) :
39  IceUtil::Shared(source),
40  Ice::Object(source),
41  ParameterMappingIceBase(source),
42  Logging(source)
43  {
44  *this = source;
45  }
46 
47 
48 
49  void
51  {
52  if (priorities.size() == 0)
53  {
54  _addMissingSources(priorities);
55  }
56 
57  if (__greedyInput)
58  {
59  PriorityMap::reverse_iterator it = priorities.rbegin();
60 
61  for (; it != priorities.rend(); ++it)
62  {
63  SourceDictionaryMap::iterator itSourceDict = sourceDictionaries.find(it->second);
64 
65  if (itSourceDict != sourceDictionaries.end())
66  {
67  _greedyMapping(targetDictionary, itSourceDict->second);
68  }
69  }
70  }
71 
72  PriorityMap::iterator it = priorities.begin();
73 
74  // iterate from start (low priority) and overwrite values later if found in higher
75  // priority dictionaries as well
76  for (; it != priorities.end(); ++it)
77  {
78  __fillFromMappingSource(it->second, targetDictionary);
79  }
80  }
81 
82  void ParameterMapping::__fillFromMappingSource(MappingSource mappingSource, StateParameterMap& targetDictionary)
83  {
84  if (mappingSource == eDataField)
85  {
86  // get data directly from the observer
87  _fillFromDataField(targetDictionary);
88  }
89  else if (mappingSource == eValue)
90  {
91  // get direct value mappings
92  _fillFromValues(targetDictionary);
93  }
94  else
95  {
96  // get data from source dictionaries
97 
98  // select which source dict to use
99  SourceDictionaryMap::iterator itSourceDict = sourceDictionaries.find(mappingSource);
100 
101  if (itSourceDict != sourceDictionaries.end())
102  {
103  for (StateParameterMap::iterator itTargetDict = targetDictionary.begin(); itTargetDict != targetDictionary.end(); itTargetDict++)
104  {
105  // get the specific entry (if existing) in the source dict for the selected target dict entry
106  StringVariantContainerBaseMap::const_iterator itSourceEntry = _hasMappingEntry(itTargetDict->first, itSourceDict->second, itSourceDict->first);
107 
108  if (itSourceEntry != itSourceDict->second.end())
109  {
110  __copyDataFromSourceDict(itSourceEntry, itTargetDict);
111  }
112  }
113  }
114  }
115 
116  }
117 
118  void ParameterMapping::__copyDataFromSourceDict(StringVariantContainerBaseMap::const_iterator& itSourceEntry, StateParameterMap::iterator itTargetEntry)
119  {
120  if (itSourceEntry->second->getSize() > 0)
121  {
122  if (!VariantContainerType::compare(itTargetEntry->second->value->getContainerType(), itSourceEntry->second->getContainerType()))
123  {
124  throw exceptions::local::eStatechartLogicError("Cannot map different types: " +
125  VariantContainerType::allTypesToString(itTargetEntry->second->value->getContainerType())
126  + " ("
127  + itTargetEntry->first
128  + ") vs. "
129  + VariantContainerType::allTypesToString(itSourceEntry->second->getContainerType())
130  + " ("
131  + itSourceEntry->first
132  + ")");
133  }
134  }
135 
136  {
137  // // copy data from source dictionary
138  // if (!VariantContainerType::compare(itTargetEntry->second->value->getContainerType(), itSourceEntry->second->getContainerType()))
139  // throw exceptions::local::eStatechartLogicError("Cannot map parameter! The variant type of targetkey '" + itTargetEntry->first + "' does not match sourcekey '" + itSourceEntry->first + "' ("
140  // + VariantContainerType::allTypesToString(itTargetEntry->second->value->getContainerType()) + " vs. " + VariantContainerType::allTypesToString(itSourceEntry->second->getContainerType()) + ")");
141 
142  itTargetEntry->second->value = itSourceEntry->second;//->cloneContainer();
143 
144 
145  }
146 
147 
148  itTargetEntry->second->set = true;
149  }
150 
151  void ParameterMapping::_greedyMapping(StateParameterMap& targetDictionary, StringVariantContainerBaseMap& sourceDictionary)
152  {
153  for (StringVariantContainerBaseMap::const_iterator it = sourceDictionary.begin(); it != sourceDictionary.end(); it++)
154  {
156  param->value = it->second->cloneContainer();
157  param->optionalParam = false;
158  param->set = true;
159 
160  targetDictionary[it->first] = param;
161  }
162  }
163 
165  {
166  std::map<std::string, std::pair < DataFieldIdentifierBaseList, std::vector<StateParameterPtr> > > observerSplittedMap;
167 
168  //first split required parameters by observer
169  MappingList::const_iterator itMapping;
170 
171  for (itMapping = mappings.begin(); itMapping != mappings.end(); ++itMapping)
172  {
173  if (itMapping->mappingSrc == eDataField)
174  {
175  StateParameterMap::iterator itTargetDict = targetDictionary.find(itMapping->targetKey);
176 
177  if (itTargetDict != targetDictionary.end())
178  {
179  DataFieldIdentifierBasePtr id = new DataFieldIdentifier(itMapping->sourceKey);
180 
181  observerSplittedMap[id->observerName].first.push_back(id);
182  observerSplittedMap[id->observerName].second.push_back(StateParameterPtr::dynamicCast(itTargetDict->second));
183  }
184  }
185  }
186 
187  //now get all the data from each observer in a bulk and set the stateparameterpointers
188  if (!__context && observerSplittedMap.size() != 0)
189  {
190  throw LocalException("StatechartContext Pointer is NULL");
191  }
192 
193  std::map<std::string, std::pair < DataFieldIdentifierBaseList, std::vector<StateParameterPtr> > >::iterator itObservers = observerSplittedMap.begin();
194 
195  for (; itObservers != observerSplittedMap.end(); ++itObservers)
196  {
197  std::string observerName = itObservers->first;
198  std::vector<StateParameterPtr>& paramList = itObservers->second.second;
199  TimedVariantBaseList variants = __context->getDataListFromObserver(observerName, itObservers->second.first);
200 
201  for (unsigned int i = 0; i < variants.size() && i < paramList.size(); ++i)
202  {
203  if (!variants.at(i)->getInitialized())
204  {
205  continue;
206  }
207  const Variant& data = *VariantPtr::dynamicCast(variants.at(i));
208  paramList.at(i)->value = new SingleVariant(data);
209  paramList.at(i)->set = true;
210  }
211 
212  }
213 
214  }
215 
217  {
218  MappingList::const_iterator itMapping;
219 
220  for (itMapping = mappings.begin(); itMapping != mappings.end(); ++itMapping)
221  {
222  if (itMapping->mappingSrc == eValue)
223  {
224  StateParameterMap::iterator itTargetDict = targetDictionary.find(itMapping->targetKey);
225 
226  if (itTargetDict != targetDictionary.end())
227  {
228  itTargetDict->second->value = itMapping->value;
229  itTargetDict->second->set = true;
230  }
231  }
232  }
233  }
234 
236  {
237  return PM::createMapping();
238  }
239 
240 
241 
243  {
244  Ice::ObjectPtr ptr = new ParameterMapping(*this);
245  return ptr;
246  }
247 
249  {
250  return ParameterMappingPtr::dynamicCast(ice_clone());
251  // ParameterMappingPtr ptr = new ParameterMapping(*this);
252  // return ptr;
253  }
254 
256  {
257  useParentsInput = rhs.useParentsInput;
258  __greedyInput = rhs.__greedyInput;
259  priorities = rhs.priorities;
260  mappings = rhs.mappings;
261  sourceDictionaries.clear();
262 
263  for (SourceDictionaryMap::const_iterator it = rhs.sourceDictionaries.begin(); it != rhs.sourceDictionaries.end(); ++it)
264  {
265  StateUtilFunctions::copyDictionary(it->second, sourceDictionaries[it->first]);
266  }
267 
268  return *this;
269  }
270 
271  std::string ParameterMapping::MappingSourceToString(MappingSource mappingSource)
272  {
273  switch (mappingSource)
274  {
275  case eParent:
276  return "Parent";
277 
278  case eOutput:
279  return "Output";
280 
281  case eDataField:
282  return "DataField";
283 
284  case eEvent:
285  return "Event";
286 
287  case eValue:
288  return "Value";
289 
290  default:
291  return "Undefined";
292  }
293  }
294 
295  MappingSource ParameterMapping::StringToMappingSource(const std::string& mappingSourceString)
296  {
297  if (mappingSourceString == "Parent")
298  {
299  return eParent;
300  }
301  else if (mappingSourceString == "Output")
302  {
303  return eOutput;
304  }
305  else if (mappingSourceString == "DataField")
306  {
307  return eDataField;
308  }
309  else if (mappingSourceString == "Event")
310  {
311  return eEvent;
312  }
313  else if (mappingSourceString == "Value")
314  {
315  return eValue;
316  }
317  else
318  {
319  return eMappingSourcesCount;
320  }
321  }
322 
323 
324  StringVariantContainerBaseMap::const_iterator ParameterMapping::_hasMappingEntry(const std::string& keyDestination, const StringVariantContainerBaseMap& sourceDict, MappingSource allowedMappingSource)
325  {
326  StringVariantContainerBaseMap::const_iterator result;
327  Ice::StringSeq fieldsDest = _getFields(keyDestination);
328 
329 
330  // first: find entry in mapping that fits somehow to keyDestination
331  // e.g. 'State1.*' fits to 'State1.angle', '*' fits to 'State1.angle', 'angle' does NOT fit to 'State1.angle'
332  // Note: '*.*' is same as '*'
333  int destWildcardIndex = -1;
334  MappingList::const_iterator it;
335 
336  for (it = mappings.begin(); it != mappings.end(); ++it)
337  {
338  if (it->mappingSrc != allowedMappingSource)
339  {
340  continue;
341  }
342 
343  bool found = true;
344  Ice::StringSeq mappingFields = _getFields(it->targetKey);
345 
346  for (unsigned int i = 0; i < fieldsDest.size(); ++i)
347  {
348  if (i >= mappingFields.size())
349  {
350  break;
351  }
352 
353  if (mappingFields.at(i) == "*")
354  {
355  destWildcardIndex = i;
356  }
357 
358  // check if mapping fields fit to fields of key of destination map
359  if (!(mappingFields.at(i) == "*" || mappingFields.at(i) == fieldsDest.at(i)))
360  {
361  found = false;
362  break;
363  }
364  }
365 
366  if (found)
367  {
368  // second: find key in SourceDict that fits to the 2nd parameter of the selected mapping entry
369  result = _findSourceEntry(it->sourceKey, sourceDict, destWildcardIndex, fieldsDest);
370 
371  if (result != sourceDict.end())
372  {
373  return result;
374  }
375  }
376 
377  }
378 
379  if (it == mappings.end())
380  {
381  result = sourceDict.end(); // not found
382  }
383 
384  return result;
385  }
386 
387  StringVariantContainerBaseMap::const_iterator
388  ParameterMapping::_findSourceEntry(const std::string sourceKey, const StringVariantContainerBaseMap& sourceDict, int destWildcardIndex, const Ice::StringSeq& fieldsDest)
389  {
390  StringVariantContainerBaseMap::const_iterator result = sourceDict.end();
391  Ice::StringSeq mappingFields = _getFields(sourceKey);
392 
393  for (result = sourceDict.begin(); result != sourceDict.end(); ++result)
394  {
395  Ice::StringSeq fieldsSrcDict = _getFields(result->first);
396  bool found = true;
397 
398  for (unsigned int i = 0; i < fieldsSrcDict.size(); ++i)
399  {
400  if (i >= mappingFields.size())
401  {
402  break;
403  }
404 
405  assert(i < fieldsSrcDict.size());
406 
407  if (mappingFields.at(i) == "*")
408  {
409  // check if all fields match after the wildcard
410  for (int j = 0; j < int(fieldsSrcDict.size()) - int(i); ++j)
411  {
412  assert(i + j < fieldsSrcDict.size());
413  assert(destWildcardIndex + j < (int)fieldsDest.size());
414 
415  if (fieldsSrcDict.at(i + j) != fieldsDest.at(destWildcardIndex + j))
416  {
417  found = false;
418  break;
419  }
420  }
421 
422  if (!found)
423  {
424  break;
425  }
426  }
427  // check if the fields do match exactly
428  else if (mappingFields.at(i) != fieldsSrcDict.at(i))
429  {
430  found = false;
431  break;
432  }
433  }
434 
435  if (found)
436  {
437  return result;
438  }
439  }
440 
441  return result;
442  }
443 
444 
445 
446  Ice::StringSeq ParameterMapping::_getFields(std::string source, char seperator)
447  {
448  std::vector<std::string> result;
449  size_t pos;
450 
451  while ((pos = source.find(seperator)) != std::string::npos)
452  {
453  result.push_back(source.substr(0, pos));
454  source = source.substr(pos + 1);
455  }
456 
457  result.push_back(source);
458  return result;
459  }
460 
461  void ParameterMapping::_addMissingSources(PriorityMap& priorityMap)
462  {
463  int lowestPriority = 0;
464 
465  if (priorityMap.begin() != priorityMap.end())
466  {
467  lowestPriority = priorityMap.begin()->first;
468  }
469 
470  bool found = false;
471 
472  for (int i = 0; i < (int) eMappingSourcesCount; ++i)
473  {
474  PriorityMap::iterator it = priorityMap.begin();
475 
476  for (; it != priorityMap.end(); ++it)
477  {
478  if (int(it->second) == i)
479  {
480  found = true;
481  }
482  }
483 
484  if (!found)
485  {
486  priorityMap[--lowestPriority] = MappingSource(i);
487  }
488  }
489  }
490 
491  // ParameterMappingPtr
492  // ParameterMapping::addTuple(const std::string & sourceKey,
493  // const std::string & targetKey){
494  // Ice::StringSeq sourceKeySeq = getFields(sourceKey);
495  // Ice::StringSeq targetKeySeq = getFields(targetKey);
496  // if((*sourceKeySeq.rbegin()=="*" && *targetKeySeq.rbegin() != "*")
497  // || (*sourceKeySeq.rbegin()!="*" && *targetKeySeq.rbegin() == "*"))
498  // throw exceptions::local::eLogicError("A parameter mapping cannot map from a wildcard to a specific key or vice versa. Either both keys must be wildcards or none.");
499  // paramMapping[targetKey] = sourceKey;
500  // return this;
501  // }
502 
503  ParameterMappingPtr ParameterMapping::setSourcePriority(int priorityLevel, MappingSource mappingSrc, const Ice::Current& c)
504  {
505  if (priorities.find(priorityLevel) != priorities.end())
506  {
507  std::stringstream stream;
508  stream << "Priority level " << priorityLevel << " already exists!";
509  throw exceptions::local::eStatechartLogicError(stream.str());
510  }
511 
512  priorities[priorityLevel] = mappingSrc;
513  return this;
514  }
515 
516 
517 
518  ParameterMappingPtr ParameterMapping::_addSourceDictionary(MappingSource mappingSrc, const StringVariantContainerBaseMap& sourceDict, const Ice::Current& c)
519  {
520  // StateUtilFunctions::copyDictionary(sourceDict, sourceDictionaries[mappingSrc]);
521  sourceDictionaries[mappingSrc] = sourceDict;
522  return this;
523  }
524 
525  void ParameterMapping::addMappingEntry(MappingSource mappingSource, const std::string& sourceKey, const std::string& targetKey, VariantContainerBasePtr value)
526  {
527  if (!value && mappingSource == eValue)
528  {
529  return;
530  }
531  MappingEntry entry;
532  entry.mappingSrc = mappingSource;
533  entry.targetKey = targetKey;
534  entry.sourceKey = sourceKey;
535  entry.value = value;
536  mappings.push_back(entry);
537  }
538 
540  {
542  return ptr;
543  }
544 
545 
546  ParameterMappingPtr ParameterMapping::mapFromOutput(const std::string& sourceKey, const std::string& targetKey, const Ice::Current& c)
547  {
548  addMappingEntry(eOutput, sourceKey, targetKey);
549  return this;
550  }
551 
552  ParameterMappingPtr ParameterMapping::mapFromOutput(const std::string& bothKeys, const Ice::Current& c)
553  {
554  addMappingEntry(eOutput, bothKeys, bothKeys);
555  return this;
556  }
557 
558  ParameterMappingPtr ParameterMapping::mapFromParent(const std::string& parentKey, const std::string& targetKey, const Ice::Current& c)
559  {
560  addMappingEntry(eParent, parentKey, targetKey);
561  return this;
562  }
563 
564  ParameterMappingPtr ParameterMapping::mapFromParent(const std::string& bothKeys, const Ice::Current& c)
565  {
566  addMappingEntry(eParent, bothKeys, bothKeys);
567  return this;
568  }
569 
570  ParameterMappingPtr ParameterMapping::mapFromEvent(const std::string& eventKey, const std::string& targetKey, const Ice::Current& c)
571  {
572  addMappingEntry(eEvent, eventKey, targetKey);
573  return this;
574  }
575 
576  ParameterMappingPtr ParameterMapping::mapFromEvent(const std::string& bothKeys, const Ice::Current& c)
577  {
578  addMappingEntry(eEvent, bothKeys, bothKeys);
579  return this;
580  }
581 
582  ParameterMappingPtr ParameterMapping::mapFromDataField(const DataFieldIdentifierBasePtr& dataFieldIdentifier, const std::string& targetKey, const Ice::Current& c)
583  {
584  DataFieldIdentifierPtr id = DataFieldIdentifierPtr::dynamicCast(dataFieldIdentifier);
585  addMappingEntry(eDataField, id->getIdentifierStr(), targetKey);
586  return this;
587  }
588 
590  {
591  __greedyInput = on;
592  return this;
593  }
594 
596  {
597  ParameterMapping::__context = context;
598  }
599 }
600 
601 
602 
603 std::ostream& std::operator<<(std::ostream& stream, const armarx::ParameterMapping& mapping)
604 {
605  for (const ::armarx::MappingEntry& elem : mapping.mappings)
606  {
607  stream << armarx::ParameterMapping::MappingSourceToString(elem.mappingSrc) << ": " << elem.sourceKey << " -> " << elem.targetKey << "\n";
608  }
609 
610  return stream;
611 }
612 
armarx::Variant
The Variant class is described here: Variants.
Definition: Variant.h:224
armarx::ParameterMapping
This class maps parameters from several source dictionaries to one input dictionary....
Definition: ParameterMapping.h:64
armarx::ParameterMapping::mapFromParent
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 parame...
Definition: ParameterMapping.cpp:558
armarx::ParameterMapping::mapFromDataField
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 ...
Definition: ParameterMapping.cpp:582
armarx::ParameterMapping::_hasMappingEntry
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.
Definition: ParameterMapping.cpp:324
armarx::ParameterMapping::_addSourceDictionary
ParameterMappingPtr _addSourceDictionary(MappingSource mappingSrc, const StringVariantContainerBaseMap &sourceDict, const Ice::Current &c=Ice::emptyCurrent)
Definition: ParameterMapping.cpp:518
armarx::ParameterMapping::createMapping
static ParameterMappingPtr createMapping()
Creates a new instance of a ParameterMapping. Since the constructors are private, this method must be...
Definition: ParameterMapping.cpp:539
armarx::ParameterMapping::_addMissingSources
static void _addMissingSources(PriorityMap &priorityMap)
Definition: ParameterMapping.cpp:461
armarx::ParameterMapping::operator=
ParameterMapping & operator=(const ParameterMapping &rhs)
Definition: ParameterMapping.cpp:255
c
constexpr T c
Definition: UnscentedKalmanFilterTest.cpp:43
DataFieldIdentifier.h
armarx::ParameterMapping::clone
virtual ParameterMappingPtr clone() const
Returns a new instance of ParameterMapping with the contents of this instance.
Definition: ParameterMapping.cpp:248
armarx::createMapping
ParameterMappingPtr createMapping()
Returns a new and empty instance of ParameterMapping.
Definition: ParameterMapping.cpp:235
StateUtilFunctions.h
ParameterMapping.h
IceUtil
Definition: Instance.h:21
armarx::ParameterMapping::ice_clone
::Ice::ObjectPtr ice_clone() const override
Returns a new instance of ParameterMapping with the contents of this instance.
Definition: ParameterMapping.cpp:242
armarx::ParameterMapping::setSourcePriority
ParameterMappingPtr setSourcePriority(int priorityLevel, MappingSource mappingSrc, const Ice::Current &c=Ice::emptyCurrent)
Adds a priority for a specific source dictionary to the mapping.
Definition: ParameterMapping.cpp:503
StateParameter.h
armarx::ParameterMapping::_applyMapping
void _applyMapping(StateParameterMap &targetDictionary)
This function applies a given mapping to the given inputdictionary.
Definition: ParameterMapping.cpp:50
armarx::exceptions::local::eStatechartLogicError
Definition: Exception.h:30
StatechartContext.h
IceInternal::Handle
Definition: forward_declarations.h:8
armarx::ParameterMapping::mapFromOutput
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 ...
Definition: ParameterMapping.cpp:546
armarx::ParameterMapping::_setStatechartContext
static void _setStatechartContext(StatechartContext *__context)
Definition: ParameterMapping.cpp:595
armarx::ParameterMapping::_findSourceEntry
StringVariantContainerBaseMap::const_iterator _findSourceEntry(const std::string sourceKey, const StringVariantContainerBaseMap &sourceDict, int destWildcardIndex, const Ice::StringSeq &fieldsDest)
Definition: ParameterMapping.cpp:388
cxxopts::value
std::shared_ptr< Value > value()
Definition: cxxopts.hpp:926
armarx::ParameterMapping::StringToMappingSource
static MappingSource StringToMappingSource(const std::string &mappingSourceString)
Definition: ParameterMapping.cpp:295
armarx::ParameterMapping::_greedyMapping
void _greedyMapping(StateParameterMap &targetDictionary, StringVariantContainerBaseMap &sourceDictionary)
Definition: ParameterMapping.cpp:151
armarx::ParameterMapping::setTargetDictToGreedy
ParameterMappingPtr setTargetDictToGreedy(bool on=true)
Sets the behaviour of the mapping into the target dictionary to greedy.
Definition: ParameterMapping.cpp:589
armarx::SingleVariant
The SingleVariant class is required to store single Variant instances in VariantContainer subclasses.
Definition: VariantContainer.h:109
armarx::statechartmodel::StateParameterMap
QMap< QString, StateParameterPtr > StateParameterMap
Definition: StateParameter.h:46
armarx::VariantContainerType::compare
static bool compare(const ContainerTypePtr &type1, const ContainerTypePtr &secondType)
Definition: VariantContainer.cpp:203
armarx::StatechartContext
This class contains a statechart and provides the interfaces to distributed components.
Definition: StatechartContext.h:89
armarx::ParameterMapping::mapFromEvent
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 t...
Definition: ParameterMapping.cpp:570
data
uint8_t data[1]
Definition: EtherCATFrame.h:68
armarx::StateUtilFunctions::copyDictionary
void copyDictionary(const StringVariantContainerBaseMap &source, StringVariantContainerBaseMap &destination)
Clears the destination map and copies the parameters of the source in it.
Definition: StateUtilFunctions.cpp:184
armarx::ParameterMapping::_getFields
static Ice::StringSeq _getFields(std::string source, char seperator='.')
Takes a string and seperates the string by the seperator-char.
Definition: ParameterMapping.cpp:446
armarx::ParameterMapping::_fillFromValues
void _fillFromValues(StateParameterMap &targetDictionary)
Definition: ParameterMapping.cpp:216
boost::source
Vertex source(const detail::edge_base< Directed, Vertex > &e, const PCG &)
Definition: point_cloud_graph.h:681
std::operator<<
ARMARXCORE_IMPORT_EXPORT ostream & operator<<(ostream &stream, const armarx::RunningTaskIceBase &task)
armarx::ParameterMapping::MappingSourceToString
static std::string MappingSourceToString(MappingSource mappingSource)
Definition: ParameterMapping.cpp:271
armarx::ParameterMapping::_fillFromDataField
void _fillFromDataField(StateParameterMap &targetDictionary)
Definition: ParameterMapping.cpp:164
Ice
Definition: DBTypes.cpp:64
armarx::StatechartContext::getDataListFromObserver
TimedVariantBaseList getDataListFromObserver(std::string observerName, const DataFieldIdentifierBaseList &identifierList) override
Definition: StatechartContext.cpp:122
armarx::StateParameter::create
static StateParameterPtr create()
Definition: StateParameter.cpp:58
armarx::aron::type::ObjectPtr
std::shared_ptr< Object > ObjectPtr
Definition: Object.h:36
Exception.h
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:28
armarx::DataFieldIdentifier
DataFieldIdentifier provide the basis to identify data field within a distributed ArmarX scenario.
Definition: DataFieldIdentifier.h:48
armarx::VariantContainerType::allTypesToString
static std::string allTypesToString(const ContainerTypePtr &type)
Definition: VariantContainer.cpp:232
armarx::ParameterMapping::addMappingEntry
void addMappingEntry(MappingSource mappingSource, const std::string &sourceKey, const std::string &targetKey, VariantContainerBasePtr value=nullptr)
Definition: ParameterMapping.cpp:525