DtBitMask represents a variable length bit-field which may be used to represent an array of boolean data.
More...
Public Member Functions |
| | DtBitMask (unsigned int length) |
| | Default Constructor.
|
| | DtBitMask (const char *bitMask, unsigned int length) |
| | Constructor from net format ( length is the un-padded field length in bits )
|
| | DtBitMask (const DtBitMask &orig) |
| | Copy Constructor.
|
| virtual | ~DtBitMask () |
| | Destructor.
|
| virtual const DtBitMask & | operator= (const DtBitMask &orig) |
| | Assignment Operator.
|
| virtual const DtBitMask & | operator&= (const DtBitMask &orig) |
| | Bitwise AND Assignment Operator (may resize mask if too small)
|
| virtual const DtBitMask & | operator|= (const DtBitMask &orig) |
| | Bitwise OR Assignment Operator (may resize mask if too small)
|
| virtual unsigned int | length () const |
| | Get number of data bits in field ( does not include padding )
|
| virtual bool | isEmpty () const |
| | Is this bitMask == 0?
|
| virtual unsigned int | numSet () const |
| | Get the number of set bits.
|
| virtual void | reset (bool value=false) |
| | Reset bit mask to empty ( all false )
|
| virtual void | setBit (unsigned int bitPosition, bool isOn=true) |
| | Set / Unset bit in bit field.
|
| virtual bool | getBit (unsigned int bitPosition) const |
| | Get bit from bit field.
|
| virtual unsigned int | netSize () const |
| | Get number of bytes used to represent padded bit field.
|
| virtual void | encode (char *buffer) const |
| | Copy the bit mask into the provided buffer ( padded bit field ) in an endian safe way ( assumes buffer has at least netSize() bytes )
|
| virtual void | decode (const char *buffer, unsigned int numBytes) |
| | Decode the buffer into this bit mask.
|
| virtual void | print (bool listHandles=false) const |
| | Print a hexadecimal string representation of the mask words If enabled, handle values (high bit positions) are listed.
|
Static Public Member Functions |
| static unsigned int | lengthToWords (unsigned int length) |
| | Convert length in bits to length in 32-bit words.
|
| static unsigned int | lengthToChars (unsigned int length) |
| | Convert length in bits to length in chars.
|
Protected Attributes |
| MAKRti::DtU32 * | myBitField |
| | Data Members.
|
| unsigned int | myLength |
| | The number of bits represented.
|
Detailed Description
DtBitMask represents a variable length bit-field which may be used to represent an array of boolean data.
The bit-field is 32-bit aligned for network representation.
Constructor & Destructor Documentation
| DtBitMask::DtBitMask |
( |
unsigned int |
length | ) |
|
| DtBitMask::DtBitMask |
( |
const char * |
bitMask, |
|
|
unsigned int |
length |
|
) |
| |
Constructor from net format ( length is the un-padded field length in bits )
| DtBitMask::DtBitMask |
( |
const DtBitMask & |
orig | ) |
|
| virtual DtBitMask::~DtBitMask |
( |
| ) |
|
|
virtual |
Member Function Documentation
| virtual void DtBitMask::decode |
( |
const char * |
buffer, |
|
|
unsigned int |
numBytes |
|
) |
| |
|
virtual |
Decode the buffer into this bit mask.
| virtual void DtBitMask::encode |
( |
char * |
buffer | ) |
const |
|
virtual |
Copy the bit mask into the provided buffer ( padded bit field ) in an endian safe way ( assumes buffer has at least netSize() bytes )
| virtual bool DtBitMask::getBit |
( |
unsigned int |
bitPosition | ) |
const |
|
virtual |
| virtual bool DtBitMask::isEmpty |
( |
| ) |
const |
|
virtual |
| unsigned int DtBitMask::length |
( |
| ) |
const |
|
inlinevirtual |
Get number of data bits in field ( does not include padding )
References myLength.
| static unsigned int DtBitMask::lengthToChars |
( |
unsigned int |
length | ) |
|
|
static |
Convert length in bits to length in chars.
| static unsigned int DtBitMask::lengthToWords |
( |
unsigned int |
length | ) |
|
|
static |
Convert length in bits to length in 32-bit words.
| virtual unsigned int DtBitMask::netSize |
( |
| ) |
const |
|
virtual |
Get number of bytes used to represent padded bit field.
| virtual unsigned int DtBitMask::numSet |
( |
| ) |
const |
|
virtual |
Get the number of set bits.
Bitwise AND Assignment Operator (may resize mask if too small)
Bitwise OR Assignment Operator (may resize mask if too small)
| virtual void DtBitMask::print |
( |
bool |
listHandles = false | ) |
const |
|
virtual |
Print a hexadecimal string representation of the mask words If enabled, handle values (high bit positions) are listed.
| virtual void DtBitMask::reset |
( |
bool |
value = false | ) |
|
|
virtual |
Reset bit mask to empty ( all false )
| virtual void DtBitMask::setBit |
( |
unsigned int |
bitPosition, |
|
|
bool |
isOn = true |
|
) |
| |
|
virtual |
Set / Unset bit in bit field.
Member Data Documentation
| MAKRti::DtU32* DtBitMask::myBitField |
|
protected |
Data Members.
The variable length bit-field
| unsigned int DtBitMask::myLength |
|
protected |
The number of bits represented.
Referenced by length().
The documentation for this class was generated from the following file: