33 #if defined(ConstRangeAdapter_RECURSES) 34 #error Recursive header files inclusion detected in ConstRangeAdapter.h 35 #else // defined(ConstRangeAdapter_RECURSES) 37 #define ConstRangeAdapter_RECURSES 39 #if !defined ConstRangeAdapter_h 41 #define ConstRangeAdapter_h 45 #include "DGtal/base/BasicFunctors.h" 47 #include "DGtal/base/ReverseIterator.h" 48 #include "DGtal/base/Circulator.h" 49 #include "DGtal/base/ConstIteratorAdapter.h" 50 #include "boost/concept_check.hpp" 85 template <
typename TIterator,
typename TFunctor,
typename TReturnType>
113 const TFunctor& aFunctor )
125 const TFunctor* aFunctorPtr )
171 out <<
"[ConstRangeAdapter]" << std::endl;
173 std::copy( this->
begin(), this->
end(), std::ostream_iterator<TReturnType>(out,
", ") );
182 return "ConstRangeAdapter";
246 ConstReverseIterator
rend()
const {
257 ConstCirculator
c()
const {
269 ConstReverseCirculator
rc()
const {
301 for ( ; it != ite; ++it, ++d)
314 template <
typename TIterator,
typename TFunctor,
typename TReturnType>
316 operator<< ( std::ostream & out, const ConstRangeAdapter<TIterator, TFunctor, TReturnType> & object )
318 object.selfDisplay( out );
328 template <
typename A,
typename B>
330 operator<< ( std::ostream & out, const std::pair<A, B> & object )
332 out <<
object.first <<
"|" <<
object.second;
340 #endif // !defined ConstRangeAdapter_h 342 #undef ConstRangeAdapter_RECURSES 343 #endif // else defined(ConstRangeAdapter_RECURSES) ReverseIterator< ConstIterator > ConstReverseIterator
void selfDisplay(std::ostream &out) const
This class adapts any iterator so that operator* returns another element than the one pointed to by t...
const TFunctor * myFunctor
std::string className() const
ReverseIterator< ConstCirculator > ConstReverseCirculator
ConstCirculator c() const
This class adapts any bidirectional iterator so that operator++ calls operator-- and vice versa...
Difference size(const TIterator &itb, const TIterator &ite, BidirectionalCategory) const
ConstIteratorAdapter< TIterator, TFunctor, TReturnType > ConstIterator
Difference size(const TIterator &itb, const TIterator &ite, RandomAccessCategory) const
ConstReverseIterator rbegin() const
ConstRangeAdapter & operator=(const ConstRangeAdapter &other)
ConstReverseIterator rend() const
ConstRangeAdapter(const TIterator &itb, const TIterator &ite, const TFunctor &aFunctor)
ToDGtalCategory< typename boost::iterator_category< IC >::type >::Category Category
BOOST_CONCEPT_ASSERT((boost_concepts::ReadableIteratorConcept< TIterator >))
ConstReverseCirculator rc() const
Go to http://www.boost.org/doc/libs/1_52_0/libs/iterator/doc/BidirectionalTraversal.html.
Aim: Provides an adapter for classical iterators that can iterate through the underlying data structu...
DGtal is the top-level namespace which contains all DGtal functions and types.
Aim: model of CConstBidirectionalRange that adapts any range of elements bounded by two iterators [it...
IC::difference_type Difference
Circulator< ConstIterator > ConstCirculator
IteratorCirculatorTraits< ConstIterator >::Difference Difference
ConstIterator begin() const
ConstRangeAdapter(const ConstRangeAdapter &other)
ConstRangeAdapter(const TIterator &itb, const TIterator &ite, const TFunctor *aFunctorPtr)
ConstIterator end() const
Go to http://www.boost.org/doc/libs/1_52_0/libs/iterator/doc/ReadableIterator.html.