oasys::SparseBitmap< _inttype_t >::iterator Class Reference

#include <SparseBitmap.h>

List of all members.


Detailed Description

template<typename _inttype_t>
class oasys::SparseBitmap< _inttype_t >::iterator

An STL-like iterator class.

However, to keep in-line with the sparse nature of the class, incrementing the iterator advances only through over the set bits in the bitmap, and the dereference operator returns the offset of the set bit.

For example, if bits 1, 5, and 10 are set, then dereferencing the return from begin() returns 1, incrementing and dereferencing returns 5, etc.

Definition at line 144 of file SparseBitmap.h.

Public Member Functions

 iterator ()
 Constructor to initialize an empty iterator.
_inttype_t operator * ()
 Dereference operator returns the current bit offset.
iteratoroperator++ ()
 Prefix increment operator.
iterator operator++ (int)
 Postfix increment operator.
iterator operator+ (int diff)
 Addition operator.
iteratoroperator-- ()
 Prefix decrement operator.
iterator operator-- (int)
 Postfix decrement operator.
iterator operator- (int diff)
 Subtraction operator.
bool operator== (const iterator &other)
 Equality operator.
bool operator!= (const iterator &other)
 Inequality operator.
iteratorskip_contiguous ()
 Advance past any contiguous bits, returning an iterator at the last contiguous bit that's set.

Private Member Functions

 iterator (typename RangeVector::iterator iter, _inttype_t offset)
 Private constructor used by begin() and end().

Private Attributes

RangeVector::iterator iter_
 iterator to the current Range
_inttype_t offset_
 offset from start_ in the range

Friends

class SparseBitmap< _inttype_t >


Constructor & Destructor Documentation

template<typename _inttype_t>
oasys::SparseBitmap< _inttype_t >::iterator::iterator (  ) 

Constructor to initialize an empty iterator.

Definition at line 517 of file SparseBitmap.h.

template<typename _inttype_t>
oasys::SparseBitmap< _inttype_t >::iterator::iterator ( typename RangeVector::iterator  iter,
_inttype_t  offset 
) [private]

Private constructor used by begin() and end().

Definition at line 524 of file SparseBitmap.h.


Member Function Documentation

template<typename _inttype_t>
_inttype_t oasys::SparseBitmap< _inttype_t >::iterator::operator * (  ) 

Dereference operator returns the current bit offset.

Definition at line 533 of file SparseBitmap.h.

template<typename _inttype_t>
SparseBitmap< _inttype_t >::iterator & oasys::SparseBitmap< _inttype_t >::iterator::operator++ (  ) 

Prefix increment operator.

Definition at line 541 of file SparseBitmap.h.

template<typename _inttype_t>
SparseBitmap< _inttype_t >::iterator oasys::SparseBitmap< _inttype_t >::iterator::operator++ ( int   ) 

Postfix increment operator.

Definition at line 555 of file SparseBitmap.h.

template<typename _inttype_t>
SparseBitmap< _inttype_t >::iterator oasys::SparseBitmap< _inttype_t >::iterator::operator+ ( int  diff  ) 

Addition operator.

Definition at line 565 of file SparseBitmap.h.

template<typename _inttype_t>
SparseBitmap< _inttype_t >::iterator & oasys::SparseBitmap< _inttype_t >::iterator::operator-- (  ) 

Prefix decrement operator.

Definition at line 581 of file SparseBitmap.h.

template<typename _inttype_t>
SparseBitmap< _inttype_t >::iterator oasys::SparseBitmap< _inttype_t >::iterator::operator-- ( int   ) 

Postfix decrement operator.

Definition at line 598 of file SparseBitmap.h.

template<typename _inttype_t>
SparseBitmap< _inttype_t >::iterator oasys::SparseBitmap< _inttype_t >::iterator::operator- ( int  diff  ) 

Subtraction operator.

Definition at line 608 of file SparseBitmap.h.

template<typename _inttype_t>
bool oasys::SparseBitmap< _inttype_t >::iterator::operator== ( const iterator other  ) 

Equality operator.

Definition at line 624 of file SparseBitmap.h.

template<typename _inttype_t>
bool oasys::SparseBitmap< _inttype_t >::iterator::operator!= ( const iterator other  ) 

Inequality operator.

Definition at line 632 of file SparseBitmap.h.

template<typename _inttype_t>
SparseBitmap< _inttype_t >::iterator & oasys::SparseBitmap< _inttype_t >::iterator::skip_contiguous (  ) 

Advance past any contiguous bits, returning an iterator at the last contiguous bit that's set.

The iterator must not be pointing at end() for this to be called.

Definition at line 640 of file SparseBitmap.h.

Referenced by dtn::StreamConvergenceLayer::Connection::handle_ack_segment().


Friends And Related Function Documentation

template<typename _inttype_t>
friend class SparseBitmap< _inttype_t > [friend]

Definition at line 204 of file SparseBitmap.h.


Member Data Documentation

template<typename _inttype_t>
RangeVector::iterator oasys::SparseBitmap< _inttype_t >::iterator::iter_ [private]

iterator to the current Range

Definition at line 211 of file SparseBitmap.h.

template<typename _inttype_t>
_inttype_t oasys::SparseBitmap< _inttype_t >::iterator::offset_ [private]

offset from start_ in the range

Definition at line 214 of file SparseBitmap.h.


The documentation for this class was generated from the following file:
Generated on Fri Dec 22 14:48:08 2006 for DTN Reference Implementation by  doxygen 1.5.1