|
| 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.
|
| |
| 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.
|
| |
| 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.
|
| |
| 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.
|
| |
| 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.
|
| |
| template<class Ice> |
| void | fromIce (const Ice &ice, SuccessHeader &header) |
| |
| template<class Ice> |
| void | toIce (Ice &ice, const SuccessHeader &header) |
| |
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.
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
-
| keyValMap | the map that contains the key-value-pairs to search |
| prefixFunc | the function that returns the longest non-identical prefix of the key |
| accumulateFunc | the function that accumulates the values in the accumulator |
| key | the key to calculate the prefixes of |
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.
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
-
| keyValMap | the map that contains the key-value-pairs to search |
| prefixFunc | the function that returns the longest non-identical prefix of the key |
| key | the key to calculate the prefixes of |
- Returns
- The iterator pointing to the found entry, or
keyValMap.end().
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.
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
-
| keyValMap | the map that contains the key-value-pairs to search |
| prefixFunc | the function that returns the longest non-identical prefix of the key |
| predicate | the predicate to filter entries on |
| key | the key to calculate the prefixes of |
- Returns
- The iterator pointing to the found entry, or
keyValMap.end().