Xavax C++ Library Class Index   FAQ   Overview

Class xavax::Bit

Bit is a reference to a bit in a Bitmap.

Constructor Summary
Bit(Bitmap& bitmap, size_t n)
         Construct a reference to a bit in a Bitmap.

Operator Summary
Bit& operator=(Bit& rhs)
         Set the value of a bit.
Bit& operator=(bool rhs)
         Set the value of a bit.
bool operator bool()
         Return the value of a bit.

Method Summary
size_t position() const
         Return the position of this bit in the bitmap.

Related Classes
Bitmap

Constructor Detail

Bit

Bit(Bitmap& bitmap, size_t n)
Construct a reference to bit n in bitmap b.
Parameters:
b - a bitmap.
n - the bit position.

Operator Detail

operator=

Bit& operator=(Bit& rhs)
Set the value of the bit referenced by this object to the value of the bit referenced by rhs.
Parameters:
rhs - the right operand.
Returns:
a reference to a bit.

operator=

Bit& operator=(bool rhs)
Set the value of the bit referenced by this object to rhs.
Parameters:
rhs - the right operand.
Returns:
a reference to a bit.

operator bool

operator bool()
Return the value of the bit referenced by this object.
Returns:
the value of the referenced bit.

Method Detail

position

size_t position() const
Return the position of this bit in the bitmap.
Returns:
the position of this bit in the bitmap.

Example Code

See the Bitmap class for examples.

Copyright © 2003 Xavax Inc. -- All Rights Reserved