Public Types | Public Member Functions | Private Attributes

cmtk::BitVector Class Reference
[cmtkBase Library]

Set of binary values. More...

#include <cmtkBitVector.h>

List of all members.

Public Types

typedef SmartPointer< BitVectorSmartPtr
 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.
BitVectorClone () 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 byteGetBitVector () const
 Get pointer to bitset data.

Private Attributes

bytem_BitVector
 The bitset.
size_t m_Size
 The size of the allocated bitset in BYTES (!!).

Detailed Description

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.


Member Typedef Documentation

Smart pointer to BitVector.

Definition at line 58 of file cmtkBitVector.h.


Member Function Documentation

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().


Member Data Documentation

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.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines