Main Page Modules Namespaces C++ Classes Compound List File List Index
TNL::BitSet32 class Reference

TNL::BitSet32 Class Reference

#include <tnlBitSet.h>


Detailed Description

Represents a word of bits.

A helper class to perform operations on a set of 32 bits.


Public Member Functions

 BitSet32 ()
 Default constructor initializes this bit set to all zeros.

 BitSet32 (const BitSet32 &in_rCopy)
 Copy constructor.

 BitSet32 (const U32 in_mask)
 Construct from an input U32.

Accessors
 operator U32 () const
 Returns the U32 representation of the bit set.

U32 getMask () const
 Returns the U32 representation of the bit set.

Mutators
Most of these methods take a word (ie, a BitSet32) of bits to operate with.

void set ()
 Sets all the bits in the bit set to 1.

void set (const U32 m)
 Sets all the bits in the bit set that are set in m.

void set (BitSet32 s, bool b)
 For each bit set in s, sets or clears that bit in this, depending on whether b is true or false.

void clear ()
 Clears all the bits in the bit set to 0.

void clear (const U32 m)
 Clears all the bits in the bit set that are set in m.

void toggle (const U32 m)
 Flips all the bits in the bit set that are set in m.

bool test (const U32 m) const
 Test if the passed bits are set.

bool testStrict (const U32 m) const
 Test if the passed bits and only the passed bits are set.

BitSet32operator= (const U32 m)
BitSet32operator|= (const U32 m)
BitSet32operator &= (const U32 m)
BitSet32operator^= (const U32 m)
BitSet32 operator| (const U32 m) const
BitSet32 operator & (const U32 m) const
BitSet32 operator^ (const U32 m) const

Private Attributes

U32 mBits


Constructor & Destructor Documentation

TNL::BitSet32::BitSet32  )  [inline]
 

Default constructor initializes this bit set to all zeros.

TNL::BitSet32::BitSet32 const BitSet32 in_rCopy  )  [inline]
 

Copy constructor.

TNL::BitSet32::BitSet32 const U32  in_mask  )  [inline]
 

Construct from an input U32.


Member Function Documentation

TNL::BitSet32::operator U32  )  const [inline]
 

Returns the U32 representation of the bit set.

U32 TNL::BitSet32::getMask  )  const [inline]
 

Returns the U32 representation of the bit set.

void TNL::BitSet32::set  )  [inline]
 

Sets all the bits in the bit set to 1.

void TNL::BitSet32::set const U32  m  )  [inline]
 

Sets all the bits in the bit set that are set in m.

void TNL::BitSet32::set BitSet32  s,
bool  b
[inline]
 

For each bit set in s, sets or clears that bit in this, depending on whether b is true or false.

void TNL::BitSet32::clear  )  [inline]
 

Clears all the bits in the bit set to 0.

void TNL::BitSet32::clear const U32  m  )  [inline]
 

Clears all the bits in the bit set that are set in m.

void TNL::BitSet32::toggle const U32  m  )  [inline]
 

Flips all the bits in the bit set that are set in m.

bool TNL::BitSet32::test const U32  m  )  const [inline]
 

Test if the passed bits are set.

bool TNL::BitSet32::testStrict const U32  m  )  const [inline]
 

Test if the passed bits and only the passed bits are set.

BitSet32& TNL::BitSet32::operator= const U32  m  )  [inline]
 

BitSet32& TNL::BitSet32::operator|= const U32  m  )  [inline]
 

BitSet32& TNL::BitSet32::operator &= const U32  m  )  [inline]
 

BitSet32& TNL::BitSet32::operator^= const U32  m  )  [inline]
 

BitSet32 TNL::BitSet32::operator| const U32  m  )  const [inline]
 

BitSet32 TNL::BitSet32::operator & const U32  m  )  const [inline]
 

BitSet32 TNL::BitSet32::operator^ const U32  m  )  const [inline]
 


Field Documentation

U32 TNL::BitSet32::mBits [private]