Main Page   Reference Manual   Compound List   File List  

libecc/bitset.h File Reference

Fixed size bitset. More...

#include <libecc/config.h>
#include <iosfwd>
#include <cstddef>
#include <cstring>
#include <string>
#include <inttypes.h>
#include <cassert>
#include <endian.h>
#include "debug.h"
#include <libcwd/cwprint.h>
#include <set>

Include dependency graph for bitset.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.


Namespaces

namespace  libecc

Classes

class  libecc::bitset_base< n >
 Base class of libecc::bitset. More...
class  libecc::bitset_invertible< n, inverted >
 A bitset with a fixed number of bits, having possibly an infinite number of leading virtual 1's. More...
class  libecc::bitset_index
 A bitset index. More...
class  libecc::bitset_index_iterator< DIRECTION >
 A bitset index with increment/decrement methods. More...
class  libecc::bitset_iterator< n, DIRECTION >
 A non-mutable bitset-iterator. More...
class  libecc::bitset< n >
 A bitset with a fixed number of bits. More...
struct  libecc::assign
 Operation used with libecc::bitset::shift_op. More...
struct  libecc::exor
 Operation used with libecc::bitset::shift_op. More...
struct  libecc::left
 Shift direction used with libecc::bitset::shift_op. More...
struct  libecc::right
 Shift direction used with libecc::bitset::shift_op. More...

Typedefs

typedef unsigned long libecc::bitset_digit_t
 Internal data type, used to store the bits of class bitset.

Functions

template<unsigned int n, bool inverted>
bitset_invertible< n,!inverted >
const & 
libecc::operator~ (bitset_invertible< n, inverted > const &bits)
 Invert a bitset.
bool libecc::operator== (bitset_index const &i1, bitset_index const &i2)
 Equality operator.
bool libecc::operator!= (bitset_index const &i1, bitset_index const &i2)
 Inequality operator.
template<int DIRECTION>
bool libecc::operator< (bitset_index_iterator< DIRECTION > const &i1, bitset_index_iterator< DIRECTION > const &i2)
 Less.
template<int DIRECTION>
bool libecc::operator> (bitset_index_iterator< DIRECTION > const &i1, bitset_index_iterator< DIRECTION > const &i2)
 Greater.
template<int DIRECTION>
bool libecc::operator<= (bitset_index_iterator< DIRECTION > const &i1, bitset_index_iterator< DIRECTION > const &i2)
 Less or equal.
template<int DIRECTION>
bool libecc::operator>= (bitset_index_iterator< DIRECTION > const &i1, bitset_index_iterator< DIRECTION > const &i2)
 Greater or equal.
template<unsigned int n, int DIRECTION>
bitset_iterator< n, DIRECTION > libecc::operator+ (bitset_iterator< n, DIRECTION > const &i, int d)
 Iterator addition.
template<unsigned int n, int DIRECTION>
bitset_iterator< n, DIRECTION > libecc::operator+ (int d, bitset_iterator< n, DIRECTION > const &i)
 Iterator addition.
template<unsigned int n, int DIRECTION>
bitset_iterator< n, DIRECTION > libecc::operator- (bitset_iterator< n, DIRECTION > const &i, int d)
 Iterator subtraction.
template<unsigned int n, int DIRECTION>
bitset_iterator< n, DIRECTION > libecc::operator- (int d, bitset_iterator< n, DIRECTION > const &i)
 Iterator subtraction.
template<unsigned int n1, bool inverted1, unsigned int n2, bool inverted2>
bool libecc::operator== (bitset_invertible< n1, inverted1 > const &bits1, bitset_invertible< n2, inverted2 > const &bits2)
 Equivalence operator.
template<unsigned int n1, bool inverted1, unsigned int n2, bool inverted2>
bool libecc::operator!= (bitset_invertible< n1, inverted1 > const &bits1, bitset_invertible< n2, inverted2 > const &bits2)
 Unequivalence operator.
template<unsigned int m, bool inverted1, bool inverted2>
Operator::bitsetExpression< m,
inverted1, inverted2,
Operator::bitsetAND > 
libecc::operator & (bitset_invertible< m, inverted1 > const &arg1, bitset_invertible< m, inverted2 > const &arg2)
 Assignment operator with bitwise AND for expressions.
template<unsigned int m, bool inverted1, bool inverted2>
Operator::bitsetExpression< m,
inverted1, inverted2,
Operator::bitsetOR > 
libecc::operator| (bitset_invertible< m, inverted1 > const &arg1, bitset_invertible< m, inverted2 > const &arg2)
 Assignment operator with bitwise OR for expressions.
template<unsigned int m, bool inverted1, bool inverted2>
Operator::bitsetExpression< m,
inverted1, inverted2,
Operator::bitsetXOR > 
libecc::operator^ (bitset_invertible< m, inverted1 > const &arg1, bitset_invertible< m, inverted2 > const &arg2)
 Assignment operator with bitwise XOR for expressions.
template<unsigned int n>
std::istream & libecc::operator>> (std::istream &is, bitset< n > &bitsetx)
 Read bitset from istream.
template<unsigned int n>
std::ostream & libecc::operator<< (std::ostream &os, bitset< n > const &bits)
 Write bitset to ostream.

Detailed Description

Fixed size bitset.

This header file declares template<unsigned int n> class libecc::bitset for a fixed number of n bits.

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