awUtil::BitRef Class Reference


Detailed Description

BitRef class should not be used directly.

It is just a helper class for BitField, so that we can do something like "bitfield[14] = true;"

#include <awUtilBitField.h>

List of all members.

Public Member Functions

  BitRef (BitField &, int bit)
  operator bool () const
BitRef operator= (bool)
BitRef operator= (const BitRef &)

Protected Attributes

BitField &  m_bitField
int  m_bit

Constructor & Destructor Documentation

BitRef ( BitField &  f,
int  bit 
) [inline]
  : m_bitField(f), m_bit(b)
    {}

Member Function Documentation

operator bool ( ) const [inline]
    {
        return m_bitField.testBit(m_bit);
    }
BitRef & operator= ( bool  b ) [inline]
    {
        m_bitField.setBit(m_bit, b);
        return *this;
    }
BitRef & operator= ( const BitRef r ) [inline]
    {
        return (*this = bool(r));
    }

Member Data Documentation

BitField& m_bitField [protected]

awUtil::BitRef awUtil::BitRef awUtil::BitRef awUtil::BitRef awUtil::BitRef awUtil::BitRef awUtil::BitRef awUtil::BitRef awUtil::BitRef awUtil::BitRef
awUtil::BitRef awUtil::BitRef awUtil::BitRef awUtil::BitRef awUtil::BitRef awUtil::BitRef awUtil::BitRef awUtil::BitRef awUtil::BitRef awUtil::BitRef