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 150 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+ (unsigned int diff)
 Addition operator.
iteratoroperator+= (unsigned int diff)
 Addition and assigment operator.
iteratoroperator-- ()
 Prefix decrement operator.
iterator operator-- (int)
 Postfix decrement operator.
iterator operator- (unsigned int diff)
 Subtraction operator.
iteratoroperator-= (unsigned int diff)
 Subtraction and assigment 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 (  )  [inline]

Constructor to initialize an empty iterator.

Definition at line 528 of file SparseBitmap.h.

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

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

Definition at line 535 of file SparseBitmap.h.


Member Function Documentation

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

Dereference operator returns the current bit offset.

Definition at line 544 of file SparseBitmap.h.

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

Prefix increment operator.

Definition at line 552 of file SparseBitmap.h.

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

Postfix increment operator.

Definition at line 566 of file SparseBitmap.h.

template<typename _inttype_t>
SparseBitmap< _inttype_t >::iterator oasys::SparseBitmap< _inttype_t >::iterator::operator+ ( unsigned int  diff  )  [inline]

Addition operator.

Definition at line 576 of file SparseBitmap.h.

template<typename _inttype_t>
SparseBitmap< _inttype_t >::iterator & oasys::SparseBitmap< _inttype_t >::iterator::operator+= ( unsigned int  diff  )  [inline]

Addition and assigment operator.

Definition at line 586 of file SparseBitmap.h.

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

Prefix decrement operator.

Definition at line 607 of file SparseBitmap.h.

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

Postfix decrement operator.

Definition at line 624 of file SparseBitmap.h.

template<typename _inttype_t>
SparseBitmap< _inttype_t >::iterator oasys::SparseBitmap< _inttype_t >::iterator::operator- ( unsigned int  diff  )  [inline]

Subtraction operator.

Definition at line 634 of file SparseBitmap.h.

template<typename _inttype_t>
SparseBitmap< _inttype_t >::iterator & oasys::SparseBitmap< _inttype_t >::iterator::operator-= ( unsigned int  diff  )  [inline]

Subtraction and assigment operator.

Definition at line 644 of file SparseBitmap.h.

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

Equality operator.

Definition at line 664 of file SparseBitmap.h.

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

Inequality operator.

Definition at line 672 of file SparseBitmap.h.

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

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 680 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 220 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 227 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 230 of file SparseBitmap.h.


The documentation for this class was generated from the following file:
Generated on Sat Sep 8 08:43:56 2007 for DTN Reference Implementation by  doxygen 1.5.3