#include <SparseBitmap.h>
To that end, the implementation uses a vector of bitmap entries, each storing a start and an end value.
Note that in all cases, ranges must be well-formed, i.e. the end must always be greater than start.
XXX/bowei -- this isn't a bitmap. that still needs to be implemented.
Definition at line 44 of file SparseBitmap.h.
Public Member Functions | |
SparseBitmap () | |
Default constructor. | |
SparseBitmap (const Builder &) | |
Builder constructor. | |
void | set (_inttype_t start, _inttype_t len=1) |
Set the given bit range to true. | |
void | clear (_inttype_t start, _inttype_t len=1) |
Set the given bit range to false. | |
bool | is_set (_inttype_t start, _inttype_t len=1) |
Check if the given range is set. | |
bool | operator[] (_inttype_t val) |
Array operator overload for syntactic sugar. | |
_inttype_t | num_set () |
Return the total number of set bits. | |
bool | empty () |
Return whether or not the bitmap is empty. | |
size_t | num_entries () |
Return the number of range entries (for testing only). | |
void | clear () |
Clear the whole bitmap. | |
_inttype_t | num_contiguous () |
Return the total number of contiguous bits on the left of the range. | |
int | format (char *bp, size_t len) const |
Virtual from Formatter. | |
void | serialize (SerializeAction *a) |
Virtual from SerializableObject. | |
iterator | begin () |
Return an iterator at the start of the vector. | |
iterator | end () |
Return an iterator at the end of the vector. | |
_inttype_t | first () |
Syntactic sugar to get the first bit set. | |
_inttype_t | last () |
Syntactic sugar to get the last bit set. | |
Protected Types | |
typedef SerializableVector < Range > | RangeVector |
Protected Member Functions | |
void | validate () |
Protected Attributes | |
RangeVector | bitmap_ |
Classes | |
class | iterator |
An STL-like iterator class. More... | |
class | Range |
typedef SerializableVector<Range> oasys::SparseBitmap< _inttype_t >::RangeVector [protected] |
Definition at line 134 of file SparseBitmap.h.
oasys::SparseBitmap< _inttype_t >::SparseBitmap | ( | ) | [inline] |
oasys::SparseBitmap< _inttype_t >::SparseBitmap | ( | const Builder & | b | ) | [inline] |
void oasys::SparseBitmap< _inttype_t >::set | ( | _inttype_t | start, | |
_inttype_t | len = 1 | |||
) | [inline] |
void oasys::SparseBitmap< _inttype_t >::clear | ( | _inttype_t | start, | |
_inttype_t | len = 1 | |||
) | [inline] |
bool oasys::SparseBitmap< _inttype_t >::is_set | ( | _inttype_t | start, | |
_inttype_t | len = 1 | |||
) | [inline] |
Check if the given range is set.
Definition at line 426 of file SparseBitmap.h.
Referenced by oasys::SparseBitmap< _inttype_t >::operator[]().
bool oasys::SparseBitmap< _inttype_t >::operator[] | ( | _inttype_t | val | ) | [inline] |
Array operator overload for syntactic sugar.
Definition at line 75 of file SparseBitmap.h.
References oasys::SparseBitmap< _inttype_t >::is_set().
_inttype_t oasys::SparseBitmap< _inttype_t >::num_set | ( | ) | [inline] |
bool oasys::SparseBitmap< _inttype_t >::empty | ( | ) | [inline] |
Return whether or not the bitmap is empty.
Definition at line 88 of file SparseBitmap.h.
References oasys::SparseBitmap< _inttype_t >::bitmap_.
Referenced by dtn::CLConnection::close_contact().
size_t oasys::SparseBitmap< _inttype_t >::num_entries | ( | ) | [inline] |
Return the number of range entries (for testing only).
Definition at line 93 of file SparseBitmap.h.
References oasys::SparseBitmap< _inttype_t >::bitmap_.
void oasys::SparseBitmap< _inttype_t >::clear | ( | ) | [inline] |
Clear the whole bitmap.
Definition at line 98 of file SparseBitmap.h.
References oasys::SparseBitmap< _inttype_t >::bitmap_.
_inttype_t oasys::SparseBitmap< _inttype_t >::num_contiguous | ( | ) | [inline] |
Return the total number of contiguous bits on the left of the range.
Definition at line 441 of file SparseBitmap.h.
Referenced by dtn::CLConnection::close_contact().
int oasys::SparseBitmap< _inttype_t >::format | ( | char * | bp, | |
size_t | len | |||
) | const [inline, virtual] |
void oasys::SparseBitmap< _inttype_t >::serialize | ( | SerializeAction * | a | ) | [inline, virtual] |
Virtual from SerializableObject.
Implements oasys::SerializableObject.
Definition at line 493 of file SparseBitmap.h.
void oasys::SparseBitmap< _inttype_t >::validate | ( | ) | [inline, protected] |
Definition at line 510 of file SparseBitmap.h.
SparseBitmap< _inttype_t >::iterator oasys::SparseBitmap< _inttype_t >::begin | ( | ) | [inline] |
Return an iterator at the start of the vector.
Definition at line 689 of file SparseBitmap.h.
Referenced by oasys::SparseBitmap< _inttype_t >::first().
SparseBitmap< _inttype_t >::iterator oasys::SparseBitmap< _inttype_t >::end | ( | ) | [inline] |
Return an iterator at the end of the vector.
Definition at line 697 of file SparseBitmap.h.
Referenced by oasys::SparseBitmap< _inttype_t >::last().
_inttype_t oasys::SparseBitmap< _inttype_t >::first | ( | ) | [inline] |
Syntactic sugar to get the first bit set.
Definition at line 246 of file SparseBitmap.h.
References oasys::SparseBitmap< _inttype_t >::begin().
_inttype_t oasys::SparseBitmap< _inttype_t >::last | ( | ) | [inline] |
Syntactic sugar to get the last bit set.
Definition at line 251 of file SparseBitmap.h.
References oasys::SparseBitmap< _inttype_t >::end().
Referenced by dtn::CLConnection::close_contact().
RangeVector oasys::SparseBitmap< _inttype_t >::bitmap_ [protected] |
Definition at line 135 of file SparseBitmap.h.
Referenced by oasys::SparseBitmap< _inttype_t >::clear(), oasys::SparseBitmap< _inttype_t >::empty(), and oasys::SparseBitmap< _inttype_t >::num_entries().