Rogue Wave banner
Previous fileTop of DocumentContentsIndex pageNext file
Essential Tools Module Reference Guide
Rogue Wave web site:  Home Page  |  Main Documentation Page

RWTBitVec<Size>

Module:  Essential Tools Module   Group:  Traditional Collection Classes


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, two 8-bit vectors are exercised:

Program output:

Public Constructors

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

Assignment Operators

RWTBitVec<Size>&
operator=(const RWTBitVec<Size>& v);
RWTBitVec&
operator=(bool 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

bool
operator==(bool b) const;
bool
operator!=(bool b) const;
bool
operator==(const RWTBitVec& v) const;
bool
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);
bool
testBit(size_t i) const;


Previous fileTop of DocumentContentsIndex pageNext file

© Copyright Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave and SourcePro are registered trademarks of Rogue Wave Software, 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.