cgma
Hasher< Y, B >::iterator Class Reference

#include <IdHasher.hpp>

Inheritance diagram for Hasher< Y, B >::iterator:
Hasher< Y, B >::BaseIter< Y::value_type >

List of all members.

Public Member Functions

 iterator ()
 iterator (const iterator &copy)
iteratoroperator++ ()
iterator operator++ (int)
bool operator== (const iterator &other) const
bool operator!= (const iterator &other) const
reference operator* ()
iteratoroperator= (const iterator &other)

Protected Member Functions

 iterator (Y **c, bool b)

Protected Attributes

Y ** mChildren
size_t index
Y::iterator iter

Private Types

enum  { MySize = 1 << B }
typedef Y::value_type & reference

Friends

class Hasher

Detailed Description

template<class Y, unsigned int B>
class Hasher< Y, B >::iterator

Definition at line 136 of file IdHasher.hpp.


Member Typedef Documentation

template<class Y, unsigned int B>
typedef Y::value_type& Hasher< Y, B >::iterator::reference [private]

Reimplemented from Hasher< Y, B >::BaseIter< Y::value_type >.

Definition at line 139 of file IdHasher.hpp.


Member Enumeration Documentation

template<class Y, unsigned int B>
anonymous enum [private]
Enumerator:
MySize 

Definition at line 140 of file IdHasher.hpp.

{ MySize = 1 << B };

Constructor & Destructor Documentation

template<class Y, unsigned int B>
Hasher< Y, B >::iterator::iterator ( ) [inline]

Definition at line 143 of file IdHasher.hpp.

: mChildren(NULL), index(MySize) {}
template<class Y, unsigned int B>
Hasher< Y, B >::iterator::iterator ( const iterator copy) [inline]

Definition at line 144 of file IdHasher.hpp.

      {
        this->operator=(copy);
      }
template<class Y, unsigned int B>
Hasher< Y, B >::iterator::iterator ( Y **  c,
bool  b 
) [inline, protected]

Definition at line 205 of file IdHasher.hpp.

      {
        mChildren = c;
        index = MySize;
        if(b)
        {
          Y** s = c;
          for(; s<c+MySize && !*s; s++){}
          if(s<c+MySize && *s)
          {
            index = s - c;
            iter = (*s)->begin();
            for(; 0 == *iter; ++iter) {}
          }
        }
      }

Member Function Documentation

template<class Y, unsigned int B>
bool Hasher< Y, B >::iterator::operator!= ( const iterator other) const [inline]

Definition at line 185 of file IdHasher.hpp.

      {
        return !operator==(other);
      }
template<class Y, unsigned int B>
reference Hasher< Y, B >::iterator::operator* ( ) [inline]

Definition at line 190 of file IdHasher.hpp.

      {
        return *iter;
      }
template<class Y, unsigned int B>
iterator& Hasher< Y, B >::iterator::operator++ ( ) [inline]

Definition at line 150 of file IdHasher.hpp.

      {
        if(index != MySize)
        {
          ++iter;
          typename Y::iterator e = mChildren[index]->end();
          for(; this->iter != e && !*iter; ++iter) {}
          if(iter == e)
          {
            for(++index; index < MySize && !mChildren[index]; ++index) {}
            if(index != MySize)
            {
              e = mChildren[index]->end();
              for(iter = mChildren[index]->begin(); this->iter != e && !*iter; ++iter) {}
            }
          }
        }
        return *this;
      }
template<class Y, unsigned int B>
iterator Hasher< Y, B >::iterator::operator++ ( int  ) [inline]

Definition at line 171 of file IdHasher.hpp.

      {
        iterator tmp(*this);
        this->operator++();
        return tmp;
      }
template<class Y, unsigned int B>
iterator& Hasher< Y, B >::iterator::operator= ( const iterator other) [inline]

Definition at line 195 of file IdHasher.hpp.

      {
        this->mChildren = other.mChildren;
        this->index = other.index;
        if(other.mChildren)
          this->iter = other.iter;
        return *this;
      }
template<class Y, unsigned int B>
bool Hasher< Y, B >::iterator::operator== ( const iterator other) const [inline]

Definition at line 178 of file IdHasher.hpp.

      {
        if( MySize == this->index && MySize == other.index)
          return true;
        return this->index == other.index && this->iter == other.iter;
      }

Friends And Related Function Documentation

template<class Y, unsigned int B>
friend class Hasher [friend]

Definition at line 138 of file IdHasher.hpp.


Member Data Documentation

template<class Y, unsigned int B>
size_t Hasher< Y, B >::iterator::index [protected]

Definition at line 223 of file IdHasher.hpp.

template<class Y, unsigned int B>
Y::iterator Hasher< Y, B >::iterator::iter [protected]

Definition at line 224 of file IdHasher.hpp.

template<class Y, unsigned int B>
Y** Hasher< Y, B >::iterator::mChildren [protected]

Definition at line 222 of file IdHasher.hpp.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines