DGtal  1.3.beta
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>
80  {
81  // ----------------------- public types ------------------------------
82  public:
85 
86  typedef TSequence Sequence;
87  typedef TRank Rank;
89  typedef typename Sequence::value_type SequenceValue;
90  typedef std::pair<SequenceValue,Rank> Value;
91  typedef typename Sequence::const_iterator ConstIterator;
92  typedef 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;
101  typedef std::input_iterator_tag iterator_category;
102 
103  // ----------------------- Standard services ------------------------------
104  public:
105 
110 
117 
124 
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 
210 
211  // ------------------------- Hidden services ------------------------------
212  protected:
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)
DGtal::InputIteratorWithRankOnSequence::operator->
Pointer operator->() const
DGtal::InputIteratorWithRankOnSequence::myIterator
ConstIterator myIterator
The current iterator position on the sequence.
Definition: InputIteratorWithRankOnSequence.h:206
DGtal::concepts::CInteger
Aim: Concept checking for Integer Numbers. More precisely, this concept is a refinement of both CEucl...
Definition: CInteger.h:87
DGtal::InputIteratorWithRankOnSequence::Self
InputIteratorWithRankOnSequence< Sequence, Rank > Self
Definition: InputIteratorWithRankOnSequence.h:88
DGtal::InputIteratorWithRankOnSequence::ConstIterator
Sequence::const_iterator ConstIterator
Definition: InputIteratorWithRankOnSequence.h:91
DGtal::InputIteratorWithRankOnSequence::mySequence
CountedPtr< Sequence > mySequence
A smart pointer to the visited sequence.
Definition: InputIteratorWithRankOnSequence.h:204
DGtal::InputIteratorWithRankOnSequence::reference
value_type & reference
Definition: InputIteratorWithRankOnSequence.h:99
DGtal::InputIteratorWithRankOnSequence::isValid
bool isValid() const
DGtal::InputIteratorWithRankOnSequence::InputIteratorWithRankOnSequence
InputIteratorWithRankOnSequence()
DGtal::InputIteratorWithRankOnSequence::operator*
Value operator*() const
DGtal::operator<<
std::ostream & operator<<(std::ostream &out, const ATu0v1< TKSpace, TLinearAlgebra > &object)
DGtal::InputIteratorWithRankOnSequence::SequenceValue
Sequence::value_type SequenceValue
Definition: InputIteratorWithRankOnSequence.h:89
DGtal::InputIteratorWithRankOnSequence::operator=
Self & operator=(const Self &other)
DGtal
DGtal is the top-level namespace which contains all DGtal functions and types.
DGtal::InputIteratorWithRankOnSequence::Pointer
Value * Pointer
Definition: InputIteratorWithRankOnSequence.h:92
DGtal::InputIteratorWithRankOnSequence::pointer
Pointer pointer
Definition: InputIteratorWithRankOnSequence.h:98
DGtal::InputIteratorWithRankOnSequence::size_type
Sequence::size_type size_type
Definition: InputIteratorWithRankOnSequence.h:96
DGtal::CountedPtr< Sequence >
boost::Sequence
Go to http://www.sgi.com/tech/stl/Sequence.html.
Definition: Boost.dox:128
DGtal::InputIteratorWithRankOnSequence::selfDisplay
void selfDisplay(std::ostream &out) const
DGtal::InputIteratorWithRankOnSequence
Aim: Useful to create an iterator that returns a pair (value,rank) when visiting a sequence....
Definition: InputIteratorWithRankOnSequence.h:79
DGtal::InputIteratorWithRankOnSequence::BOOST_CONCEPT_ASSERT
BOOST_CONCEPT_ASSERT((boost::Sequence< TSequence >))
DGtal::InputIteratorWithRankOnSequence::operator!=
bool operator!=(const Self &other) const
DGtal::InputIteratorWithRankOnSequence::difference_type
Sequence::difference_type difference_type
Definition: InputIteratorWithRankOnSequence.h:97
DGtal::InputIteratorWithRankOnSequence::Rank
TRank Rank
Definition: InputIteratorWithRankOnSequence.h:87
DGtal::InputIteratorWithRankOnSequence::Value
std::pair< SequenceValue, Rank > Value
Definition: InputIteratorWithRankOnSequence.h:90
DGtal::InputIteratorWithRankOnSequence::value_type
Value value_type
Definition: InputIteratorWithRankOnSequence.h:95
DGtal::InputIteratorWithRankOnSequence::~InputIteratorWithRankOnSequence
~InputIteratorWithRankOnSequence()
DGtal::InputIteratorWithRankOnSequence::myTmpValue
Value myTmpValue
Definition: InputIteratorWithRankOnSequence.h:209
DGtal::InputIteratorWithRankOnSequence::operator==
bool operator==(const Self &other) const
DGtal::InputIteratorWithRankOnSequence::operator++
Self & operator++()
DGtal::InputIteratorWithRankOnSequence::const_reference
reference const_reference
Definition: InputIteratorWithRankOnSequence.h:100
DGtal::InputIteratorWithRankOnSequence::Sequence
TSequence Sequence
Definition: InputIteratorWithRankOnSequence.h:86
DGtal::InputIteratorWithRankOnSequence::iterator_category
std::input_iterator_tag iterator_category
Definition: InputIteratorWithRankOnSequence.h:101