Sming Framework API
Sming - Open Source framework for high efficiency WiFi SoC ESP8266 native development with C++ language.
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*

Member Function Documentation

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
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