Tools.h++ Manual

104011 Tandem Computers Incorporated 22-3
22
RWBoolean operator!=(const RWTBitVec& v)
const;
Returns
TRUE
if any bit of self is not set to the same value as the corresponding
bit in
v
. Otherwise, returns
FALSE
.
void clearBit(size_t i);
Clears (i.e., sets to
FALSE
) the bit with index
i
. The index
i
must be between
0 and size–1. No bounds checking is performed. The following two lines are
equivalent, although
clearBit(size_t)
is slightly smaller and faster than
using
operator()(size_t)
:
a(i) = FALSE;
a.clearBit(i);
const RWByte* data() const;
Returns a const pointer to the raw data of self. Should be used with care.
size_t firstFalse() const;
Returns the index of the first OFF (False) bit in self. Returns
RW_NPOS
if there
is no OFF bit.
size_t firstTrue() const;
Returns the index of the first ON (True) bit in self. Returns
RW_NPOS
if there is
no ON bit.
void setBit(size_t i);
Sets (i.e., sets to
TRUE
) the bit with index
i
. The index
i
must be between 0
and size–1. No bounds checking is performed. The following two lines are
equivalent, although
setBit(size_t)
is slightly smaller and faster than
using
operator()(size_t)
:
a(i) = TRUE;
a.setBit(i);
RWBoolean testBit(size_t i) const;
Tests the bit with index
i
. The index
i
must be between 0 and size–1. No
bounds checking is performed. The following are equivalent, although
testBit(size_t)
is slightly smaller and faster than using
operator()(size_t)
:
if( a(i) ) doSomething();
if( a.testBit(i) ) doSomething()
;