Rogue Wave banner
Previous fileTop of DocumentContentsIndex pageNext file
Essential Tools Module Reference Guide

RWTBitVec<Size>

Module:  Essential Tools Module   Group:  Traditional Collection


Does not inherit

Local Index

Members

Synopsis

#include <rw/tbitvec.h>
RWTBitVec<22>   // A 22 bit long vector

Description

RWTBitVec<Size> is a parameterized bit vector of fixed length size. Unlike class RWBitVec, its length cannot be changed at run time. The advantage of RWTBitVec is its smaller size, and one less level of indirection, resulting in a slight speed advantage.

Bits are numbered from 0 through size-1, inclusive.

The copy constructor and assignment operator use copy semantics.

Persistence

None

Example

In this example, a bit vector 24 bits long is exercised:

Public Constructors

RWTBitVec<Size>();
RWTBitVec<Size>(RWBoolean val);

Assignment Operators

RWTBitVec<Size>&
operator=(const RWTBitVec<Size>& v);
RWTBitVec&
operator=(RWBoolean val);
RWTBitVec&
operator&=(const RWTBitVec& v);
RWTBitVec&
operator^=(const RWTBitVec& v);
RWTBitVec&
operator|=(const RWTBitVec& v);
RWBitRef
operator[](size_t i);
RWBitRef
operator()(size_t i);

Bitwise Operators

RWTBitVec<N> operator&(const RWTBitVec<N>& v2) const;
RWTBitVec<N> operator^(const RWTBitVec<N>& v2) const;
RWTBitVec<N> operator|(const RWTBitVec<N>& v2) const;

Logical Operators

RWBoolean
operator==(RWBoolean b) const;
RWBoolean
operator!=(RWBoolean b) const;
RWBoolean
operator==(const RWTBitVec& v) const;
RWBoolean
operator!=(const RWTBitVec& v) const;

Public Member Functions

void
clearBit(size_t i);
const RWByte*
data() const;
size_t
firstFalse() const;
size_t
firstTrue() const;
void
setBit(size_t i);
RWBoolean
testBit(size_t i) const;


Previous fileTop of DocumentContentsIndex pageNext file

©2004 Copyright Quovadx, Inc. All Rights Reserved.
Rogue Wave and SourcePro are registered trademarks of Quovadx, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.
Contact Rogue Wave about documentation or support issues.