#include <bitreg.h>
Public Member Functions | |
BitReg (void) | |
BitReg (const BitReg< bits > ®) | |
BitReg (const int val) | |
~BitReg () | |
bool | get (const int index) const throw (OutOfRangeException<int>) |
void | set (const int index, bool val) throw (OutOfRangeException<int>) |
void | operator= (const int rhs) |
void | operator= (const BitReg< bits > ®) |
template<unsigned int rbits> | |
void | operator= (const BitReg< rbits > ®) |
void | operator<< (const int val) |
void | operator>> (const int val) |
template<unsigned int rbits> | |
BitReg< bits+rbits > | operator, (const BitReg< rbits > ®) |
seal::BitReg< bits >::BitReg | ( | void | ) | [inline] |
Default constructor. It initialises a bit register of a size specified by the template argument. The bits of the register are all initialised to zeros.
seal::BitReg< bits >::BitReg | ( | const BitReg< bits > & | reg | ) | [inline] |
Copy constructor. It creates a new register with new data, but with the same bit contents.
seal::BitReg< bits >::BitReg | ( | const int | val | ) | [inline] |
Constructs a register with bit values initialised to the bit values of the integer argument to the constructor. Note that a BitRegister
object is laid out in the little-endian format.
seal::BitReg< bits >::~BitReg | ( | ) | [inline] |
Destructor.
bool seal::BitReg< bits >::get | ( | const int | index | ) | const throw (OutOfRangeException<int>) [inline] |
Returns true
if the bit at the specified index is 1, false
otherwise. It throws an OutOfRangeException<int>
if an out of range index is passed as an argument to the function.
index | The index of the bit whose value is returned by the function. |
void seal::BitReg< bits >::set | ( | const int | index, | |
bool | val | |||
) | throw (OutOfRangeException<int>) [inline] |
Sets the value of the bit at the specified location. It throws an OutOfRangeException<int>
if an out of range index is passed as an argument to the function.
index | The index of the bit whose value should be set. | |
val | The value to which the bit at the desired index should be set to. |
void seal::BitReg< bits >::operator= | ( | const int | rhs | ) | [inline] |
Assignment operator which makes a bit-wise assignment with an RHS integral value. The assignment happens bit-wise from bit 0. (Remember that the bit-order is little-endian with bit 0 as the LSB.)
void seal::BitReg< bits >::operator= | ( | const BitReg< bits > & | reg | ) | [inline] |
Assignment operator which makes a bit-wise assignment with an RHS register of the same size. The assignment happens bit-wise from bit 0. (Remember that the bit-order is little-endian with bit 0 as the LSB.)
void seal::BitReg< lbits >::operator= | ( | const BitReg< rbits > & | reg | ) | [inline] |
Assignment operator which makes a bit-wise assignment with an RHS register of a different size. The assignment happens bit-wise from bit 0. (Remember that the bit-order is little-endian with bit 0 as the LSB.)
void seal::BitReg< bits >::operator<< | ( | const int | val | ) | [inline] |
Left shift operator.
void seal::BitReg< bits >::operator>> | ( | const int | val | ) | [inline] |
Right shift operator.
BitReg< bits+rbits > seal::BitReg< bits >::operator, | ( | const BitReg< rbits > & | reg | ) | [inline] |