armarx::armem::detail Namespace Reference

Classes

struct  SuccessHeader
 

Functions

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<class Ice >
void fromIce (const Ice &ice, SuccessHeader &header)
 
template<class Ice >
void toIce (Ice &ice, const SuccessHeader &header)
 

Function Documentation

◆ accumulateFromPrefixes() [1/3]

std::vector<ValueT> armarx::armem::detail::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.

This is a specialization of the general accumulateFromPrefixes for appending vector values into a single vector.

See also
accumulateFromPrefixes for a detailed description
Parameters
keyValMapthe map that contains the key-value-pairs to search
prefixFuncthe function that returns the longest non-identical prefix of the key
keythe key to calculate the prefixes of

Definition at line 201 of file container_maps.h.

◆ accumulateFromPrefixes() [2/3]

std::vector<ValueT> armarx::armem::detail::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.

This is a specialization of the general accumulateFromPrefixes for collecting single values into a vector.

See also
accumulateFromPrefixes for a detailed description
Parameters
keyValMapthe map that contains the key-value-pairs to search
prefixFuncthe function that returns the longest non-identical prefix of the key
keythe key to calculate the prefixes of

Definition at line 177 of file container_maps.h.

◆ accumulateFromPrefixes() [3/3]

AccumulateT armarx::armem::detail::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.

AccumulateT is a type that the values will be accumulated into using accumulateFunc. accumulateFunc is a function that modifies the given accumulator (by, e.g., adding the given value to it).

The values are accumulated in order from the longest key to the shortest.

See also
getWithLongestPrefix for a description of prefixFunc
Parameters
keyValMapthe map that contains the key-value-pairs to search
prefixFuncthe function that returns the longest non-identical prefix of the key
accumulateFuncthe function that accumulates the values in the accumulator
keythe key to calculate the prefixes of

Definition at line 138 of file container_maps.h.

◆ findEntryWithLongestPrefix()

std::map<KeyT, ValueT>::const_iterator armarx::armem::detail::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.

prefixFunc is used to successively calculate the prefixes of the given key. It must be pure and return an empty optional when there is no shorter prefix of the given key (for strings, this would be the case when passed the empty string).

Parameters
keyValMapthe map that contains the key-value-pairs to search
prefixFuncthe function that returns the longest non-identical prefix of the key
keythe key to calculate the prefixes of
Returns
The iterator pointing to the found entry, or keyValMap.end().

Definition at line 52 of file container_maps.h.

◆ findEntryWithLongestPrefixAnd()

std::map<KeyT, ValueT>::const_iterator armarx::armem::detail::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.

prefixFunc is used to successively calculate the prefixes of the given key. It must be pure and return an empty optional when there is no shorter prefix of the given key (for strings, this would be the case when passed the empty string). predicate is used to filter for entries that satisfy the desired condition. It must be pure.

Parameters
keyValMapthe map that contains the key-value-pairs to search
prefixFuncthe function that returns the longest non-identical prefix of the key
predicatethe predicate to filter entries on
keythe key to calculate the prefixes of
Returns
The iterator pointing to the found entry, or keyValMap.end().

Definition at line 95 of file container_maps.h.

◆ fromIce()

void armarx::armem::detail::fromIce ( const Ice &  ice,
SuccessHeader header 
)

Definition at line 32 of file SuccessHeader.h.

◆ toIce()

void armarx::armem::detail::toIce ( Ice &  ice,
const SuccessHeader header 
)

Definition at line 26 of file SuccessHeader.h.