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>
Go to the source code of this file.
Classes | |
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_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< 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... | |
Namespaces | |
namespace | libecc |
Namespace for libecc. | |
Typedefs | |
typedef unsigned long | libecc::bitset_digit_t |
Internal data type, used to store the bits of class bitset. | |
Functions | |
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 N, bool inverted> | |
bitset_invertible< N,!inverted > const & | libecc::operator~ (bitset_invertible< N, inverted > const &bits) |
Invert a bitset. | |
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. |
Fixed size bitset.
This header file declares template<unsigned int N> class libecc::bitset
for a fixed number of N bits.