![]() |
This is Unofficial EPICS BASE Doxygen Site
|
An associative map where a weak_ptr to the value is stored. More...
#include "weakmap.h"
Classes | |
class | element_proxy |
Public Types | |
typedef K | key_type |
typedef V | value_type |
typedef std::tr1::shared_ptr< V > | value_pointer |
typedef std::tr1::weak_ptr< V > | value_weak_pointer |
typedef std::set< value_pointer > | set_type |
typedef epicsMutex | mutex_type |
typedef epicsGuard< epicsMutex > | guard_type |
typedef epicsGuardRelease< epicsMutex > | release_type |
typedef std::map< K, value_pointer, C > | lock_map_type |
typedef std::vector< std::pair< K, value_pointer > > | lock_vector_type |
Public Member Functions | |
weak_value_map () | |
Construct a new empty set. More... | |
void | swap (weak_value_map &O) |
void | clear () |
bool | empty () const |
size_t | size () const |
element_proxy | operator[] (const K &k) |
value_pointer | operator[] (const K &k) const |
value_pointer | find (const K &k) const |
value_pointer | insert (const K &k, value_pointer &v) |
lock_map_type | lock_map () const |
Return an equivalent map with strong value references. More... | |
lock_vector_type | lock_vector () const |
epicsMutex & | mutex () const |
An associative map where a weak_ptr to the value is stored.
Acts like std::map<K, weak_ptr<V> > where entries are automatically removed when no longer referenced.
Meant to be used in situations where an object must hold some weak references of entries which it can iterate.
Note that insert() and operator[] w/ assignment replaces the reference pass in with a "wrapped" reference which removes from the set then releases the original ref. The reference passed in must be unique() or std::invalid_argument is thrown. While this can't be enforced, no weak_ptr to this object should exist.
A reference loop will exist if the object owning the weak_set also holds strong references to entries in this set.
typedef epicsGuard<epicsMutex> weak_value_map< K, V, C >::guard_type |
typedef K weak_value_map< K, V, C >::key_type |
typedef std::map<K, value_pointer, C> weak_value_map< K, V, C >::lock_map_type |
typedef std::vector<std::pair<K, value_pointer> > weak_value_map< K, V, C >::lock_vector_type |
typedef epicsMutex weak_value_map< K, V, C >::mutex_type |
typedef epicsGuardRelease<epicsMutex> weak_value_map< K, V, C >::release_type |
typedef std::set<value_pointer> weak_value_map< K, V, C >::set_type |
typedef std::tr1::shared_ptr<V> weak_value_map< K, V, C >::value_pointer |
typedef V weak_value_map< K, V, C >::value_type |
typedef std::tr1::weak_ptr<V> weak_value_map< K, V, C >::value_weak_pointer |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Return a vector of pairs of keys and strong value references. useful for iteration
Definition at line 259 of file weakmap.h.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |