DGtal 1.3.0
Loading...
Searching...
No Matches
Public Types | Public Member Functions
DGtal::STLMapToVertexMapAdapter< TMap > Class Template Reference

Aim: This class adapts any map of the STL to match with the CVertexMap concept. More...

#include <DGtal/graph/STLMapToVertexMapAdapter.h>

Inheritance diagram for DGtal::STLMapToVertexMapAdapter< TMap >:

Public Types

typedef STLMapToVertexMapAdapter< TMap > Self
 
typedef TMap Container
 
typedef Container::value_compare Compare
 
typedef Container::allocator_type Allocator
 
typedef Container::key_type Vertex
 
typedef Container::mapped_type Value
 

Public Member Functions

 STLMapToVertexMapAdapter ()
 
template<class InputIterator >
 STLMapToVertexMapAdapter (InputIterator first, InputIterator last, const Compare &comp=Compare(), const Allocator &alloc=Allocator())
 
 STLMapToVertexMapAdapter (STLMapToVertexMapAdapter &other)
 
void setValue (Vertex v, Value val)
 
Value operator() (Vertex v)
 

Detailed Description

template<typename TMap>
class DGtal::STLMapToVertexMapAdapter< TMap >

Aim: This class adapts any map of the STL to match with the CVertexMap concept.

Description of template class 'STLMapToVertexMapAdapter'

Template Parameters
TMapthe type of the associative container.

Definition at line 61 of file STLMapToVertexMapAdapter.h.

Member Typedef Documentation

◆ Allocator

template<typename TMap >
typedef Container::allocator_type DGtal::STLMapToVertexMapAdapter< TMap >::Allocator

Definition at line 69 of file STLMapToVertexMapAdapter.h.

◆ Compare

template<typename TMap >
typedef Container::value_compare DGtal::STLMapToVertexMapAdapter< TMap >::Compare

Definition at line 68 of file STLMapToVertexMapAdapter.h.

◆ Container

template<typename TMap >
typedef TMap DGtal::STLMapToVertexMapAdapter< TMap >::Container

Definition at line 67 of file STLMapToVertexMapAdapter.h.

◆ Self

template<typename TMap >
typedef STLMapToVertexMapAdapter<TMap> DGtal::STLMapToVertexMapAdapter< TMap >::Self

Definition at line 66 of file STLMapToVertexMapAdapter.h.

◆ Value

template<typename TMap >
typedef Container::mapped_type DGtal::STLMapToVertexMapAdapter< TMap >::Value

Definition at line 71 of file STLMapToVertexMapAdapter.h.

◆ Vertex

template<typename TMap >
typedef Container::key_type DGtal::STLMapToVertexMapAdapter< TMap >::Vertex

Definition at line 70 of file STLMapToVertexMapAdapter.h.

Constructor & Destructor Documentation

◆ STLMapToVertexMapAdapter() [1/3]

template<typename TMap >
DGtal::STLMapToVertexMapAdapter< TMap >::STLMapToVertexMapAdapter ( )
inline

◆ STLMapToVertexMapAdapter() [2/3]

template<typename TMap >
template<class InputIterator >
DGtal::STLMapToVertexMapAdapter< TMap >::STLMapToVertexMapAdapter ( InputIterator  first,
InputIterator  last,
const Compare comp = Compare(),
const Allocator alloc = Allocator() 
)
inline

Definition at line 84 of file STLMapToVertexMapAdapter.h.

86 : Container( first, last, comp, alloc ) {}

◆ STLMapToVertexMapAdapter() [3/3]

template<typename TMap >
DGtal::STLMapToVertexMapAdapter< TMap >::STLMapToVertexMapAdapter ( STLMapToVertexMapAdapter< TMap > &  other)
inline

Definition at line 88 of file STLMapToVertexMapAdapter.h.

89 : Container( other ) {}

Member Function Documentation

◆ operator()()

template<typename TMap >
Value DGtal::STLMapToVertexMapAdapter< TMap >::operator() ( Vertex  v)
inline

Definition at line 96 of file STLMapToVertexMapAdapter.h.

97 {
98 typename Container::const_iterator it = Container::find(v);
99 ASSERT( it != this->end() );
100 return it->second;
101 }

◆ setValue()

template<typename TMap >
void DGtal::STLMapToVertexMapAdapter< TMap >::setValue ( Vertex  v,
Value  val 
)
inline

Definition at line 91 of file STLMapToVertexMapAdapter.h.

92 {
93 (*this)[v] = val;
94 }

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