MAK RTIspy API Documentation for HLA Evolved
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Static Public Member Functions | Protected Attributes
DtBitMask Class Reference

DtBitMask represents a variable length bit-field which may be used to represent an array of boolean data. More...

+ Collaboration diagram for DtBitMask:

Public Member Functions

 DtBitMask (unsigned int length)
 Default Constructor. More...
 
 DtBitMask (const char *bitMask, unsigned int length)
 Constructor from net format ( length is the un-padded field length in bits ) More...
 
 DtBitMask (const DtBitMask &orig)
 Copy Constructor. More...
 
virtual ~DtBitMask ()
 Destructor. More...
 
virtual const DtBitMaskoperator= (const DtBitMask &orig)
 Assignment Operator. More...
 
virtual const DtBitMaskoperator&= (const DtBitMask &orig)
 Bitwise AND Assignment Operator (may resize mask if too small) More...
 
virtual const DtBitMaskoperator|= (const DtBitMask &orig)
 Bitwise OR Assignment Operator (may resize mask if too small) More...
 
virtual unsigned int length () const
 Get number of data bits in field ( does not include padding ) More...
 
virtual bool isEmpty () const
 Is this bitMask == 0? More...
 
virtual unsigned int numSet () const
 Get the number of set bits. More...
 
virtual void reset (bool value=false)
 Reset bit mask to empty ( all false ) More...
 
virtual void setBit (unsigned int bitPosition, bool isOn=true)
 Set / Unset bit in bit field. More...
 
virtual bool getBit (unsigned int bitPosition) const
 Get bit from bit field. More...
 
virtual unsigned int netSize () const
 Get number of bytes used to represent padded bit field. More...
 
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 ) More...
 
virtual void decode (const char *buffer, unsigned int numBytes)
 Decode the buffer into this bit mask. More...
 
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. More...
 

Static Public Member Functions

static unsigned int lengthToWords (unsigned int length)
 Convert length in bits to length in 32-bit words. More...
 
static unsigned int lengthToChars (unsigned int length)
 Convert length in bits to length in chars. More...
 

Protected Attributes

MAKRti::DtU32 * myBitField
 Data Members. More...
 
unsigned int myLength
 The number of bits represented. More...
 

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)

Default Constructor.

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)

Copy Constructor.

virtual DtBitMask::~DtBitMask ( )
virtual

Destructor.

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

Get bit from bit field.

virtual bool DtBitMask::isEmpty ( ) const
virtual

Is this bitMask == 0?

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.

virtual const DtBitMask& DtBitMask::operator&= ( const DtBitMask orig)
virtual

Bitwise AND Assignment Operator (may resize mask if too small)

virtual const DtBitMask& DtBitMask::operator= ( const DtBitMask orig)
virtual

Assignment Operator.

virtual const DtBitMask& DtBitMask::operator|= ( const DtBitMask orig)
virtual

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:

Document ID: Generated on Sun Jul 20 16:15:30 EDT 2025 from SVN revision 277985
Copyright © 2005-2025 MAK Technologies Inc. All Rights Reserved (www.mak.com)