DGtal
0.6.devel
Main Page
Related Pages
Modules
Namespaces
Data Structures
Examples
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Groups
Pages
src
DGtal
base
InputIteratorWithRankOnSequence.h
1
17
#pragma once
18
31
#if defined(InputIteratorWithRankOnSequence_RECURSES)
32
#error Recursive header files inclusion detected in InputIteratorWithRankOnSequence.h
33
#else // defined(InputIteratorWithRankOnSequence_RECURSES)
34
35
#define InputIteratorWithRankOnSequence_RECURSES
36
37
#if !defined InputIteratorWithRankOnSequence_h
38
39
#define InputIteratorWithRankOnSequence_h
40
42
// Inclusions
43
#include <iostream>
44
#include <iterator>
45
#include "DGtal/base/Common.h"
46
#include "DGtal/base/CountedPtr.h"
47
#include "DGtal/kernel/CInteger.h"
49
50
namespace
DGtal
51
{
52
54
// template class InputIteratorWithRankOnSequence
78
template
<
typename
TSequence,
typename
TRank =
typename
TSequence::difference_type>
79
class
InputIteratorWithRankOnSequence
80
{
81
// ----------------------- public types ------------------------------
82
public
:
83
BOOST_CONCEPT_ASSERT
(( boost::Sequence<TSequence> ));
84
BOOST_CONCEPT_ASSERT
((
CInteger<TRank>
));
85
86
typedef
TSequence
Sequence
;
87
typedef
TRank
Rank
;
88
typedef
InputIteratorWithRankOnSequence<Sequence,Rank>
Self
;
89
typedef
typename
Sequence::value_type
SequenceValue
;
90
typedef
std::pair<SequenceValue,Rank>
Value
;
91
typedef
typename
Sequence::const_iterator
ConstIterator
;
92
typedef
const
Value
*
Pointer
;
93
94
// ----------------------- std types ----------------------------------
95
typedef
Value
value_type
;
96
typedef
typename
Sequence::size_type
size_type
;
97
typedef
typename
Sequence::difference_type
difference_type
;
98
typedef
Pointer
pointer
;
99
typedef
const
value_type
&
reference
;
100
typedef
const
reference
const_reference
;
101
typedef
std::input_iterator_tag
iterator_category
;
102
103
// ----------------------- Standard services ------------------------------
104
public
:
105
109
~InputIteratorWithRankOnSequence
();
110
116
InputIteratorWithRankOnSequence
(
const
Sequence
& seq,
ConstIterator
it );
117
123
InputIteratorWithRankOnSequence
(
Sequence
* ptrSeq,
ConstIterator
it );
124
130
InputIteratorWithRankOnSequence
(
const
CountedPtr<Sequence>
& ptrSeq,
ConstIterator
it );
131
136
InputIteratorWithRankOnSequence
(
const
Self
& other );
137
143
Self
&
operator=
(
const
Self
& other );
144
149
Value
operator*
()
const
;
150
155
Pointer
operator->
()
const
;
156
161
Self
&
operator++
();
162
167
Self
operator++
(
int
);
168
174
bool
operator==
(
const
Self
& other )
const
;
175
181
bool
operator!=
(
const
Self
& other )
const
;
182
183
// ----------------------- Interface --------------------------------------
184
public
:
185
190
void
selfDisplay
( std::ostream & out )
const
;
191
196
bool
isValid
()
const
;
197
198
// ------------------------- Protected Datas ------------------------------
199
private
:
200
// ------------------------- Private Datas --------------------------------
201
private
:
202
204
CountedPtr<Sequence>
mySequence
;
206
ConstIterator
myIterator
;
209
Value
myTmpValue
;
210
211
// ------------------------- Hidden services ------------------------------
212
protected
:
216
InputIteratorWithRankOnSequence
();
217
218
// ------------------------- Internals ------------------------------------
219
private
:
220
221
};
// end of class InputIteratorWithRankOnSequence
222
223
230
template
<
typename
TSequence,
typename
TRank>
231
std::ostream&
232
operator<< ( std::ostream & out, const InputIteratorWithRankOnSequence<TSequence, TRank> & object );
233
234
}
// namespace DGtal
235
236
238
// Includes inline functions.
239
#include "DGtal/base/InputIteratorWithRankOnSequence.ih"
240
241
// //
243
244
#endif // !defined InputIteratorWithRankOnSequence_h
245
246
#undef InputIteratorWithRankOnSequence_RECURSES
247
#endif // else defined(InputIteratorWithRankOnSequence_RECURSES)
Generated on Wed Dec 19 2012 19:10:27 for DGtal by
1.8.1.1