#include <SparseBitmap.h>
Inheritance diagram for oasys::SparseBitmap< _inttype_t >:
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.
Definition at line 58 of file SparseBitmap.h.
Public Member Functions | |
SparseBitmap () | |
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. | |
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 std::vector< Range > | RangeVector |
Protected Member Functions | |
void | validate () |
Protected Attributes | |
RangeVector | bitmap_ |
Classes | |
class | iterator |
An STL-like iterator class. More... | |
struct | Range |
typedef std::vector<Range> oasys::SparseBitmap< _inttype_t >::RangeVector [protected] |
Definition at line 128 of file SparseBitmap.h.
oasys::SparseBitmap< _inttype_t >::SparseBitmap | ( | ) |
void oasys::SparseBitmap< _inttype_t >::set | ( | _inttype_t | start, | |
_inttype_t | len = 1 | |||
) |
void oasys::SparseBitmap< _inttype_t >::clear | ( | _inttype_t | start, | |
_inttype_t | len = 1 | |||
) |
bool oasys::SparseBitmap< _inttype_t >::is_set | ( | _inttype_t | start, | |
_inttype_t | len = 1 | |||
) |
Check if the given range is set.
Definition at line 424 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 83 of file SparseBitmap.h.
References oasys::SparseBitmap< _inttype_t >::is_set().
_inttype_t oasys::SparseBitmap< _inttype_t >::num_set | ( | ) |
bool oasys::SparseBitmap< _inttype_t >::empty | ( | ) | [inline] |
Return whether or not the bitmap is empty.
Definition at line 96 of file SparseBitmap.h.
References oasys::SparseBitmap< _inttype_t >::bitmap_.
size_t oasys::SparseBitmap< _inttype_t >::num_entries | ( | ) | [inline] |
Return the number of range entries (for testing only).
Definition at line 101 of file SparseBitmap.h.
References oasys::SparseBitmap< _inttype_t >::bitmap_.
void oasys::SparseBitmap< _inttype_t >::clear | ( | ) | [inline] |
Clear the whole bitmap.
Definition at line 106 of file SparseBitmap.h.
References oasys::SparseBitmap< _inttype_t >::bitmap_.
_inttype_t oasys::SparseBitmap< _inttype_t >::num_contiguous | ( | ) |
Return the total number of contiguous bits on the left of the range.
Definition at line 439 of file SparseBitmap.h.
int oasys::SparseBitmap< _inttype_t >::format | ( | char * | bp, | |
size_t | len | |||
) | const [virtual] |
void oasys::SparseBitmap< _inttype_t >::validate | ( | ) | [protected] |
Definition at line 499 of file SparseBitmap.h.
SparseBitmap< _inttype_t >::iterator oasys::SparseBitmap< _inttype_t >::begin | ( | ) |
Return an iterator at the start of the vector.
Definition at line 649 of file SparseBitmap.h.
Referenced by oasys::SparseBitmap< _inttype_t >::first().
SparseBitmap< _inttype_t >::iterator oasys::SparseBitmap< _inttype_t >::end | ( | ) |
Return an iterator at the end of the vector.
Definition at line 657 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 230 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 235 of file SparseBitmap.h.
References oasys::SparseBitmap< _inttype_t >::end().
RangeVector oasys::SparseBitmap< _inttype_t >::bitmap_ [protected] |
Definition at line 129 of file SparseBitmap.h.
Referenced by oasys::SparseBitmap< _inttype_t >::clear(), oasys::SparseBitmap< _inttype_t >::empty(), and oasys::SparseBitmap< _inttype_t >::num_entries().