Main Page   Reference Manual   Compound List   File List  

libecc Namespace Reference

Namespace for libecc. More...


Compounds

struct  assign
 Operation used with libecc::bitset::shift_op. More...

class  bitset
 A bitset with a fixed number of bits. More...

struct  bitset_base
 Base class of libecc::bitset. More...

class  bitset_invertible
 A bitset with a fixed number of bits, having possibly an infinite number of leading virtual 1's. More...

struct  exor
 Operation used with libecc::bitset::shift_op. More...

struct  left
 Shift direction used with libecc::bitset::shift_op. More...

struct  right
 Shift direction used with libecc::bitset::shift_op. More...

class  rng
 Pseudo Random Number Generator. More...

class  sha1
 SHA-1. More...


Typedefs

typedef unsigned int 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 & 
operator~ (bitset_invertible< n, inverted > const &bits)
 Invert a bitset.

template<unsigned int n1, bool inverted1, unsigned int n2, bool inverted2> bool operator== (bitset_invertible< n1, inverted1 > const &bits1, bitset_invertible< n2, inverted2 > const &bits2)
 Equivalence operator.

template<typename Expression1, typename Expression2> bool operator!= (Expression1 const &expr1, Expression2 const &expr2)
 Unequivalence operator.

template<unsigned int m, bool inverted1, bool inverted2> Operator::expression< m, inverted1,
inverted2, Operator::bitsetAND > 
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::expression< m, inverted1,
inverted2, Operator::bitsetOR > 
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::expression< m, inverted1,
inverted2, Operator::bitsetXOR > 
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 & operator>> (std::istream &is, bitset< n > &bitsetx)
 Read bitset from istream.

template<unsigned int n> std::ostream & operator<< (std::ostream &os, bitset< n > const &bits)
 Write bitset to ostream.


Detailed Description

Namespace for libecc.


Typedef Documentation

unsigned int libecc::bitset_digit_t
 

Internal data type, used to store the bits of class bitset.

The number of bits in the builtin-type int will be equal to the size of the cpu's databus. The internal type used to store the bits of a bitset is therefore an unsigned int resulting in the most efficient code for bit manipulation.


Function Documentation

template<unsigned int m, bool inverted1, bool inverted2>
Operator::expression<m, inverted1, inverted2, Operator::bitsetAND> operator & bitset_invertible< m, inverted1 > const &    arg1,
bitset_invertible< m, inverted2 > const &    arg2
 

Assignment operator with bitwise AND for expressions.

See also:
bitset::operator=

template<typename Expression1, typename Expression2>
bool operator!= Expression1 const &    expr1,
Expression2 const &    expr2
[inline]
 

Unequivalence operator.

Returns :
!(expr1 == expr2)

template<unsigned int n>
std::ostream& operator<< std::ostream &    os,
bitset< n > const &    bits
 

Write bitset to ostream.

template<unsigned int n1, bool inverted1, unsigned int n2, bool inverted2>
bool operator== bitset_invertible< n1, inverted1 > const &    bits1,
bitset_invertible< n2, inverted2 > const &    bits2
 

Equivalence operator.

This operator can only compare bitsets and inverted bitsets with eachother.

For example:

 if (x == ~y) ...

template<unsigned int n>
std::istream& operator>> std::istream &    is,
bitset< n > &    bitsetx
 

Read bitset from istream.

template<unsigned int m, bool inverted1, bool inverted2>
Operator::expression<m, inverted1, inverted2, Operator::bitsetXOR> operator^ bitset_invertible< m, inverted1 > const &    arg1,
bitset_invertible< m, inverted2 > const &    arg2
 

Assignment operator with bitwise XOR for expressions.

See also:
bitset::operator=

template<unsigned int m, bool inverted1, bool inverted2>
Operator::expression<m, inverted1, inverted2, Operator::bitsetOR> operator| bitset_invertible< m, inverted1 > const &    arg1,
bitset_invertible< m, inverted2 > const &    arg2
 

Assignment operator with bitwise OR for expressions.

See also:
bitset::operator=

template<unsigned int n, bool inverted>
bitset_invertible<n, !inverted> const& operator~ bitset_invertible< n, inverted > const &    bits [inline]
 

Invert a bitset.

This operator is just a cast and doesn't actually do anything until you assign the expression that it is part of to another bitset.

For example:

 x = ~y;
 x ^= ~y & ~z;

Both cases will run over the digits of bitset x just once and apply the given formula (and any like it) directly on the digits of the bitsets involved.

Inversion can also be used together with the equivalence operators. For example:

 if (x == ~y) ...

will only run once over the digits of both bitset and compare the digits once by one using x.digit(d) == ~y.digit(d).

Copyright © 2002 Carlo Wood.  All rights reserved.