DGtal 1.3.0
Loading...
Searching...
No Matches
IteratorFunctions.h
1
17#pragma once
18
31#if defined(IteratorFunctions_RECURSES)
32#error Recursive header files inclusion detected in IteratorFunctions.h
33#else // defined(IteratorFunctions_RECURSES)
35#define IteratorFunctions_RECURSES
36
37#if !defined IteratorFunctions_h
39#define IteratorFunctions_h
40
42// Inclusions
43#include<iterator>
44#include "DGtal/base/IteratorCirculatorTraits.h"
46
47namespace DGtal
48{
49
51 // template functions isNotEmpty
52
53 namespace detail
54 {
55
63 template< typename IC >
64 inline
65 bool isNotEmpty( const IC& itb, const IC& ite, IteratorType );
66
74 template< typename IC >
75 inline
76 bool isNotEmpty( const IC& c1, const IC& c2, CirculatorType);
77
78 } //end namespace detail
79
86 template< typename IC>
87 inline
88 bool isEmpty( const IC& itb, const IC& ite );
89
96 template< typename IC>
97 inline
98 bool isNotEmpty( const IC& itb, const IC& ite );
99
101 // template functions for the size and middle of a (sub)range
102
109 template<typename IC>
110 inline
111 void advanceIterator(IC& ic,
113
114 namespace detail
115 {
122 template<typename IC>
123 inline
124 void advanceIterator(IC& ic,
126 ForwardCategory /*c*/);
127
134 template<typename IC>
135 inline
136 void advanceIterator(IC& ic,
139 } //end namespace detail
140
148 template<typename IC>
149 inline
151 rangeSize(const IC& itb, const IC& ite);
152
162 template<typename IC>
163 inline
165 subRangeSize(const IC& itb, const IC& ite);
166
167 namespace detail
168 {
177 template<typename I>
178 inline
180 rangeSize(const I& itb, const I& ite, IteratorType /*t*/, ForwardCategory /*c*/);
181
191 template<typename C>
192 inline
194 rangeSize(const C& cb, const C& ce, CirculatorType /*t*/, ForwardCategory /*c*/);
195
204 template<typename I>
205 inline
207 rangeSize(const I& itb, const I& ite, IteratorType /*t*/, RandomAccessCategory /*c*/);
208
218 template<typename C>
219 inline
221 rangeSize(const C& cb, const C& ce, CirculatorType /*t*/, RandomAccessCategory /*c*/);
222
223 } //namespace detail
224
237 template<typename IC>
238 inline
239 IC rangeMiddle(const IC& itb, const IC& ite);
240
249 template<typename IC>
250 inline
251 IC subRangeMiddle(const IC& itb, const IC& ite);
252
253 namespace detail
254 {
263 template<typename I>
264 inline
265 I rangeMiddle(const I& itb, const I& ite, IteratorType /*t*/, ForwardCategory /*c*/);
266
276 template<typename C>
277 inline
278 C rangeMiddle(const C& cb, const C& ce, CirculatorType /*t*/, ForwardCategory /*c*/);
279
288 template<typename I>
289 inline
290 I rangeMiddle(const I& itb, const I& ite, IteratorType /*t*/, BidirectionalCategory /*c*/);
291
301 template<typename C>
302 inline
303 C rangeMiddle(const C& cb, const C& ce, CirculatorType /*t*/, BidirectionalCategory /*c*/);
304
313 template<typename I>
314 inline
315 I rangeMiddle(const I& itb, const I& ite, IteratorType /*t*/, RandomAccessCategory /*c*/);
316
326 template<typename C>
327 inline
328 C rangeMiddle(const C& cb, const C& ce, CirculatorType /*t*/, RandomAccessCategory /*c*/);
329 } // namespace namespace
330
331
332} // namespace DGtal
333
334
335
336
338// Includes inline functions.
339#include "DGtal/base/IteratorFunctions.ih"
340
341// //
343
344#endif // !defined IteratorFunctions_h
345
346#undef IteratorFunctions_RECURSES
347#endif // else defined(IteratorFunctions_RECURSES)
void advanceIterator(IC &ic, typename IteratorCirculatorTraits< IC >::Difference n, ForwardCategory)
IteratorCirculatorTraits< I >::Difference rangeSize(const I &itb, const I &ite, IteratorType, ForwardCategory)
bool isNotEmpty(const IC &itb, const IC &ite, IteratorType)
I rangeMiddle(const I &itb, const I &ite, IteratorType, ForwardCategory)
DGtal is the top-level namespace which contains all DGtal functions and types.
IteratorCirculatorTraits< IC >::Difference rangeSize(const IC &itb, const IC &ite)
IC subRangeMiddle(const IC &itb, const IC &ite)
bool isEmpty(const IC &itb, const IC &ite)
bool isNotEmpty(const IC &itb, const IC &ite)
IC rangeMiddle(const IC &itb, const IC &ite)
void advanceIterator(IC &ic, typename IteratorCirculatorTraits< IC >::Difference n)
IteratorCirculatorTraits< IC >::Difference subRangeSize(const IC &itb, const IC &ite)