DGtal
2.2.0
Toggle main menu visibility
Loading...
Searching...
No Matches
CSTLAssociativeContainer.h
1
16
17
#pragma once
18
30
31
#if defined(CSTLAssociativeContainer_RECURSES)
32
#error Recursive header files inclusion detected in CSTLAssociativeContainer.h
33
#else
// defined(CSTLAssociativeContainer_RECURSES)
35
#define CSTLAssociativeContainer_RECURSES
36
37
#if !defined CSTLAssociativeContainer_h
39
#define CSTLAssociativeContainer_h
40
42
// Inclusions
43
#include <iostream>
45
46
namespace
DGtal
47
{
48
namespace
concepts
49
{
51
// class CSTLAssociativeContainer
101
template
<
typename
T>
102
struct
CSTLAssociativeContainer
:
boost::ForwardContainer
<T>,
boost::DefaultConstructible
<T>
103
{
104
// ----------------------- Concept checks ------------------------------
105
public
:
106
typedef
typename
T::iterator
iterator
;
107
typedef
typename
T::value_type
value_type
;
108
typedef
typename
T::key_type
key_type
;
109
typedef
typename
T::size_type
size_type
;
110
typedef
typename
T::const_iterator
const_iterator
;
111
112
BOOST_CONCEPT_USAGE
(
CSTLAssociativeContainer
)
113
{
114
x
.erase(
key
);
115
x
.erase(
p
);
116
x
.erase(
p
,
q
);
117
x
.clear();
118
p
=
x
.find(
key
);
119
r
=
x
.equal_range(
key
);
120
n
=
x
.count(
key
);
121
};
122
123
private
:
124
void
const_constraints
(
const
T& cc)
125
{
126
ci
= cc.find(
key
);
127
n
= cc.count(
key
);
128
cr
= cc.equal_range(
key
);
129
}
130
131
132
private
:
133
T
x
;
134
iterator
p
,
q
;
135
const_iterator
ci
;
136
value_type
val
;
137
key_type
key
;
138
size_type
n
;
139
std::pair<iterator,iterator>
r
;
140
std::pair<const_iterator,const_iterator>
cr
;
141
142
};
// end of concept CSTLAssociativeContainer
143
}
// namespace concept
144
}
// namespace DGtal
145
146
147
148
// //
150
151
#endif
// !defined CSTLAssociativeContainer_h
152
153
#undef CSTLAssociativeContainer_RECURSES
154
#endif
// else defined(CSTLAssociativeContainer_RECURSES)
DGtal::concepts
Aim: Gathers several functions useful for concept checks.
Definition
CPositiveIrreducibleFraction.h:54
DGtal
DGtal is the top-level namespace which contains all DGtal functions and types.
Definition
ClosedIntegerHalfPlane.h:49
DGtal::concepts::CSTLAssociativeContainer
Aim: Defines the concept describing an Associative Container of the STL (https://www....
Definition
CSTLAssociativeContainer.h:103
DGtal::concepts::CSTLAssociativeContainer::n
size_type n
Definition
CSTLAssociativeContainer.h:138
DGtal::concepts::CSTLAssociativeContainer::const_constraints
void const_constraints(const T &cc)
Definition
CSTLAssociativeContainer.h:124
DGtal::concepts::CSTLAssociativeContainer::r
std::pair< iterator, iterator > r
Definition
CSTLAssociativeContainer.h:139
DGtal::concepts::CSTLAssociativeContainer::p
iterator p
Definition
CSTLAssociativeContainer.h:134
DGtal::concepts::CSTLAssociativeContainer::key_type
T::key_type key_type
Definition
CSTLAssociativeContainer.h:108
DGtal::concepts::CSTLAssociativeContainer::key
key_type key
Definition
CSTLAssociativeContainer.h:137
DGtal::concepts::CSTLAssociativeContainer::cr
std::pair< const_iterator, const_iterator > cr
Definition
CSTLAssociativeContainer.h:140
DGtal::concepts::CSTLAssociativeContainer::const_iterator
T::const_iterator const_iterator
Definition
CSTLAssociativeContainer.h:110
DGtal::concepts::CSTLAssociativeContainer::val
value_type val
Definition
CSTLAssociativeContainer.h:136
DGtal::concepts::CSTLAssociativeContainer::iterator
T::iterator iterator
Definition
CSTLAssociativeContainer.h:106
DGtal::concepts::CSTLAssociativeContainer::size_type
T::size_type size_type
Definition
CSTLAssociativeContainer.h:109
DGtal::concepts::CSTLAssociativeContainer::ci
const_iterator ci
Definition
CSTLAssociativeContainer.h:135
DGtal::concepts::CSTLAssociativeContainer::BOOST_CONCEPT_USAGE
BOOST_CONCEPT_USAGE(CSTLAssociativeContainer)
Definition
CSTLAssociativeContainer.h:112
DGtal::concepts::CSTLAssociativeContainer::value_type
T::value_type value_type
Definition
CSTLAssociativeContainer.h:107
DGtal::concepts::CSTLAssociativeContainer::x
T x
Definition
CSTLAssociativeContainer.h:133
DGtal::concepts::CSTLAssociativeContainer::q
iterator q
Definition
CSTLAssociativeContainer.h:134
boost::DefaultConstructible
Go to http://www.sgi.com/tech/stl/DefaultConstructible.html.
Definition
Boost.dox:30
boost::ForwardContainer
Go to http://www.sgi.com/tech/stl/ForwardContainer.html.
Definition
Boost.dox:110
src
DGtal
base
CSTLAssociativeContainer.h
Generated on
for DGtal by
1.18.0