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

Public Member Functions

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

Private Attributes

std::vector< CodemyPosCodes
 
std::vector< CodemyNegCodes
 
TIterator myFirst
 
TIterator myLast
 

Detailed Description

template<typename TConstIterator, typename TInteger>
template<class TIterator>
class DGtal::OneBalancedWordComputer< TConstIterator, TInteger >::CodeHandler< TIterator, BidirectionalCategory >

Partial specialization template in the case where the iterator is of category bidirectional

Definition at line 163 of file OneBalancedWordComputer.h.

Constructor & Destructor Documentation

template<typename TConstIterator , typename TInteger >
template<class TIterator >
DGtal::OneBalancedWordComputer< TConstIterator, TInteger >::CodeHandler< TIterator, BidirectionalCategory >::CodeHandler ( )
inline

Definition at line 166 of file OneBalancedWordComputer.h.

167  {
168  }

Member Function Documentation

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

Definition at line 180 of file OneBalancedWordComputer.h.

181  {
182  Code c;
183  if ( n<0 )
184  {
185  unsigned int i = 1-n;
186  while ( i >= myNegCodes.size() )
187  {
188  --myFirst;
189  myNegCodes.push_back( *myFirst );
190  }
191  c = myNegCodes[ n ];
192  }
193  else
194  {
195  unsigned int i = n;
196  while ( i >= myPosCodes.size() )
197  {
198  myPosCodes.push_back( *myLast );
199  ++myLast;
200  }
201  c = myPosCodes[ n ];
202  }
203  return c;
204  }
IteratorCirculatorTraits< ConstIterator >::Value Code
template<typename TConstIterator , typename TInteger >
template<class TIterator >
void DGtal::OneBalancedWordComputer< TConstIterator, TInteger >::CodeHandler< TIterator, BidirectionalCategory >::init ( const TIterator &  it)
inline

Field Documentation

template<typename TConstIterator , typename TInteger >
template<class TIterator >
TIterator DGtal::OneBalancedWordComputer< TConstIterator, TInteger >::CodeHandler< TIterator, BidirectionalCategory >::myFirst
private

Definition at line 209 of file OneBalancedWordComputer.h.

template<typename TConstIterator , typename TInteger >
template<class TIterator >
TIterator DGtal::OneBalancedWordComputer< TConstIterator, TInteger >::CodeHandler< TIterator, BidirectionalCategory >::myLast
private

Definition at line 210 of file OneBalancedWordComputer.h.

template<typename TConstIterator , typename TInteger >
template<class TIterator >
std::vector<Code> DGtal::OneBalancedWordComputer< TConstIterator, TInteger >::CodeHandler< TIterator, BidirectionalCategory >::myNegCodes
private

Definition at line 208 of file OneBalancedWordComputer.h.

template<typename TConstIterator , typename TInteger >
template<class TIterator >
std::vector<Code> DGtal::OneBalancedWordComputer< TConstIterator, TInteger >::CodeHandler< TIterator, BidirectionalCategory >::myPosCodes
private

Definition at line 207 of file OneBalancedWordComputer.h.


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