Set of binary values. More...
#include <cmtkBitVector.h>
Public Types | |
typedef SmartPointer< BitVector > | SmartPtr |
Smart pointer to BitVector. | |
Public Member Functions | |
BitVector (const size_t size, const bool initial=false) | |
Constructor. | |
BitVector (const size_t size, byte *const bitset) | |
Constructor. | |
~BitVector () | |
Destructor. | |
BitVector * | Clone () const |
Create copy of this object. | |
void | Set () |
Set all bits to 1. | |
void | Set (const size_t pos, const bool val=true) |
Set one bit to a given value. | |
void | Reset (const bool value=false) |
Set all bits to given flag (default: clear all). | |
void | Reset (const size_t pos) |
Set one bit to 0. | |
void | Flip () |
Flip (invert) the whole bitset. | |
void | Flip (const size_t pos) |
Flip (invert) one bit. | |
bool | operator[] (const size_t pos) const |
Return a given bit. | |
const byte * | GetBitVector () const |
Get pointer to bitset data. | |
Private Attributes | |
byte * | m_BitVector |
The bitset. | |
size_t | m_Size |
The size of the allocated bitset in BYTES (!!). |
Set of binary values.
This class provides functions similar to the STL's bitset class. However, our class does not require the set size to be known at compile time. It therefore allows creation of different size bitsets as they are needed by the program.
Definition at line 54 of file cmtkBitVector.h.
Smart pointer to BitVector.
Definition at line 58 of file cmtkBitVector.h.
const byte* cmtk::BitVector::GetBitVector | ( | ) | const [inline] |
Get pointer to bitset data.
Definition at line 102 of file cmtkBitVector.h.
Referenced by cmtk::ClassStream::PutWarp().
byte* cmtk::BitVector::m_BitVector [private] |
The bitset.
Definition at line 109 of file cmtkBitVector.h.
size_t cmtk::BitVector::m_Size [private] |
The size of the allocated bitset in BYTES (!!).
Definition at line 112 of file cmtkBitVector.h.