Dune-Fufem 2.11-git
Loading...
Searching...
No Matches
SharedPointerMap< K, V, Compare > Class Template Reference

Simple map for shared pointers. More...

#include <dune/fufem/sharedpointermap.hh>

Inheritance diagram for SharedPointerMap< K, V, Compare >:
Inheritance graph

Public Types

typedef std::map< K, VSP, Compare > Base
 

Public Member Functions

 SharedPointerMap ()
 
const VSPgetPointer (const K &key) const
 Get a const shared ptr for given key.
 
VSPgetPointer (const K &key)
 Get a shared ptr for given key.
 
const V & get (const K &key) const
 Get const reference to value for given key.
 
V & get (const K &key)
 Get reference to value for given key.
 
void set (const K &key, V *value)
 Set key to value.
 
at (T... args)
 
begin (T... args)
 
cbegin (T... args)
 
cend (T... args)
 
clear (T... args)
 
contains (T... args)
 
count (T... args)
 
crbegin (T... args)
 
crend (T... args)
 
emplace (T... args)
 
emplace_hint (T... args)
 
empty (T... args)
 
end (T... args)
 
equal_range (T... args)
 
erase (T... args)
 
extract (T... args)
 
find (T... args)
 
get_allocator (T... args)
 
insert (T... args)
 
insert_or_assign (T... args)
 
key_comp (T... args)
 
lower_bound (T... args)
 
max_size (T... args)
 
merge (T... args)
 
operator[] (T... args)
 
rbegin (T... args)
 
rend (T... args)
 
size (T... args)
 
swap (T... args)
 
try_emplace (T... args)
 
upper_bound (T... args)
 
value_comp (T... args)
 

Public Attributes

keys
 STL member.
 
elements
 STL member.
 

Detailed Description

template<class K, class V, class Compare = std::less<K>>
class SharedPointerMap< K, V, Compare >

Simple map for shared pointers.

This class aims to make the usage of maps of shared pointers more convenient. It extends a map<K, shared_ptr<V> >.

Template Parameters
Kkey type
Vvalue typ
Comparethe comparator (defaults to std::less)
Deprecated:
This class is deprecated and will be removed after 2.11.

Member Typedef Documentation

◆ Base

template<class K , class V , class Compare = std::less<K>>
typedef std::map<K, VSP, Compare> SharedPointerMap< K, V, Compare >::Base

Constructor & Destructor Documentation

◆ SharedPointerMap()

template<class K , class V , class Compare = std::less<K>>
SharedPointerMap< K, V, Compare >::SharedPointerMap ( )
inline

Member Function Documentation

◆ get() [1/2]

template<class K , class V , class Compare = std::less<K>>
V & SharedPointerMap< K, V, Compare >::get ( const K &  key)
inline

Get reference to value for given key.

This throws an exception if the key was not found.

◆ get() [2/2]

template<class K , class V , class Compare = std::less<K>>
const V & SharedPointerMap< K, V, Compare >::get ( const K &  key) const
inline

Get const reference to value for given key.

This throws an exception if the key was not found.

◆ getPointer() [1/2]

template<class K , class V , class Compare = std::less<K>>
VSP & SharedPointerMap< K, V, Compare >::getPointer ( const K &  key)
inline

Get a shared ptr for given key.

This throws an exception if the key was not found.

◆ getPointer() [2/2]

template<class K , class V , class Compare = std::less<K>>
const VSP & SharedPointerMap< K, V, Compare >::getPointer ( const K &  key) const
inline

Get a const shared ptr for given key.

This throws an exception if the key was not found.

◆ set()

template<class K , class V , class Compare = std::less<K>>
void SharedPointerMap< K, V, Compare >::set ( const K &  key,
V *  value 
)
inline

Set key to value.

This creates a shared pointer for the given raw pointer and takes ownership.

Member Data Documentation

◆ elements

T std::map< K, T >::elements
inherited

STL member.

◆ keys

K std::map< K, T >::keys
inherited

STL member.


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