DGtal  0.9.4beta
Public Types | Public Member Functions | Private Member Functions | Private Attributes
DGtal::SimpleRandomAccessConstRangeFromPoint< TConstIterator, DistanceFunctor > Class Template Reference

#include <DGtal/base/SimpleRandomAccessConstRangeFromPoint.h>

Public Types

typedef DistanceFunctor::Point Point
 
typedef TConstIterator ConstIterator
 
typedef std::reverse_iterator< ConstIteratorConstReverseIterator
 
typedef Circulator< ConstIteratorConstCirculator
 
typedef std::reverse_iterator< ConstCirculatorConstReverseCirculator
 

Public Member Functions

 SimpleRandomAccessConstRangeFromPoint (const TConstIterator &itb, const TConstIterator &ite, const DistanceFunctor &aDistance)
 
 SimpleRandomAccessConstRangeFromPoint (const SimpleRandomAccessConstRangeFromPoint &other)
 
SimpleRandomAccessConstRangeFromPointoperator= (const SimpleRandomAccessConstRangeFromPoint &other)
 
 ~SimpleRandomAccessConstRangeFromPoint ()
 
bool isValid () const
 
void selfDisplay (std::ostream &out) const
 
std::string className () const
 
ConstIterator begin () const
 
ConstIterator begin (const Point &aPoint) const
 
ConstIterator end () const
 
ConstReverseIterator rbegin () const
 
ConstReverseIterator rbegin (const Point &aPoint) const
 
ConstReverseIterator rend () const
 
ConstCirculator c () const
 
ConstReverseCirculator rc () const
 

Private Member Functions

 BOOST_CONCEPT_ASSERT ((boost::RandomAccessIterator< TConstIterator >))
 
 BOOST_CONCEPT_ASSERT ((boost::UnaryFunction< DistanceFunctor, typename DistanceFunctor::Difference, typename DistanceFunctor::Point >))
 

Private Attributes

TConstIterator myBegin
 
TConstIterator myEnd
 
DistanceFunctor myDistance
 

Detailed Description

template<typename TConstIterator, typename DistanceFunctor>
class DGtal::SimpleRandomAccessConstRangeFromPoint< TConstIterator, DistanceFunctor >

Aim: model of CConstBidirectionalRangeFromPoint that adapts any range of elements bounded by two iterators [itb, ite) and provides services to (circularly)iterate over it (in a read-only manner).

Template Parameters
TConstIteratorthe type of the iterator to adapt (at least bidirectional)
DistanceFunctortype of distance from point functor for random access container models. Models must have a Point and a Difference inner types. operator() returns a number of type Difference on instances of Point)
See also
ConstRangeAdapter

Definition at line 73 of file SimpleRandomAccessConstRangeFromPoint.h.

Member Typedef Documentation

template<typename TConstIterator , typename DistanceFunctor >
typedef Circulator<ConstIterator> DGtal::SimpleRandomAccessConstRangeFromPoint< TConstIterator, DistanceFunctor >::ConstCirculator

Definition at line 89 of file SimpleRandomAccessConstRangeFromPoint.h.

template<typename TConstIterator , typename DistanceFunctor >
typedef TConstIterator DGtal::SimpleRandomAccessConstRangeFromPoint< TConstIterator, DistanceFunctor >::ConstIterator

Definition at line 86 of file SimpleRandomAccessConstRangeFromPoint.h.

template<typename TConstIterator , typename DistanceFunctor >
typedef std::reverse_iterator<ConstCirculator> DGtal::SimpleRandomAccessConstRangeFromPoint< TConstIterator, DistanceFunctor >::ConstReverseCirculator

Definition at line 90 of file SimpleRandomAccessConstRangeFromPoint.h.

template<typename TConstIterator , typename DistanceFunctor >
typedef std::reverse_iterator<ConstIterator> DGtal::SimpleRandomAccessConstRangeFromPoint< TConstIterator, DistanceFunctor >::ConstReverseIterator

Definition at line 87 of file SimpleRandomAccessConstRangeFromPoint.h.

template<typename TConstIterator , typename DistanceFunctor >
typedef DistanceFunctor::Point DGtal::SimpleRandomAccessConstRangeFromPoint< TConstIterator, DistanceFunctor >::Point

Definition at line 84 of file SimpleRandomAccessConstRangeFromPoint.h.

Constructor & Destructor Documentation

template<typename TConstIterator , typename DistanceFunctor >
DGtal::SimpleRandomAccessConstRangeFromPoint< TConstIterator, DistanceFunctor >::SimpleRandomAccessConstRangeFromPoint ( const TConstIterator &  itb,
const TConstIterator &  ite,
const DistanceFunctor &  aDistance 
)
inline

Standard constructor from two iterators and one functor.

Parameters
itbbegin iterator.
iteend iterator.
aDistancefunctor used to adapt on-the-fly the elements of the range

Definition at line 102 of file SimpleRandomAccessConstRangeFromPoint.h.

template<typename TConstIterator , typename DistanceFunctor >
DGtal::SimpleRandomAccessConstRangeFromPoint< TConstIterator, DistanceFunctor >::SimpleRandomAccessConstRangeFromPoint ( const SimpleRandomAccessConstRangeFromPoint< TConstIterator, DistanceFunctor > &  other)
inline

Copy constructor.

Parameters
otherthe iterator to clone.

Definition at line 109 of file SimpleRandomAccessConstRangeFromPoint.h.

template<typename TConstIterator , typename DistanceFunctor >
DGtal::SimpleRandomAccessConstRangeFromPoint< TConstIterator, DistanceFunctor >::~SimpleRandomAccessConstRangeFromPoint ( )
inline

Destructor. Does nothing.

Definition at line 132 of file SimpleRandomAccessConstRangeFromPoint.h.

132 {}

Member Function Documentation

template<typename TConstIterator , typename DistanceFunctor >
ConstIterator DGtal::SimpleRandomAccessConstRangeFromPoint< TConstIterator, DistanceFunctor >::begin ( ) const
inline
template<typename TConstIterator , typename DistanceFunctor >
ConstIterator DGtal::SimpleRandomAccessConstRangeFromPoint< TConstIterator, DistanceFunctor >::begin ( const Point aPoint) const
inline
template<typename TConstIterator , typename DistanceFunctor >
DGtal::SimpleRandomAccessConstRangeFromPoint< TConstIterator, DistanceFunctor >::BOOST_CONCEPT_ASSERT ( (boost::RandomAccessIterator< TConstIterator >)  )
private
template<typename TConstIterator , typename DistanceFunctor >
DGtal::SimpleRandomAccessConstRangeFromPoint< TConstIterator, DistanceFunctor >::BOOST_CONCEPT_ASSERT ( (boost::UnaryFunction< DistanceFunctor, typename DistanceFunctor::Difference, typename DistanceFunctor::Point >)  )
private
template<typename TConstIterator , typename DistanceFunctor >
ConstCirculator DGtal::SimpleRandomAccessConstRangeFromPoint< TConstIterator, DistanceFunctor >::c ( ) const
inline
template<typename TConstIterator , typename DistanceFunctor >
std::string DGtal::SimpleRandomAccessConstRangeFromPoint< TConstIterator, DistanceFunctor >::className ( ) const
inline
Returns
the style name used for drawing this object.

Definition at line 160 of file SimpleRandomAccessConstRangeFromPoint.h.

161  {
162  return "SimpleRandomAccessConstRangeFromPoint";
163  }
template<typename TConstIterator , typename DistanceFunctor >
ConstIterator DGtal::SimpleRandomAccessConstRangeFromPoint< TConstIterator, DistanceFunctor >::end ( ) const
inline
template<typename TConstIterator , typename DistanceFunctor >
bool DGtal::SimpleRandomAccessConstRangeFromPoint< TConstIterator, DistanceFunctor >::isValid ( ) const
inline

Checks the validity/consistency of the object.

Returns
'true' if the object is valid, 'false' otherwise.

Definition at line 138 of file SimpleRandomAccessConstRangeFromPoint.h.

139  {
140  return true;
141  }
template<typename TConstIterator , typename DistanceFunctor >
SimpleRandomAccessConstRangeFromPoint& DGtal::SimpleRandomAccessConstRangeFromPoint< TConstIterator, DistanceFunctor >::operator= ( const SimpleRandomAccessConstRangeFromPoint< TConstIterator, DistanceFunctor > &  other)
inline
template<typename TConstIterator , typename DistanceFunctor >
ConstReverseIterator DGtal::SimpleRandomAccessConstRangeFromPoint< TConstIterator, DistanceFunctor >::rbegin ( ) const
inline

Iterator service.

Returns
rbegin iterator

Definition at line 220 of file SimpleRandomAccessConstRangeFromPoint.h.

References DGtal::SimpleRandomAccessConstRangeFromPoint< TConstIterator, DistanceFunctor >::end().

221  {
222  return ConstReverseIterator ( this->end() );
223  }
template<typename TConstIterator , typename DistanceFunctor >
ConstReverseIterator DGtal::SimpleRandomAccessConstRangeFromPoint< TConstIterator, DistanceFunctor >::rbegin ( const Point aPoint) const
inline

Iterator service.

Parameters
aPointa Point
Returns
rbegin iterator

Definition at line 230 of file SimpleRandomAccessConstRangeFromPoint.h.

template<typename TConstIterator , typename DistanceFunctor >
ConstReverseCirculator DGtal::SimpleRandomAccessConstRangeFromPoint< TConstIterator, DistanceFunctor >::rc ( ) const
inline

Circulator service.

Returns
a reverse circulator

Definition at line 258 of file SimpleRandomAccessConstRangeFromPoint.h.

References DGtal::SimpleRandomAccessConstRangeFromPoint< TConstIterator, DistanceFunctor >::c().

259  {
260  return ConstReverseCirculator ( this->c() );
261  }
std::reverse_iterator< ConstCirculator > ConstReverseCirculator
template<typename TConstIterator , typename DistanceFunctor >
ConstReverseIterator DGtal::SimpleRandomAccessConstRangeFromPoint< TConstIterator, DistanceFunctor >::rend ( ) const
inline

Iterator service.

Returns
rend iterator

Definition at line 240 of file SimpleRandomAccessConstRangeFromPoint.h.

template<typename TConstIterator , typename DistanceFunctor >
void DGtal::SimpleRandomAccessConstRangeFromPoint< TConstIterator, DistanceFunctor >::selfDisplay ( std::ostream &  out) const
inline

Writes/Displays the object on an output stream.

Parameters
outthe output stream where the object is written.

Definition at line 148 of file SimpleRandomAccessConstRangeFromPoint.h.

References DGtal::SimpleRandomAccessConstRangeFromPoint< TConstIterator, DistanceFunctor >::myBegin, and DGtal::SimpleRandomAccessConstRangeFromPoint< TConstIterator, DistanceFunctor >::myEnd.

149  {
150  typedef typename IteratorCirculatorTraits<ConstIterator>::Value Value;
151  out << "[SimpleRandomAccessConstRangeFromPoint]" << std::endl;
152  out << "\t";
153  std::copy ( myBegin, myEnd, std::ostream_iterator<Value> ( out, ", " ) );
154  out << std::endl;
155  }

Field Documentation

template<typename TConstIterator , typename DistanceFunctor >
TConstIterator DGtal::SimpleRandomAccessConstRangeFromPoint< TConstIterator, DistanceFunctor >::myBegin
private
template<typename TConstIterator , typename DistanceFunctor >
DistanceFunctor DGtal::SimpleRandomAccessConstRangeFromPoint< TConstIterator, DistanceFunctor >::myDistance
private
template<typename TConstIterator , typename DistanceFunctor >
TConstIterator DGtal::SimpleRandomAccessConstRangeFromPoint< TConstIterator, DistanceFunctor >::myEnd
private

The documentation for this class was generated from the following file: