DGtal 1.3.0
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Private Attributes | Friends
DGtal::FreemanChain< TInteger >::CodesRange Class Reference

Aim: model of CRange that provides services to (circularly)iterate over the letters of the freeman chain. More...

#include <DGtal/geometry/curves/FreemanChain.h>

Public Types

typedef std::string::const_iterator ConstIterator
 
typedef std::string::const_reverse_iterator ConstReverseIterator
 
typedef Circulator< ConstIteratorConstCirculator
 
typedef std::reverse_iterator< ConstCirculatorConstReverseCirculator
 

Public Member Functions

 CodesRange ()
 
 CodesRange (const std::string &aChain)
 
 CodesRange (const CodesRange &aOther)
 
CodesRangeoperator= (const CodesRange &other)
 
 ~CodesRange ()
 
std::string::size_type size () const
 
bool isValid () const
 
void selfDisplay (std::ostream &out) const
 
ConstIterator begin () const
 
ConstIterator end () const
 
ConstReverseIterator rbegin () const
 
ConstReverseIterator rend () const
 
ConstCirculator c () const
 
ConstReverseCirculator rc () const
 

Private Attributes

const std::string myChain
 

Friends

std::ostream & operator<< (std::ostream &out, const CodesRange &object)
 

Detailed Description

template<typename TInteger>
class DGtal::FreemanChain< TInteger >::CodesRange

Aim: model of CRange that provides services to (circularly)iterate over the letters of the freeman chain.

See also
FreemanChain.h testFreemanChain.cpp

Definition at line 387 of file FreemanChain.h.

Member Typedef Documentation

◆ ConstCirculator

template<typename TInteger >
typedef Circulator<ConstIterator> DGtal::FreemanChain< TInteger >::CodesRange::ConstCirculator

Definition at line 395 of file FreemanChain.h.

◆ ConstIterator

template<typename TInteger >
typedef std::string::const_iterator DGtal::FreemanChain< TInteger >::CodesRange::ConstIterator

Definition at line 393 of file FreemanChain.h.

◆ ConstReverseCirculator

template<typename TInteger >
typedef std::reverse_iterator<ConstCirculator> DGtal::FreemanChain< TInteger >::CodesRange::ConstReverseCirculator

Definition at line 396 of file FreemanChain.h.

◆ ConstReverseIterator

template<typename TInteger >
typedef std::string::const_reverse_iterator DGtal::FreemanChain< TInteger >::CodesRange::ConstReverseIterator

Definition at line 394 of file FreemanChain.h.

Constructor & Destructor Documentation

◆ CodesRange() [1/3]

template<typename TInteger >
DGtal::FreemanChain< TInteger >::CodesRange::CodesRange ( )
inline

Default Constructor.

Definition at line 403 of file FreemanChain.h.

403{}

◆ CodesRange() [2/3]

template<typename TInteger >
DGtal::FreemanChain< TInteger >::CodesRange::CodesRange ( const std::string &  aChain)
inline

Constructor.

Definition at line 408 of file FreemanChain.h.

408: myChain(aChain){}

◆ CodesRange() [3/3]

template<typename TInteger >
DGtal::FreemanChain< TInteger >::CodesRange::CodesRange ( const CodesRange aOther)
inline

Copy constructor.

Parameters
aOtherthe iterator to clone.

Definition at line 414 of file FreemanChain.h.

415 : myChain( aOther.myChain ){}

◆ ~CodesRange()

template<typename TInteger >
DGtal::FreemanChain< TInteger >::CodesRange::~CodesRange ( )
inline

Destructor. Does nothing.

Definition at line 434 of file FreemanChain.h.

434{}

Member Function Documentation

◆ begin()

template<typename TInteger >
ConstIterator DGtal::FreemanChain< TInteger >::CodesRange::begin ( ) const
inline

Iterator service.

Returns
begin iterator

Definition at line 488 of file FreemanChain.h.

488 {
489 return myChain.begin();
490 }

References DGtal::FreemanChain< TInteger >::CodesRange::myChain.

Referenced by DGtal::FreemanChain< TInteger >::CodesRange::c(), and DGtal::FreemanChain< TInteger >::CodesRange::selfDisplay().

◆ c()

template<typename TInteger >
ConstCirculator DGtal::FreemanChain< TInteger >::CodesRange::c ( ) const
inline

Circulator service.

Returns
a circulator

Definition at line 520 of file FreemanChain.h.

520 {
521 return ConstCirculator( this->begin(), this->begin(), this->end() );
522 }
ConstIterator end() const
Definition: FreemanChain.h:496
Circulator< ConstIterator > ConstCirculator
Definition: FreemanChain.h:395
ConstIterator begin() const
Definition: FreemanChain.h:488

References DGtal::FreemanChain< TInteger >::CodesRange::begin(), and DGtal::FreemanChain< TInteger >::CodesRange::end().

Referenced by DGtal::FreemanChain< TInteger >::CodesRange::rc().

◆ end()

template<typename TInteger >
ConstIterator DGtal::FreemanChain< TInteger >::CodesRange::end ( ) const
inline

Iterator service.

Returns
end iterator

Definition at line 496 of file FreemanChain.h.

496 {
497 return myChain.end();
498 }

References DGtal::FreemanChain< TInteger >::CodesRange::myChain.

Referenced by DGtal::FreemanChain< TInteger >::CodesRange::c(), and DGtal::FreemanChain< TInteger >::CodesRange::selfDisplay().

◆ isValid()

template<typename TInteger >
bool DGtal::FreemanChain< TInteger >::CodesRange::isValid ( ) const
inline

Checks the validity/consistency of the object.

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

Definition at line 448 of file FreemanChain.h.

448{ return true; }

◆ operator=()

template<typename TInteger >
CodesRange & DGtal::FreemanChain< TInteger >::CodesRange::operator= ( const CodesRange other)
inline

Assignment.

Parameters
otherthe iterator to copy.
Returns
a reference on 'this'.

Definition at line 422 of file FreemanChain.h.

423 {
424 if ( this != &other )
425 {
426 myChain = other.myChain;
427 }
428 return *this;
429 }

References DGtal::FreemanChain< TInteger >::CodesRange::myChain.

◆ rbegin()

template<typename TInteger >
ConstReverseIterator DGtal::FreemanChain< TInteger >::CodesRange::rbegin ( ) const
inline

Iterator service.

Returns
rbegin iterator

Definition at line 504 of file FreemanChain.h.

504 {
505 return myChain.rbegin();
506 }

References DGtal::FreemanChain< TInteger >::CodesRange::myChain.

◆ rc()

template<typename TInteger >
ConstReverseCirculator DGtal::FreemanChain< TInteger >::CodesRange::rc ( ) const
inline

Circulator service.

Returns
a reverse circulator

Definition at line 528 of file FreemanChain.h.

528 {
529 return ConstReverseCirculator( this->c() );
530 }
ConstCirculator c() const
Definition: FreemanChain.h:520
std::reverse_iterator< ConstCirculator > ConstReverseCirculator
Definition: FreemanChain.h:396

References DGtal::FreemanChain< TInteger >::CodesRange::c().

◆ rend()

template<typename TInteger >
ConstReverseIterator DGtal::FreemanChain< TInteger >::CodesRange::rend ( ) const
inline

Iterator service.

Returns
rend iterator

Definition at line 512 of file FreemanChain.h.

512 {
513 return myChain.rend();
514 }

References DGtal::FreemanChain< TInteger >::CodesRange::myChain.

◆ selfDisplay()

template<typename TInteger >
void DGtal::FreemanChain< TInteger >::CodesRange::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 455 of file FreemanChain.h.

456 {
458 out << "[FreemanChainCodes]" << std::endl;
459 out << "\t";
460 std::copy( this->begin(), this->end(), std::ostream_iterator<Value>(out, "") );
461 out << std::endl;
462 }

References DGtal::FreemanChain< TInteger >::CodesRange::begin(), and DGtal::FreemanChain< TInteger >::CodesRange::end().

◆ size()

template<typename TInteger >
std::string::size_type DGtal::FreemanChain< TInteger >::CodesRange::size ( ) const
inline
Returns
the size of the range

Definition at line 439 of file FreemanChain.h.

440 {
441 return myChain.size();
442 }

References DGtal::FreemanChain< TInteger >::CodesRange::myChain.

Friends And Related Function Documentation

◆ operator<<

template<typename TInteger >
std::ostream & operator<< ( std::ostream &  out,
const CodesRange object 
)
friend

Overloads 'operator<<' for displaying objects of class 'CodesRange'.

Parameters
outthe output stream where the object is written.
objectthe object of class 'CodesRange' to write.
Returns
the output stream after the writing.

Definition at line 470 of file FreemanChain.h.

471 {
472 object.selfDisplay( out );
473 return out;
474 }

Field Documentation

◆ myChain

template<typename TInteger >
const std::string DGtal::FreemanChain< TInteger >::CodesRange::myChain
private

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