DGtal  0.9.3beta
Public Member Functions | Private Attributes
DGtal::OneBalancedWordComputer< TConstIterator, TInteger >::CodeHandler< TIterator, iterator_type > Class Template Reference
Inheritance diagram for DGtal::OneBalancedWordComputer< TConstIterator, TInteger >::CodeHandler< TIterator, iterator_type >:
[legend]
Collaboration diagram for DGtal::OneBalancedWordComputer< TConstIterator, TInteger >::CodeHandler< TIterator, iterator_type >:
[legend]

Public Member Functions

 CodeHandler ()
 
void init (const TIterator &it)
 
Code getCode (Index n) const
 
Code getCode (Index n)
 

Private Attributes

std::vector< CodemyCodes
 
TIterator myIter
 

Detailed Description

template<typename TConstIterator, typename TInteger>
template<class TIterator, class iterator_type = typename IteratorCirculatorTraits <TIterator>::Category>
class DGtal::OneBalancedWordComputer< TConstIterator, TInteger >::CodeHandler< TIterator, iterator_type >

CodeHandler encapsulates an iterator in order to provide constant time access to the codes previously read.

Template Parameters
TIteratoran iterator on the codes.
iterator_typethe type of iterations services provided by TIterator.

Definition at line 128 of file OneBalancedWordComputer.h.

Constructor & Destructor Documentation

template<typename TConstIterator , typename TInteger >
template<class TIterator, class iterator_type = typename IteratorCirculatorTraits <TIterator>::Category>
DGtal::OneBalancedWordComputer< TConstIterator, TInteger >::CodeHandler< TIterator, iterator_type >::CodeHandler ( )
inline

Definition at line 131 of file OneBalancedWordComputer.h.

132  { }

Member Function Documentation

template<typename TConstIterator , typename TInteger >
template<class TIterator, class iterator_type = typename IteratorCirculatorTraits <TIterator>::Category>
Code DGtal::OneBalancedWordComputer< TConstIterator, TInteger >::CodeHandler< TIterator, iterator_type >::getCode ( Index  n) const
inline

Definition at line 138 of file OneBalancedWordComputer.h.

139  {
140  return myCodes[ n ];
141  }
template<typename TConstIterator , typename TInteger >
template<class TIterator, class iterator_type = typename IteratorCirculatorTraits <TIterator>::Category>
Code DGtal::OneBalancedWordComputer< TConstIterator, TInteger >::CodeHandler< TIterator, iterator_type >::getCode ( Index  n)
inline

Definition at line 143 of file OneBalancedWordComputer.h.

144  {
145  while ( n >= myCodes.size() )
146  {
147  myCodes.push_back( *myIter );
148  ++myIter;
149  }
150  return myCodes[ n ];
151  }
template<typename TConstIterator , typename TInteger >
template<class TIterator, class iterator_type = typename IteratorCirculatorTraits <TIterator>::Category>
void DGtal::OneBalancedWordComputer< TConstIterator, TInteger >::CodeHandler< TIterator, iterator_type >::init ( const TIterator &  it)
inline

Definition at line 133 of file OneBalancedWordComputer.h.

134  {
135  myIter = it;
136  }

Field Documentation

template<typename TConstIterator , typename TInteger >
template<class TIterator, class iterator_type = typename IteratorCirculatorTraits <TIterator>::Category>
std::vector<Code> DGtal::OneBalancedWordComputer< TConstIterator, TInteger >::CodeHandler< TIterator, iterator_type >::myCodes
private
template<typename TConstIterator , typename TInteger >
template<class TIterator, class iterator_type = typename IteratorCirculatorTraits <TIterator>::Category>
TIterator DGtal::OneBalancedWordComputer< TConstIterator, TInteger >::CodeHandler< TIterator, iterator_type >::myIter
private

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