ObjectMap< K, V >::Value Class Reference

Class to provide safe access to mapped value. More...

#include <ObjectMap.h>

Public Member Functions

 Value (ObjectMap< K, V > &map, const K &key)
 
const K & getKey () const
 
V * getValue () const
 
Valueoperator= (V *newValue)
 
 operator V* () const
 
V * operator-> () const
 
bool remove ()
 Remove this value from the map. More...
 
V * extract ()
 Get the value for a given key and remove it from the map, without destroying it. More...
 

Detailed Description

template<typename K, typename V>
class ObjectMap< K, V >::Value

Class to provide safe access to mapped value.

Note
ObjectMap operator[] returns one of these, which provides behaviour consistent with V*

Constructor & Destructor Documentation

◆ Value()

template<typename K , typename V >
ObjectMap< K, V >::Value::Value ( ObjectMap< K, V > &  map,
const K &  key 
)
inline

Member Function Documentation

◆ extract()

template<typename K , typename V >
V* ObjectMap< K, V >::Value::extract ( )
inline

Get the value for a given key and remove it from the map, without destroying it.

Return values
V*
Note
The returned object must be freed by the caller when no longer required

◆ getKey()

template<typename K , typename V >
const K& ObjectMap< K, V >::Value::getKey ( ) const
inline

◆ getValue()

template<typename K , typename V >
V* ObjectMap< K, V >::Value::getValue ( ) const
inline

◆ operator V*()

template<typename K , typename V >
ObjectMap< K, V >::Value::operator V* ( ) const
inline

◆ operator->()

template<typename K , typename V >
V* ObjectMap< K, V >::Value::operator-> ( ) const
inline

◆ operator=()

template<typename K , typename V >
Value& ObjectMap< K, V >::Value::operator= ( V *  newValue)
inline

◆ remove()

template<typename K , typename V >
bool ObjectMap< K, V >::Value::remove ( )
inline

Remove this value from the map.

Return values
booltrue if the value was found and removed

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