DGtal
2.2.0
Toggle main menu visibility
Loading...
Searching...
No Matches
ConceptUtils.h
1
16
17
#pragma once
18
32
33
#if defined(ConceptUtils_RECURSES)
34
#error Recursive header files inclusion detected in ConceptUtils.h
35
#else
// defined(ConceptUtils_RECURSES)
37
#define ConceptUtils_RECURSES
38
39
#if !defined ConceptUtils_h
41
#define ConceptUtils_h
42
44
// Inclusions
45
#include <iostream>
47
48
namespace
DGtal
49
{
53
struct
TagFalse
{};
54
58
struct
TagTrue
{};
59
63
struct
TagUnknown
{};
64
69
template
<
typename
T>
70
struct
Negate
71
{
typedef
TagUnknown
type
; };
72
template
<>
73
struct
Negate
<
TagTrue
>
74
{
typedef
TagFalse
type
; };
75
template
<>
76
struct
Negate
<
TagFalse
>
77
{
typedef
TagTrue
type
; };
78
85
template
<
class
T>
86
struct
DummyObject
:
public
boost::static_object<T>
87
{};
88
90
// Namespace ConceptUtils
97
namespace
concepts
98
{
99
namespace
ConceptUtils
100
{
105
template
<
typename
T1,
typename
T2>
106
struct
SameType
107
{
static
const
bool
value
=
false
; };
108
109
template
<
typename
T>
110
struct
SameType
<T,T>
111
{
static
const
bool
value
=
true
; };
112
116
template
<
typename
T>
117
void
sameType
(
const
T &
/* t1 */
,
const
T &
/* t2 */
) {}
118
122
template
<
typename
T>
123
struct
CheckTrue
124
{
static
const
bool
value
=
false
; };
125
template
<>
126
struct
CheckTrue
<
TagTrue
>
127
{
static
const
bool
value
=
true
; };
128
132
template
<
typename
T>
133
struct
CheckFalse
134
{
static
const
bool
value
= !
CheckTrue<T>::value
; };
135
139
template
<
typename
T>
140
struct
CheckUnknown
141
{
static
const
bool
value
=
false
; };
142
template
<>
143
struct
CheckUnknown
<
TagUnknown
>
144
{
static
const
bool
value
=
true
; };
145
149
template
<
typename
T>
150
struct
CheckTrueOrFalse
151
{
static
const
bool
value
=
CheckTrue<T>::value
||
CheckFalse<T>::value
; };
152
156
template
<
typename
T>
157
struct
CheckTag
158
{
static
const
bool
value
=
CheckTrueOrFalse<T>::value
||
CheckUnknown<T>::value
; };
159
164
void
checkTrue
(
const
TagTrue
& tag );
165
170
void
checkFalse
(
const
TagFalse
& tag );
171
176
void
checkUnknown
(
const
TagUnknown
& tag );
177
182
void
checkTag
(
const
TagUnknown
& tag );
183
188
void
checkTag
(
const
TagTrue
& tag );
189
194
void
checkTag
(
const
TagFalse
& tag );
195
200
void
checkTrueOrFalse
(
const
TagFalse
& tag );
201
206
void
checkTrueOrFalse
(
const
TagTrue
& tag );
207
208
209
}
// end of namespace ConceptUtils
210
}
//end of namespace concepts.
211
}
// namespace DGtal
212
213
// //
215
216
#endif
// !defined ConceptUtils_h
217
218
#undef ConceptUtils_RECURSES
219
#endif
// else defined(ConceptUtils_RECURSES)
DGtal::concepts::ConceptUtils
Definition
ConceptUtils.h:100
DGtal::concepts::ConceptUtils::checkUnknown
void checkUnknown(const TagUnknown &tag)
DGtal::concepts::ConceptUtils::checkFalse
void checkFalse(const TagFalse &tag)
DGtal::concepts::ConceptUtils::checkTag
void checkTag(const TagUnknown &tag)
DGtal::concepts::ConceptUtils::sameType
void sameType(const T &, const T &)
Definition
ConceptUtils.h:117
DGtal::concepts::ConceptUtils::checkTrue
void checkTrue(const TagTrue &tag)
DGtal::concepts::ConceptUtils::checkTrueOrFalse
void checkTrueOrFalse(const TagFalse &tag)
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::DummyObject
Definition
ConceptUtils.h:87
DGtal::Negate< TagFalse >::type
TagTrue type
Definition
ConceptUtils.h:77
DGtal::Negate< TagTrue >::type
TagFalse type
Definition
ConceptUtils.h:74
DGtal::Negate
Definition
ConceptUtils.h:71
DGtal::Negate::type
TagUnknown type
Definition
ConceptUtils.h:71
DGtal::TagFalse
Definition
ConceptUtils.h:53
DGtal::TagTrue
Definition
ConceptUtils.h:58
DGtal::TagUnknown
Definition
ConceptUtils.h:63
DGtal::concepts::ConceptUtils::CheckFalse
Definition
ConceptUtils.h:134
DGtal::concepts::ConceptUtils::CheckFalse::value
static const bool value
Definition
ConceptUtils.h:134
DGtal::concepts::ConceptUtils::CheckTag
Definition
ConceptUtils.h:158
DGtal::concepts::ConceptUtils::CheckTag::value
static const bool value
Definition
ConceptUtils.h:158
DGtal::concepts::ConceptUtils::CheckTrueOrFalse
Definition
ConceptUtils.h:151
DGtal::concepts::ConceptUtils::CheckTrueOrFalse::value
static const bool value
Definition
ConceptUtils.h:151
DGtal::concepts::ConceptUtils::CheckTrue< TagTrue >::value
static const bool value
Definition
ConceptUtils.h:127
DGtal::concepts::ConceptUtils::CheckTrue
Definition
ConceptUtils.h:124
DGtal::concepts::ConceptUtils::CheckTrue::value
static const bool value
Definition
ConceptUtils.h:124
DGtal::concepts::ConceptUtils::CheckUnknown< TagUnknown >::value
static const bool value
Definition
ConceptUtils.h:144
DGtal::concepts::ConceptUtils::CheckUnknown
Definition
ConceptUtils.h:141
DGtal::concepts::ConceptUtils::CheckUnknown::value
static const bool value
Definition
ConceptUtils.h:141
DGtal::concepts::ConceptUtils::SameType< T, T >::value
static const bool value
Definition
ConceptUtils.h:111
DGtal::concepts::ConceptUtils::SameType
Definition
ConceptUtils.h:107
DGtal::concepts::ConceptUtils::SameType::value
static const bool value
Definition
ConceptUtils.h:107
src
DGtal
base
ConceptUtils.h
Generated on
for DGtal by
1.18.0