Utility template methods for class std::map.
More...
#include <Imt.Base.OS.WinEC7/MapUtils.h>
|
class | createMap |
| Allows initialization of maps in constructor initializer lists. More...
|
|
|
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...
|
|
Utility template methods for class std::map.
◆ 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
-
map | A map to search in |
value | The value to search |
key | The 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
-
map | A map to search in |
key | The key to search |
value | The 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
-
map | A map to search in |
key | The key to search |
defaultValue | The 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
-
map | The map to operate on. |
key | The 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 |
The documentation for this class was generated from the following file:
- D:/_Work/10/s/Imt.Base/Imt.Base.OS.WinEC7/MapUtils.h