Main Page   Reference Manual   Compound List   File List  

libecc::bitset_index Class Reference

A bitset index. More...

#include <libecc/bitset.h>

Inheritance diagram for libecc::bitset_index:

Inheritance graph
[legend]
List of all members.

Public Member Functions

int get_index (void) const

Protected Member Functions

void left (void)
 Move one bit left in the bitset.

void right (void)
 Move one bit right in the bitset.

void left (int n)
 Move n bits left in the bitset.

void right (int n)
 Move n bits right in the bitset.

 bitset_index (void)
 Construct an uninitialized bitset index.

 bitset_index (bitset_index const &index)
 Copy constructor.

 bitset_index (int bit)
 Construct a bitset index that points to bit number bit.


Protected Attributes

int M_index
 The bit number that this index points to.


Friends

bool operator== (bitset_index const &i1, bitset_index const &i2)
 Equality operator.

bool operator!= (bitset_index const &i1, bitset_index const &i2)
 Inequality operator.


Detailed Description

A bitset index.

This class represents a bit index, the distance between the bit refered to and the least significant bit. It does not specify which bitset instance or even the size of the bitset.  The index can contain positive and negative values, an offset of -1 represents the singular 'rend()' const_reverse_iterator.  Using an index that is too large or too small for the bitset that it is being used with will leads to undefined behaviour.


Constructor & Destructor Documentation

libecc::bitset_index::bitset_index void   )  [inline, protected]
 

Construct an uninitialized bitset index.

libecc::bitset_index::bitset_index bitset_index const &  index  )  [inline, protected]
 

Copy constructor.

libecc::bitset_index::bitset_index int  bit  )  [inline, protected]
 

Construct a bitset index that points to bit number bit.

bit may be -1 (one before the start) which is equivalent with rend() or --begin() .


Member Function Documentation

int libecc::bitset_index::get_index void   )  const [inline]
 

Accessor for the current bit index.

void libecc::bitset_index::left int  n  )  [inline, protected]
 

Move n bits left in the bitset.

void libecc::bitset_index::left void   )  [inline, protected]
 

Move one bit left in the bitset.

void libecc::bitset_index::right int  n  )  [inline, protected]
 

Move n bits right in the bitset.

void libecc::bitset_index::right void   )  [inline, protected]
 

Move one bit right in the bitset.


Friends And Related Function Documentation

bool operator!= bitset_index const &  i1,
bitset_index const &  i2
[friend]
 

Inequality operator.

bool operator== bitset_index const &  i1,
bitset_index const &  i2
[friend]
 

Equality operator.


Member Data Documentation

int libecc::bitset_index::M_index [protected]
 

The bit number that this index points to.

Copyright © 2002-2004 Carlo Wood.  All rights reserved.