container_maps.h File Reference
#include <map>
#include <optional>
#include <tuple>
#include <RobotAPI/libraries/armem/core/MemoryID.h>
+ Include dependency graph for container_maps.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

 armarx
 This file offers overloads of toIce() and fromIce() functions for STL container types.
 
 armarx::armem
 
 armarx::armem::detail
 

Functions

template<typename ValueT >
std::vector< ValueT > accumulateEntriesContainingID (const std::map< MemoryID, std::vector< ValueT >> &idMap, const MemoryID &key)
 Return all values of keys containing the given ID in a flattened vector. More...
 
template<typename ValueT >
std::vector< ValueT > accumulateEntriesContainingID (const std::map< MemoryID, ValueT > &idMap, const MemoryID &id)
 Return all values of keys containing the given ID. More...
 
template<typename KeyT , typename ValueT >
std::vector< ValueT > accumulateFromPrefixes (const std::map< KeyT, std::vector< ValueT >> &keyValMap, const std::function< std::optional< KeyT >(const KeyT &)> &prefixFunc, const KeyT &key)
 Collect all the values in a map for which the keys are prefixes of the given key. More...
 
template<typename KeyT , typename ValueT >
std::vector< ValueT > accumulateFromPrefixes (const std::map< KeyT, ValueT > &keyValMap, const std::function< std::optional< KeyT >(const KeyT &)> &prefixFunc, const KeyT &key)
 Collect all the values in a map for which the keys are prefixes of the given key. More...
 
template<typename KeyT , typename ValueT , typename AccumulateT >
AccumulateT accumulateFromPrefixes (const std::map< KeyT, ValueT > &keyValMap, const std::function< std::optional< KeyT >(const KeyT &)> &prefixFunc, const std::function< void(AccumulateT &, const ValueT &)> accumulateFunc, const KeyT &key)
 Accumulate all the values in a map for which the keys are prefixes of the given key. More...
 
template<typename KeyT , typename ValueT >
std::map< KeyT, ValueT >::const_iterator findEntryWithLongestPrefix (const std::map< KeyT, ValueT > &keyValMap, const std::function< std::optional< KeyT >(KeyT &)> &prefixFunc, const KeyT &key)
 Get the entry in the map for which the returned key is the longest prefix of the given key among the keys in the map. More...
 
template<typename KeyT , typename ValueT >
std::map< KeyT, ValueT >::const_iterator findEntryWithLongestPrefixAnd (const std::map< KeyT, ValueT > &keyValMap, const std::function< std::optional< KeyT >(KeyT &)> &prefixFunc, const KeyT &key, const std::function< bool(const KeyT &, const ValueT &)> &predicate)
 Get the entry in the map for which the returned key is the longest prefix of the given key among the keys in the map that satisfy the predicate. More...
 
template<typename ValueT >
std::map< MemoryID, ValueT >::const_iterator findMostSpecificEntryContainingID (const std::map< MemoryID, ValueT > &idMap, const MemoryID &id)
 Find the entry with the most specific key that contains the given ID, or idMap.end() if no key contains the ID. More...
 
template<typename ValueT >
std::map< MemoryID, ValueT >::const_iterator findMostSpecificEntryContainingIDAnd (const std::map< MemoryID, ValueT > &idMap, const MemoryID &id, const std::function< bool(const MemoryID &, const ValueT &)> &predicate)
 Find the entry with the most specific key that contains the given ID and satisfies the predicate, or idMap.end() if no key contains the ID and satisfies the predicate. More...
 
std::optional< MemoryID > getMemoryIDParent (const MemoryID &memID)