awUtil.BitField128 Class Reference


Detailed Description

awUtil.BitField128 acts as an array of booleans with the maximum size of 128.

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_field128.h>

List of all members.

Public Member Functions

  __init__ ()
  The default constructor.
  __del__ ()
  __init__ (BitField128)
  Copy constructor.
BitField128  operator= (BitField128)
  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.
BitRef128  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== (BitField128)
  Equals operator needs to compare both 64-bit integers.
bool  operator!= (BitField128)
  Not-equals operator needs to compare both 64-bit integers.
BitField128  setBit (int, bool)
  Set the specified bit to the specified value.
bool  testBit (int)
  Return true if the bit is set, false otherwise.
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.
BitField128  operator~ ()
  Make a copy and return it.
BitField128  operator^ (BitField128 mask)
  Return a copy that is a result of the ^= operation with the mask.
BitField128  operator& (BitField128 mask)
  Return a copy that is a result of the &= operation with the mask.
BitField128  operator| (BitField128 mask)
  Return a copy that is a result of the |= operation with the mask.
BitField128  operator^= (BitField128 mask)
  Update the bits by exclusive or-ing them with the mask bits.
BitField128  operator&= (BitField128 mask)
  Update the bits by and-ing them with the mask bits.
BitField128  operator|= (BitField128 mask)
  Update the bits by or-ing them with the mask bits.

Member Function Documentation

awUtil.BitField128.__init__ ( )

The default constructor.

All bits set to false.

awUtil.BitField128.__del__ ( )
awUtil.BitField128.__init__ ( BitField128  )

Copy constructor.

BitField128 awUtil.BitField128.operator= ( BitField128  )

Assignment operator.

int awUtil.BitField128.maxAvailableBits ( )

Just a convenience, mostly for unit testing.

The number of bits is already encoded in the name.

awUtil.BitField128.resetAll ( )

Set all the bits to false.

awUtil.BitField128.setAll ( )

Set all the bits to true.

BitRef128 awUtil.BitField128.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.BitField128.operator[] ( int  )

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

bool awUtil.BitField128.operator== ( BitField128  )

Equals operator needs to compare both 64-bit integers.

bool awUtil.BitField128.operator!= ( BitField128  )

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

BitField128 awUtil.BitField128.setBit ( int  ,
bool   
)

Set the specified bit to the specified value.

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

bool awUtil.BitField128.testBit ( int  )

Return true if the bit is set, false otherwise.

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

bool awUtil.BitField128.anySet ( )

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

bool awUtil.BitField128.allSet ( )

Return true iff all the bits are set to true.

BitField128 awUtil.BitField128.operator~ ( )

Make a copy and return it.

The bits in the copy are reversed.

BitField128 awUtil.BitField128.operator^ ( BitField128  mask )

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

BitField128 awUtil.BitField128.operator& ( BitField128  mask )

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

BitField128 awUtil.BitField128.operator| ( BitField128  mask )

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

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

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

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

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

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

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


awUtil.BitField128 awUtil.BitField128 awUtil.BitField128 awUtil.BitField128 awUtil.BitField128 awUtil.BitField128 awUtil.BitField128 awUtil.BitField128 awUtil.BitField128 awUtil.BitField128
awUtil.BitField128 awUtil.BitField128 awUtil.BitField128 awUtil.BitField128 awUtil.BitField128 awUtil.BitField128 awUtil.BitField128 awUtil.BitField128 awUtil.BitField128 awUtil.BitField128