DGtal
2.2.0
Toggle main menu visibility
Loading...
Searching...
No Matches
CUndirectedSimpleLocalGraph.h
1
16
17
#pragma once
18
30
31
#if defined(CUndirectedSimpleLocalGraph_RECURSES)
32
#error Recursive header files inclusion detected in CUndirectedSimpleLocalGraph.h
33
#else
// defined(CUndirectedSimpleLocalGraph_RECURSES)
35
#define CUndirectedSimpleLocalGraph_RECURSES
36
37
#if !defined CUndirectedSimpleLocalGraph_h
39
#define CUndirectedSimpleLocalGraph_h
40
42
// Inclusions
43
#include <iostream>
44
#include <boost/concept_archetype.hpp>
45
#include "DGtal/base/Common.h"
46
#include "DGtal/kernel/CInteger.h"
47
#include "DGtal/graph/CVertexMap.h"
48
#include "DGtal/graph/CVertexPredicate.h"
49
#include "DGtal/graph/CVertexPredicateArchetype.h"
51
52
// @since 0.8 In DGtal::concepts
53
namespace
DGtal
{
54
namespace
concepts
{
55
57
// class CUndirectedSimpleLocalGraph
99
template
<
typename
T>
100
struct
CUndirectedSimpleLocalGraph
101
{
102
// ----------------------- Concept checks ------------------------------
103
public
:
104
// 1. define first provided types (i.e. inner types), like
105
typedef
typename
T::Vertex
Vertex
;
106
typedef
typename
T::Size
Size
;
107
typedef
typename
T::VertexSet
VertexSet
;
108
template
<
typename
Value>
struct
VertexMap
{
109
typedef
typename
T::template
VertexMap<Value>::Type
Type
;
110
BOOST_CONCEPT_ASSERT
((
CVertexMap
<
VertexMap<Value>
> ));
111
};
112
113
// possibly check these types so as to satisfy a concept with
114
BOOST_CONCEPT_ASSERT
((
CIntegralNumber< Size >
));
115
BOOST_CONCEPT_ASSERT
((
boost::DefaultConstructible< Vertex >
));
116
BOOST_CONCEPT_ASSERT
((
boost::Assignable< Vertex >
));
117
BOOST_CONCEPT_ASSERT
((
boost::CopyConstructible< Vertex >
));
118
119
// 2. then check the presence of data members, operators and methods with
120
BOOST_CONCEPT_USAGE
(
CUndirectedSimpleLocalGraph
)
121
{
122
// check const methods.
123
checkConstConstraints
();
124
}
125
void
checkConstConstraints
()
const
126
{
127
ConceptUtils::sameType
(
mySize
,
myX
.bestCapacity() );
128
ConceptUtils::sameType
(
mySize
,
myX
.degree(
myVertex
) );
129
myX
.writeNeighbors(
myOutIt
,
myVertex
);
130
myX
.writeNeighbors(
myOutIt
,
myVertex
,
myVPred
);
131
}
132
133
// ------------------------- Private Data --------------------------------
134
private
:
135
T
myX
;
// do not require T to be default constructible.
136
Size
mySize
;
137
Vertex
myVertex
;
138
mutable
boost::output_iterator_archetype<Vertex>
myOutIt
;
139
CVertexPredicateArchetype<Vertex>
myVPred
;
140
// ------------------------- Internals ------------------------------------
141
private
:
142
143
};
// end of concept CUndirectedSimpleLocalGraph
144
145
}
// namespace concepts
146
}
// namespace DGtal
147
148
// //
150
151
#endif
// !defined CUndirectedSimpleLocalGraph_h
152
153
#undef CUndirectedSimpleLocalGraph_RECURSES
154
#endif
// else defined(CUndirectedSimpleLocalGraph_RECURSES)
DGtal::concepts::ConceptUtils::sameType
void sameType(const T &, const T &)
Definition
ConceptUtils.h:117
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::CIntegralNumber
Aim: Concept checking for Integral Numbers. Models of this concept should be listed in NumberTraits c...
Definition
CIntegralNumber.h:102
DGtal::concepts::CUndirectedSimpleLocalGraph::VertexMap
Definition
CUndirectedSimpleLocalGraph.h:108
DGtal::concepts::CUndirectedSimpleLocalGraph::VertexMap::Type
T::template VertexMap< Value >::Type Type
Definition
CUndirectedSimpleLocalGraph.h:109
DGtal::concepts::CUndirectedSimpleLocalGraph::VertexMap::BOOST_CONCEPT_ASSERT
BOOST_CONCEPT_ASSERT((CVertexMap< VertexMap< Value > >))
DGtal::concepts::CUndirectedSimpleLocalGraph
Aim: Represents the concept of local graph: each vertex has neighboring vertices, but we do not neces...
Definition
CUndirectedSimpleLocalGraph.h:101
DGtal::concepts::CUndirectedSimpleLocalGraph::Vertex
T::Vertex Vertex
Definition
CUndirectedSimpleLocalGraph.h:105
DGtal::concepts::CUndirectedSimpleLocalGraph::Size
T::Size Size
Definition
CUndirectedSimpleLocalGraph.h:106
DGtal::concepts::CUndirectedSimpleLocalGraph::BOOST_CONCEPT_ASSERT
BOOST_CONCEPT_ASSERT((boost::CopyConstructible< Vertex >))
DGtal::concepts::CUndirectedSimpleLocalGraph::BOOST_CONCEPT_ASSERT
BOOST_CONCEPT_ASSERT((boost::DefaultConstructible< Vertex >))
DGtal::concepts::CUndirectedSimpleLocalGraph::myVPred
CVertexPredicateArchetype< Vertex > myVPred
Definition
CUndirectedSimpleLocalGraph.h:139
DGtal::concepts::CUndirectedSimpleLocalGraph::VertexSet
T::VertexSet VertexSet
Definition
CUndirectedSimpleLocalGraph.h:107
DGtal::concepts::CUndirectedSimpleLocalGraph::BOOST_CONCEPT_ASSERT
BOOST_CONCEPT_ASSERT((boost::Assignable< Vertex >))
DGtal::concepts::CUndirectedSimpleLocalGraph::myX
T myX
Definition
CUndirectedSimpleLocalGraph.h:135
DGtal::concepts::CUndirectedSimpleLocalGraph::BOOST_CONCEPT_USAGE
BOOST_CONCEPT_USAGE(CUndirectedSimpleLocalGraph)
Definition
CUndirectedSimpleLocalGraph.h:120
DGtal::concepts::CUndirectedSimpleLocalGraph::BOOST_CONCEPT_ASSERT
BOOST_CONCEPT_ASSERT((CIntegralNumber< Size >))
DGtal::concepts::CUndirectedSimpleLocalGraph::mySize
Size mySize
Definition
CUndirectedSimpleLocalGraph.h:136
DGtal::concepts::CUndirectedSimpleLocalGraph::myVertex
Vertex myVertex
Definition
CUndirectedSimpleLocalGraph.h:137
DGtal::concepts::CUndirectedSimpleLocalGraph::myOutIt
boost::output_iterator_archetype< Vertex > myOutIt
Definition
CUndirectedSimpleLocalGraph.h:138
DGtal::concepts::CUndirectedSimpleLocalGraph::checkConstConstraints
void checkConstConstraints() const
Definition
CUndirectedSimpleLocalGraph.h:125
DGtal::concepts::CVertexMap
Aim: models of CVertexMap concept implement mapping between graph vertices and values.
Definition
CVertexMap.h:98
DGtal::concepts::CVertexPredicateArchetype
Aim: Defines a an archetype for concept CVertexPredicate.
Definition
CVertexPredicateArchetype.h:60
boost::Assignable
Go to http://www.sgi.com/tech/stl/Assignable.html.
Definition
Boost.dox:32
boost::CopyConstructible
Go to http://www.sgi.com/tech/stl/CopyConstructible.html.
Definition
Boost.dox:34
boost::DefaultConstructible
Go to http://www.sgi.com/tech/stl/DefaultConstructible.html.
Definition
Boost.dox:30
src
DGtal
graph
CUndirectedSimpleLocalGraph.h
Generated on
for DGtal by
1.18.0