Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members

atlas::bitmap::BitMap::iterator Class Reference

Traverses the set bits of a BitMap. More...

#include <bitmap.h>

Collaboration diagram for atlas::bitmap::BitMap::iterator:

Collaboration graph
[legend]
List of all members.

Public Types

typedef std::forward_iterator_tag iterator_category
typedef unsigned long value_type
typedef ptrdiff_t difference_type
typedef const value_typepointer
typedef const value_typereference

Public Member Functions

 iterator ()
 iterator (const iterator &j)
 iterator (const std::vector< unsigned long >::const_iterator &p, unsigned long n, unsigned long c)
 ~iterator ()
iteratoroperator= (const iterator &i)
bool operator== (const iterator &i) const
bool operator!= (const iterator &i) const
bool operator() () const
const value_typeoperator * () const
iteratoroperator++ ()
iterator operator++ (int)

Private Attributes

std::vector< unsigned long
>::const_iterator 
d_chunk
unsigned long d_bitAddress
unsigned long d_capacity

Detailed Description

Traverses the set bits of a BitMap.

Because of the nature of a bitmap (as a collection of addresses of set bits), only constant iterators make sense; one cannot "change the value" of an element at a given position because the value _is_ the position. The most delicate operation is the increment, which has to find the position of the next set bit, while avoiding falling off the bitmap if there is no such. Because of this we had to pass the data for the end of the bitmap into the iterator.

Definition at line 232 of file bitmap.h.


Member Typedef Documentation

typedef ptrdiff_t atlas::bitmap::BitMap::iterator::difference_type
 

Definition at line 245 of file bitmap.h.

typedef std::forward_iterator_tag atlas::bitmap::BitMap::iterator::iterator_category
 

Definition at line 243 of file bitmap.h.

typedef const value_type* atlas::bitmap::BitMap::iterator::pointer
 

Definition at line 246 of file bitmap.h.

typedef const value_type& atlas::bitmap::BitMap::iterator::reference
 

Definition at line 247 of file bitmap.h.

typedef unsigned long atlas::bitmap::BitMap::iterator::value_type
 

Definition at line 244 of file bitmap.h.


Constructor & Destructor Documentation

atlas::bitmap::BitMap::iterator::iterator  )  [inline]
 

Definition at line 250 of file bitmap.h.

atlas::bitmap::BitMap::iterator::iterator const iterator j  )  [inline]
 

Definition at line 252 of file bitmap.h.

atlas::bitmap::BitMap::iterator::iterator const std::vector< unsigned long >::const_iterator p,
unsigned long  n,
unsigned long  c
[inline]
 

Definition at line 255 of file bitmap.h.

References atlas::bitmap::BitMap::const_iterator.

atlas::bitmap::BitMap::iterator::~iterator  )  [inline]
 

Definition at line 259 of file bitmap.h.


Member Function Documentation

const value_type& atlas::bitmap::BitMap::iterator::operator *  )  const [inline]
 

Definition at line 277 of file bitmap.h.

bool atlas::bitmap::BitMap::iterator::operator!= const iterator i  )  const [inline]
 

Definition at line 269 of file bitmap.h.

References d_bitAddress.

bool atlas::bitmap::BitMap::iterator::operator()  )  const [inline]
 

Definition at line 273 of file bitmap.h.

BitMap::iterator atlas::bitmap::BitMap::iterator::operator++ int   ) 
 

Post-increment operator; it should return the value as it was _before_ the incrementation.

Definition at line 571 of file bitmap.cpp.

BitMap::iterator & atlas::bitmap::BitMap::iterator::operator++  ) 
 

The incrementation operator; it has to move the bitAddress to the next set bit, and move the chunk if necessary.

Definition at line 516 of file bitmap.cpp.

References d_bitAddress, d_capacity, d_chunk, and atlas::bits::firstBit().

BitMap::iterator & atlas::bitmap::BitMap::iterator::operator= const iterator i  ) 
 

Definition at line 506 of file bitmap.cpp.

References d_bitAddress, d_capacity, and d_chunk.

bool atlas::bitmap::BitMap::iterator::operator== const iterator i  )  const [inline]
 

Definition at line 265 of file bitmap.h.

References d_bitAddress.


Member Data Documentation

unsigned long atlas::bitmap::BitMap::iterator::d_bitAddress [private]
 

Definition at line 237 of file bitmap.h.

Referenced by operator!=(), operator++(), operator=(), and operator==().

unsigned long atlas::bitmap::BitMap::iterator::d_capacity [private]
 

Definition at line 238 of file bitmap.h.

Referenced by operator++(), and operator=().

std::vector<unsigned long>::const_iterator atlas::bitmap::BitMap::iterator::d_chunk [private]
 

Definition at line 236 of file bitmap.h.

Referenced by operator++(), and operator=().


The documentation for this class was generated from the following files:
Generated on Wed Mar 26 16:52:18 2008 for atlas by  doxygen 1.3.9.1