MAK RTIspy API Documentation for HLA 1.3
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.
 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 DtBitMaskoperator= (const DtBitMask &orig)
 Assignment Operator.
virtual const DtBitMaskoperator&= (const DtBitMask &orig)
 Bitwise AND Assignment Operator (may resize mask if too small)
virtual const DtBitMaskoperator|= (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)

Default Constructor.

References lengthToWords(), myBitField, myLength, and reset().

DtBitMask::DtBitMask ( const char *  bitMask,
unsigned int  length 
)

Constructor from net format ( length is the un-padded field length in bits )

References lengthToWords(), myBitField, and myLength.

DtBitMask::DtBitMask ( const DtBitMask orig)

Copy Constructor.

References lengthToWords(), myBitField, and myLength.

DtBitMask::~DtBitMask ( )
virtual

Destructor.

References myBitField.

Member Function Documentation

void DtBitMask::decode ( const char *  buffer,
unsigned int  numBytes 
)
virtual

Decode the buffer into this bit mask.

References lengthToWords(), myBitField, myLength, and reset().

Referenced by DtRtiMtdDestinationList::get().

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 )

References lengthToWords(), myBitField, and myLength.

Referenced by DtRtiMtdDestinationList::set().

bool DtBitMask::getBit ( unsigned int  bitPosition) const
virtual

Get bit from bit field.

References myBitField, and myLength.

Referenced by DtSmartForwardingProcessor::lostConnection().

bool DtBitMask::isEmpty ( ) const
virtual
unsigned int DtBitMask::length ( ) const
inlinevirtual

Get number of data bits in field ( does not include padding )

References myLength.

Referenced by DtSmartForwardingProcessor::lostConnection(), operator&=(), operator=(), and operator|=().

unsigned int DtBitMask::lengthToChars ( unsigned int  length)
static

Convert length in bits to length in chars.

Referenced by netSize(), and DtRtiMtdDestinationList::set().

unsigned int DtBitMask::lengthToWords ( unsigned int  length)
static

Convert length in bits to length in 32-bit words.

Referenced by decode(), DtBitMask(), encode(), isEmpty(), numSet(), operator&=(), operator=(), operator|=(), print(), and reset().

unsigned int DtBitMask::netSize ( ) const
virtual

Get number of bytes used to represent padded bit field.

References lengthToChars(), and myLength.

unsigned int DtBitMask::numSet ( ) const
virtual

Get the number of set bits.

References lengthToWords(), myBitField, and myLength.

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

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

References length(), lengthToWords(), myBitField, and myLength.

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

Assignment Operator.

References length(), lengthToWords(), myBitField, and myLength.

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

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

References length(), lengthToWords(), myBitField, and myLength.

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.

References lengthToWords(), myBitField, and myLength.

Referenced by DtRoutePrinterFilter::doFilter(), DtInternalRoutePrinterFilter::doFilter(), DtRtiMsg::printHeader(), and setBit().

void DtBitMask::reset ( bool  value = false)
virtual
void DtBitMask::setBit ( unsigned int  bitPosition,
bool  isOn = true 
)
virtual

Member Data Documentation

MAKRti::DtU32* DtBitMask::myBitField
protected

Data Members.

The variable length bit-field

Referenced by decode(), DtBitMask(), encode(), getBit(), isEmpty(), numSet(), operator&=(), operator=(), operator|=(), print(), reset(), setBit(), and ~DtBitMask().

unsigned int DtBitMask::myLength
protected

The documentation for this class was generated from the following files:

Document ID: Generated on Fri Mar 14 19:08:55 EDT 2014 from SVN revision 137085
Copyright © 2005-2014 VT MÄK Inc. All Rights Reserved (www.mak.com)