DGtal
1.1.0
src
DGtal
base
CConstBidirectionalRangeFromPoint.h
1
17
#pragma once
18
31
#if defined(CConstBidirectionalRangeFromPoint_RECURSES)
32
#error Recursive header files inclusion detected in CConstBidirectionalRangeFromPoint.h
33
#else // defined(CConstBidirectionalRangeFromPoint_RECURSES)
34
35
#define CConstBidirectionalRangeFromPoint_RECURSES
36
37
#if !defined CConstBidirectionalRangeFromPoint_h
38
39
#define CConstBidirectionalRangeFromPoint_h
40
42
// Inclusions
43
#include <iostream>
44
#include "DGtal/base/Common.h"
45
#include "DGtal/base/CConstBidirectionalRange.h"
47
48
namespace
DGtal
49
{
50
51
namespace
concepts
52
{
53
55
// class CConstBidirectionalRangeFromPoint
92
template
<
typename
T>
93
struct
CConstBidirectionalRangeFromPoint
:
CConstBidirectionalRange
<T>
94
{
95
// ----------------------- Concept checks ------------------------------
96
public
:
97
// 1. define first provided types (i.e. inner types), like
98
typedef
typename
T::Point
Point
;
99
100
// 2. then check the presence of data members, operators and methods with
101
BOOST_CONCEPT_USAGE
(
CConstBidirectionalRangeFromPoint
)
102
{
103
checkConstConstraints
();
104
}
105
void
checkConstConstraints
()
const
106
{
107
// const method dummyConst should take parameter myA of type A and return
108
// something of type B
109
concepts::ConceptUtils::sameType
(
myB
,
myX
.rbegin(
myPoint
) );
110
}
111
// ------------------------- Private Datas --------------------------------
112
private
:
113
T
myX
;
// do not require T to be default constructible.
114
Point
myPoint
;
115
typename
T::ConstReverseIterator
myB
;
116
117
// ------------------------- Internals ------------------------------------
118
private
:
119
120
};
// end of concept CConstBidirectionalRangeFromPoint
121
122
}
// namespace concepts
123
124
}
// namespace DGtal
125
128
129
#endif // !defined CConstBidirectionalRangeFromPoint_h
130
131
#undef CConstBidirectionalRangeFromPoint_RECURSES
132
#endif // else defined(CConstBidirectionalRangeFromPoint_RECURSES)
DGtal::concepts::CConstBidirectionalRangeFromPoint::Point
T::Point Point
Definition:
CConstBidirectionalRangeFromPoint.h:98
DGtal::concepts::CConstBidirectionalRangeFromPoint::myPoint
Point myPoint
Definition:
CConstBidirectionalRangeFromPoint.h:114
DGtal::concepts::CConstBidirectionalRangeFromPoint
Aim: refined concept of const bidirectional range with a begin() method from a point.
Definition:
CConstBidirectionalRangeFromPoint.h:94
DGtal::concepts::CConstBidirectionalRangeFromPoint::BOOST_CONCEPT_USAGE
BOOST_CONCEPT_USAGE(CConstBidirectionalRangeFromPoint)
Definition:
CConstBidirectionalRangeFromPoint.h:101
DGtal::concepts::CConstBidirectionalRangeFromPoint::myB
T::ConstReverseIterator myB
Definition:
CConstBidirectionalRangeFromPoint.h:115
DGtal
DGtal is the top-level namespace which contains all DGtal functions and types.
Definition:
ClosedIntegerHalfPlane.h:49
DGtal::concepts::CConstBidirectionalRangeFromPoint::myX
T myX
Definition:
CConstBidirectionalRangeFromPoint.h:113
DGtal::concepts::CConstBidirectionalRange
Aim: Defines the concept describing a bidirectional const range.
Definition:
CConstBidirectionalRange.h:90
DGtal::concepts::ConceptUtils::sameType
void sameType(const T &, const T &)
Definition:
ConceptUtils.h:117
Point
MyPointD Point
Definition:
testClone2.cpp:383
DGtal::concepts::CConstBidirectionalRangeFromPoint::checkConstConstraints
void checkConstConstraints() const
Definition:
CConstBidirectionalRangeFromPoint.h:105
Generated on Fri Oct 9 2020 08:57:45 for DGtal by
1.8.20