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 Methods

int get_digit (void) const
bitset_digit_t get_mask (void) const

Protected Methods

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_digit
 The digit that this index points to.

bitset_digit_t M_mask
 The digit bitmask of the bit 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_digit void    const [inline]
 

Accessor for the current digit index.

bitset_digit_t libecc::bitset_index::get_mask void    const [inline]
 

Accessor for the current digit mask.

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_digit [protected]
 

The digit that this index points to.

bitset_digit_t libecc::bitset_index::M_mask [protected]
 

The digit bitmask of the bit that this index points to.

Copyright © 2002 Carlo Wood.  All rights reserved.