DGtal 1.4.0
Loading...
Searching...
No Matches
DGtal::concepts::CSTLAssociativeContainer< T > Struct Template Reference

Aim: Defines the concept describing an Associative Container of the STL (https://www.sgi.com/tech/stl/AssociativeContainer.html). More...

#include <DGtal/base/CSTLAssociativeContainer.h>

Inheritance diagram for DGtal::concepts::CSTLAssociativeContainer< T >:
[legend]

Public Types

typedef T::iterator iterator
 
typedef T::value_type value_type
 
typedef T::key_type key_type
 
typedef T::size_type size_type
 
typedef T::const_iterator const_iterator
 

Public Member Functions

 BOOST_CONCEPT_USAGE (CSTLAssociativeContainer)
 

Private Member Functions

void const_constraints (const T &cc)
 

Private Attributes

x
 
iterator p
 
iterator q
 
const_iterator ci
 
value_type val
 
key_type key
 
size_type n
 
std::pair< iterator, iteratorr
 
std::pair< const_iterator, const_iteratorcr
 

Detailed Description

template<typename T>
struct DGtal::concepts::CSTLAssociativeContainer< T >

Aim: Defines the concept describing an Associative Container of the STL (https://www.sgi.com/tech/stl/AssociativeContainer.html).

DescriptionDescription of concept 'CSTLAssociativeContainer'

Note
This concept can also be found in the boost library under the name boost::AssociativeContainer. However, there is a issue in this concept (problem in boost 1.58 but present in several releases) which requires the container to be "sorted". As a consequence, boost::unordered_set does not satisfy the concept.

Refinement of

Provided types:

  • value_type: the value type
  • key_type: the key type
  • iterator: the iterator type
  • const_iterator: a const iterator type
  • size_type: a size type

Notation:

  • x an object of a model of CSTLAssociativeContainer.
  • val an object of type value_type
  • key and object of type key_type
  • p, q two instances of type iterator

For a complete desccription of this concept, please check https://www.sgi.com/tech/stl/AssociativeContainer.html.

Invariants

Models

std::set, std::unordered_set (c++11), boost::unordered_set.

Notes

Template Parameters
Tthe type that is checked. T should be a model of CSTLAssociativeContainer.

Definition at line 102 of file CSTLAssociativeContainer.h.

Member Typedef Documentation

◆ const_iterator

template<typename T >
typedef T::const_iterator DGtal::concepts::CSTLAssociativeContainer< T >::const_iterator

Definition at line 110 of file CSTLAssociativeContainer.h.

◆ iterator

template<typename T >
typedef T::iterator DGtal::concepts::CSTLAssociativeContainer< T >::iterator

Definition at line 106 of file CSTLAssociativeContainer.h.

◆ key_type

template<typename T >
typedef T::key_type DGtal::concepts::CSTLAssociativeContainer< T >::key_type

Definition at line 108 of file CSTLAssociativeContainer.h.

◆ size_type

template<typename T >
typedef T::size_type DGtal::concepts::CSTLAssociativeContainer< T >::size_type

Definition at line 109 of file CSTLAssociativeContainer.h.

◆ value_type

template<typename T >
typedef T::value_type DGtal::concepts::CSTLAssociativeContainer< T >::value_type

Definition at line 107 of file CSTLAssociativeContainer.h.

Member Function Documentation

◆ BOOST_CONCEPT_USAGE()

template<typename T >
DGtal::concepts::CSTLAssociativeContainer< T >::BOOST_CONCEPT_USAGE ( CSTLAssociativeContainer< T > )
inline

Definition at line 112 of file CSTLAssociativeContainer.h.

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 };

References DGtal::concepts::CSTLAssociativeContainer< T >::key.

◆ const_constraints()

template<typename T >
void DGtal::concepts::CSTLAssociativeContainer< T >::const_constraints ( const T & cc)
inlineprivate

Field Documentation

◆ ci

◆ cr

◆ key

◆ n

template<typename T >
size_type DGtal::concepts::CSTLAssociativeContainer< T >::n
private

Definition at line 138 of file CSTLAssociativeContainer.h.

◆ p

template<typename T >
iterator DGtal::concepts::CSTLAssociativeContainer< T >::p
private

Definition at line 134 of file CSTLAssociativeContainer.h.

◆ q

template<typename T >
iterator DGtal::concepts::CSTLAssociativeContainer< T >::q
private

Definition at line 134 of file CSTLAssociativeContainer.h.

◆ r

template<typename T >
std::pair<iterator,iterator> DGtal::concepts::CSTLAssociativeContainer< T >::r
private

Definition at line 139 of file CSTLAssociativeContainer.h.

◆ val

template<typename T >
value_type DGtal::concepts::CSTLAssociativeContainer< T >::val
private

Definition at line 136 of file CSTLAssociativeContainer.h.

◆ x

template<typename T >
T DGtal::concepts::CSTLAssociativeContainer< T >::x
private

Definition at line 133 of file CSTLAssociativeContainer.h.


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