awUtil.BitField32 Class Reference


Detailed Description

awUtil.BitField32 acts as an array of booleans with the maximum size of 32.

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

List of all members.

Public Member Functions

  __init__ ()
  The default constructor.
  __init__ (unsigned int)
  Create with the bits as in the given integer.
  __del__ ()
  __init__ (BitField32)
  Copy constructor.
BitField32  operator= (BitField32)
  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.
BitRef32  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== (BitField32)
  Equals operator needs to compare the integers.
bool  operator!= (BitField32)
  Not-equals operator needs to compare the integers.
BitField32  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.
BitField32  operator~ ()
  Make a copy and return it.
BitField32  operator^ (BitField32 mask)
  Return a copy that is a result of the ^ operation on the bits.
BitField32  operator& (BitField32 mask)
  Return a copy that is a result of the & operation on the bits.
BitField32  operator| (BitField32 mask)
  Return a copy that is a result of the | operation on the bits.
BitField32  operator^= (BitField32 mask)
  Update the bits by exclusive or-ing them with the mask bits.
BitField32  operator&= (BitField32 mask)
  Update the bits by and-ing them with the mask bits.
BitField32  operator|= (BitField32 mask)
  Update the bits by or-ing them with the mask bits.

Member Function Documentation

awUtil.BitField32.__init__ ( )

The default constructor.

All bits set to false.

awUtil.BitField32.__init__ ( unsigned  int )

Create with the bits as in the given integer.

awUtil.BitField32.__del__ ( )
awUtil.BitField32.__init__ ( BitField32  )

Copy constructor.

BitField32 awUtil.BitField32.operator= ( BitField32  )

Assignment operator.

int awUtil.BitField32.maxAvailableBits ( )

Just a convenience, mostly for unit testing.

The number of bits is already encoded in the name.

awUtil.BitField32.resetAll ( )

Set all the bits to false.

awUtil.BitField32.setAll ( )

Set all the bits to true.

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

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

bool awUtil.BitField32.operator== ( BitField32  )

Equals operator needs to compare the integers.

bool awUtil.BitField32.operator!= ( BitField32  )

Not-equals operator needs to compare the integers.

BitField32 awUtil.BitField32.setBit ( int  ,
bool   
)

Set the specified bit to the specified value.

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

bool awUtil.BitField32.testBit ( int  )

Return true if the bit is set, false otherwise.

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

bool awUtil.BitField32.anySet ( )

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

bool awUtil.BitField32.allSet ( )

Return true iff all the bits are set to true.

BitField32 awUtil.BitField32.operator~ ( )

Make a copy and return it.

The bits in the copy are reversed.

BitField32 awUtil.BitField32.operator^ ( BitField32  mask )

Return a copy that is a result of the ^ operation on the bits.

BitField32 awUtil.BitField32.operator& ( BitField32  mask )

Return a copy that is a result of the & operation on the bits.

BitField32 awUtil.BitField32.operator| ( BitField32  mask )

Return a copy that is a result of the | operation on the bits.

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

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

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

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

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

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


awUtil.BitField32 awUtil.BitField32 awUtil.BitField32 awUtil.BitField32 awUtil.BitField32 awUtil.BitField32 awUtil.BitField32 awUtil.BitField32 awUtil.BitField32 awUtil.BitField32
awUtil.BitField32 awUtil.BitField32 awUtil.BitField32 awUtil.BitField32 awUtil.BitField32 awUtil.BitField32 awUtil.BitField32 awUtil.BitField32 awUtil.BitField32 awUtil.BitField32