Dataflow Runtime API  3.0.3.0
Classes | Static Public Member Functions | List of all members
imt::base::os::winec7::MapUtils Class Reference

Utility template methods for class std::map. More...

#include <Imt.Base.OS.WinEC7/MapUtils.h>

Classes

class  createMap
 Allows initialization of maps in constructor initializer lists. More...
 

Static Public Member Functions

template<class KeyType , class ValueType >
static bool includesKey (const std::map< KeyType, ValueType > &map, const KeyType &key)
 Tests whether the key is included in the map. More...
 
template<class KeyType , class ValueType >
static bool includesValue (const std::map< KeyType, ValueType > &map, const ValueType &value)
 Tests whether the value is included in the map. More...
 
template<class KeyType , class ValueType >
static bool getValue (const std::map< KeyType, ValueType > &map, const KeyType &key, ValueType &value)
 Return the value at given key. More...
 
template<class KeyType , class ValueType >
static ValueType getValueDefault (const std::map< KeyType, ValueType > &map, const KeyType &key, const ValueType &defaultValue)
 Return the value at given key. More...
 
template<class KeyType , class ValueType >
static bool getKey (const std::map< KeyType, ValueType > &map, const ValueType &value, KeyType &key)
 Return the key at given value. More...
 
template<class KeyType , class ValueType >
static void removeValue (std::map< KeyType, ValueType > &map, const ValueType &value)
 Removes given value. More...
 

Detailed Description

Utility template methods for class std::map.

Member Function Documentation

◆ getKey()

template<class KeyType , class ValueType >
static bool imt::base::os::winec7::MapUtils::getKey ( const std::map< KeyType, ValueType > &  map,
const ValueType &  value,
KeyType &  key 
)
inlinestatic

Return the key at given value.

Parameters
mapA map to search in
valueThe value to search
keyThe returned key
Returns
True if successful, false otherwhise.

◆ getValue()

template<class KeyType , class ValueType >
static bool imt::base::os::winec7::MapUtils::getValue ( const std::map< KeyType, ValueType > &  map,
const KeyType &  key,
ValueType &  value 
)
inlinestatic

Return the value at given key.

Parameters
mapA map to search in
keyThe key to search
valueThe value (copy constructor will be used!)
Returns
true if value was found, false otherwise

◆ getValueDefault()

template<class KeyType , class ValueType >
static ValueType imt::base::os::winec7::MapUtils::getValueDefault ( const std::map< KeyType, ValueType > &  map,
const KeyType &  key,
const ValueType &  defaultValue 
)
inlinestatic

Return the value at given key.

If the given key is not found return the given default value.

Parameters
mapA map to search in
keyThe key to search
defaultValueThe default value
Returns
the value (copy constructor will be used!)

◆ includesKey()

template<class KeyType , class ValueType >
static bool imt::base::os::winec7::MapUtils::includesKey ( const std::map< KeyType, ValueType > &  map,
const KeyType &  key 
)
inlinestatic

Tests whether the key is included in the map.

The operator== used to determine the match between an element and the specified value must impose an equivalence relation between its operands.

Parameters
mapThe map to operate on.
keyThe key possibly in the map.
Returns
true if the key is included in the vector, false otherwise
See also
std::find

◆ includesValue()

template<class KeyType , class ValueType >
static bool imt::base::os::winec7::MapUtils::includesValue ( const std::map< KeyType, ValueType > &  map,
const ValueType &  value 
)
inlinestatic

Tests whether the value is included in the map.

◆ removeValue()

template<class KeyType , class ValueType >
static void imt::base::os::winec7::MapUtils::removeValue ( std::map< KeyType, ValueType > &  map,
const ValueType &  value 
)
inlinestatic

Removes given value.


The documentation for this class was generated from the following file: