awUtil.BitField256 Class Reference


Detailed Description

awUtil.BitField256 acts as an array of booleans with the maximum size of 256.

Note that we do not need to export this class as it is completelly inlined. If you add non-inline methods, you will need to export it.

#include <classaw_util_1_1_bit_field256.h>

List of all members.

Public Member Functions

  __init__ ()
  The default constructor.
  __del__ ()
  __init__ (BitField256)
  Copy constructor.
BitField256  operator= (BitField256)
  Assignment operator.
int  maxAvailableBits ()
  Just a convenience, mostly for unit testing.
  resetAll ()
  Set all the bits to false.
  setAll ()
  Set all the bits to true.
BitRef256  operator[] (int)
  Index operator that returns a reference appropriate for LHS usage.
bool  operator[] (int)
  Constant version of the index operator behaving as testBit(i).
bool  operator== (BitField256)
  Equals operator needs to compare all 64-bit integers.
bool  operator!= (BitField256)
  Not-equals operator needs to compare all 64-bit integers.
BitField256  setBit (int, bool)
  Set the specified bit to the specified value.
bool  testBit (int)
  Return true if the bit is set, false otherwise.
bool  testBits (BitField256)
  Return true if the bits that are set in 'mask' are also set in this bitfield.
bool  anySet ()
  Return true if any of the bits are set to true, false otherwise.
bool  allSet ()
  Return true iff all the bits are set to true.
int  bitCount ()
  Return number of 1-bits.
BitField256  operator~ ()
  Make a copy and return it.
BitField256  operator^ (BitField256 mask)
  Return a copy that is a result of the ^= operation with the mask.
BitField256  operator& (BitField256 mask)
  Return a copy that is a result of the &= operation with the mask.
BitField256  operator| (BitField256 mask)
  Return a copy that is a result of the |= operation with the mask.
BitField256  operator^= (BitField256 mask)
  Update the bits by exclusive or-ing them with the mask bits.
BitField256  operator&= (BitField256 mask)
  Update the bits by and-ing them with the mask bits.
BitField256  operator|= (BitField256 mask)
  Update the bits by or-ing them with the mask bits.

Member Function Documentation

awUtil.BitField256.__init__ ( )

The default constructor.

All bits set to false.

awUtil.BitField256.__del__ ( )
awUtil.BitField256.__init__ ( BitField256  )

Copy constructor.

BitField256 awUtil.BitField256.operator= ( BitField256  )

Assignment operator.

int awUtil.BitField256.maxAvailableBits ( )

Just a convenience, mostly for unit testing.

The number of bits is already encoded in the name.

awUtil.BitField256.resetAll ( )

Set all the bits to false.

awUtil.BitField256.setAll ( )

Set all the bits to true.

BitRef256 awUtil.BitField256.operator[] ( int  )

Index operator that returns a reference appropriate for LHS usage.

This is why you can do "bits[8] = true;" or something like that.

bool awUtil.BitField256.operator[] ( int  )

Constant version of the index operator behaving as testBit(i).

bool awUtil.BitField256.operator== ( BitField256  )

Equals operator needs to compare all 64-bit integers.

bool awUtil.BitField256.operator!= ( BitField256  )

Not-equals operator needs to compare all 64-bit integers.

BitField256 awUtil.BitField256.setBit ( int  ,
bool   
)

Set the specified bit to the specified value.

Make sure that the bit argument is in [0,256) range or bad things happen.

bool awUtil.BitField256.testBit ( int  )

Return true if the bit is set, false otherwise.

Make sure that the argument is in [0,256) range or bad things happen.

bool awUtil.BitField256.testBits ( BitField256  )

Return true if the bits that are set in 'mask' are also set in this bitfield.

bool awUtil.BitField256.anySet ( )

Return true if any of the bits are set to true, false otherwise.

bool awUtil.BitField256.allSet ( )

Return true iff all the bits are set to true.

int awUtil.BitField256.bitCount ( )

Return number of 1-bits.

BitField256 awUtil.BitField256.operator~ ( )

Make a copy and return it.

The bits in the copy are reversed.

BitField256 awUtil.BitField256.operator^ ( BitField256  mask )

Return a copy that is a result of the ^= operation with the mask.

BitField256 awUtil.BitField256.operator& ( BitField256  mask )

Return a copy that is a result of the &= operation with the mask.

BitField256 awUtil.BitField256.operator| ( BitField256  mask )

Return a copy that is a result of the |= operation with the mask.

BitField256 awUtil.BitField256.operator^= ( BitField256  mask )

Update the bits by exclusive or-ing them with the mask bits.

BitField256 awUtil.BitField256.operator&= ( BitField256  mask )

Update the bits by and-ing them with the mask bits.

BitField256 awUtil.BitField256.operator|= ( BitField256  mask )

Update the bits by or-ing them with the mask bits.


awUtil.BitField256 awUtil.BitField256 awUtil.BitField256 awUtil.BitField256 awUtil.BitField256 awUtil.BitField256 awUtil.BitField256 awUtil.BitField256 awUtil.BitField256 awUtil.BitField256
awUtil.BitField256 awUtil.BitField256 awUtil.BitField256 awUtil.BitField256 awUtil.BitField256 awUtil.BitField256 awUtil.BitField256 awUtil.BitField256 awUtil.BitField256 awUtil.BitField256