DGtal
2.2.0
Toggle main menu visibility
Loading...
Searching...
No Matches
STLMapToVertexMapAdapter.h
1
16
17
#pragma once
18
30
31
#if defined(STLMapToVertexMapAdapter_RECURSES)
32
#error Recursive header files inclusion detected in STLMapToVertexMapAdapter.h
33
#else
// defined(STLMapToVertexMapAdapter_RECURSES)
35
#define STLMapToVertexMapAdapter_RECURSES
36
37
#if !defined STLMapToVertexMapAdapter_h
39
#define STLMapToVertexMapAdapter_h
40
42
// Inclusions
43
#include "DGtal/base/Common.h"
45
46
namespace
DGtal
47
{
48
50
// template class STLMapToVertexMapAdapter
60
template
<
typename
TMap >
61
class
STLMapToVertexMapAdapter
:
62
public
TMap
63
{
64
// ----------------------- Associated types ------------------------------
65
public
:
66
typedef
STLMapToVertexMapAdapter<TMap>
Self
;
67
typedef
TMap
Container
;
68
typedef
typename
Container::value_compare
Compare
;
69
typedef
typename
Container::allocator_type
Allocator
;
70
typedef
typename
Container::key_type
Vertex
;
71
typedef
typename
Container::mapped_type
Value
;
72
73
74
// Cannot check this since some types using it are incomplete.
75
// BOOST_CONCEPT_ASSERT(( CUndirectedSimpleLocalGraph< Graph > ));
76
// BOOST_CONCEPT_ASSERT(( CSet< MarkSet, Vertex > ));
77
78
79
// ----------------------- Standard services ------------------------------
80
public
:
81
82
STLMapToVertexMapAdapter
() :
Container
() {}
83
84
template
<
class
InputIterator>
STLMapToVertexMapAdapter
( InputIterator first,
85
InputIterator last,
const
Compare
& comp =
Compare
(),
const
Allocator
& alloc =
Allocator
() )
86
:
Container
( first, last, comp, alloc ) {}
87
88
STLMapToVertexMapAdapter
(
STLMapToVertexMapAdapter
& other )
89
:
Container
( other ) {}
90
91
void
setValue
(
Vertex
v,
Value
val)
92
{
93
(*this)[v] = val;
94
}
95
96
Value
operator()
(
Vertex
v)
97
{
98
typename
Container::const_iterator it = Container::find(v);
99
ASSERT( it != this->end() );
100
return
it->second;
101
}
102
103
};
// end of class STLMapToVertexMapAdapter
104
105
106
107
108
}
// namespace DGtal
109
110
111
112
#endif
// !defined STLMapToVertexMapAdapter_h
113
114
#undef STLMapToVertexMapAdapter_RECURSES
115
#endif
// else defined(STLMapToVertexMapAdapter_RECURSES)
DGtal::STLMapToVertexMapAdapter::STLMapToVertexMapAdapter
STLMapToVertexMapAdapter()
Definition
STLMapToVertexMapAdapter.h:82
DGtal::STLMapToVertexMapAdapter::STLMapToVertexMapAdapter
STLMapToVertexMapAdapter(InputIterator first, InputIterator last, const Compare &comp=Compare(), const Allocator &alloc=Allocator())
Definition
STLMapToVertexMapAdapter.h:84
DGtal::STLMapToVertexMapAdapter::setValue
void setValue(Vertex v, Value val)
Definition
STLMapToVertexMapAdapter.h:91
DGtal::STLMapToVertexMapAdapter::Self
STLMapToVertexMapAdapter< TMap > Self
Definition
STLMapToVertexMapAdapter.h:66
DGtal::STLMapToVertexMapAdapter::Value
Container::mapped_type Value
Definition
STLMapToVertexMapAdapter.h:71
DGtal::STLMapToVertexMapAdapter::STLMapToVertexMapAdapter
STLMapToVertexMapAdapter(STLMapToVertexMapAdapter &other)
Definition
STLMapToVertexMapAdapter.h:88
DGtal::STLMapToVertexMapAdapter::Compare
Container::value_compare Compare
Definition
STLMapToVertexMapAdapter.h:68
DGtal::STLMapToVertexMapAdapter::Vertex
Container::key_type Vertex
Definition
STLMapToVertexMapAdapter.h:70
DGtal::STLMapToVertexMapAdapter::operator()
Value operator()(Vertex v)
Definition
STLMapToVertexMapAdapter.h:96
DGtal::STLMapToVertexMapAdapter::Container
TMap Container
Definition
STLMapToVertexMapAdapter.h:67
DGtal::STLMapToVertexMapAdapter::Allocator
Container::allocator_type Allocator
Definition
STLMapToVertexMapAdapter.h:69
DGtal
DGtal is the top-level namespace which contains all DGtal functions and types.
Definition
ClosedIntegerHalfPlane.h:49
src
DGtal
graph
STLMapToVertexMapAdapter.h
Generated on
for DGtal by
1.18.0