seal::BitReg< bits > Class Template Reference

#include <bitreg.h>

List of all members.

Public Member Functions

 BitReg (void)
 BitReg (const BitReg< bits > &reg)
 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 > &reg)
template<unsigned int rbits>
void operator= (const BitReg< rbits > &reg)
void operator<< (const int val)
void operator>> (const int val)
template<unsigned int rbits>
BitReg< bits+rbits > operator, (const BitReg< rbits > &reg)


Detailed Description

template<unsigned int bits>
class seal::BitReg< bits >

This is a utility template class which encapsulates a hardware like register of bits. The number of bits in the register is specified as the template argument. The bits of the register are laid out in a little-endian format.

Constructor & Destructor Documentation

template<unsigned int bits>
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.

template<unsigned int bits>
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.

template<unsigned int bits>
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.

template<unsigned int bits>
seal::BitReg< bits >::~BitReg (  )  [inline]

Destructor.


Member Function Documentation

template<unsigned int bits>
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.

Parameters:
index The index of the bit whose value is returned by the function.

template<unsigned int bits>
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.

Parameters:
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.

template<unsigned int bits>
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.)

template<unsigned int bits>
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.)

template<unsigned int lbits>
template<unsigned int rbits>
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.)

template<unsigned int bits>
void seal::BitReg< bits >::operator<< ( const int  val  )  [inline]

Left shift operator.

template<unsigned int bits>
void seal::BitReg< bits >::operator>> ( const int  val  )  [inline]

Right shift operator.

template<unsigned int bits>
template<unsigned int rbits>
BitReg< bits+rbits > seal::BitReg< bits >::operator, ( const BitReg< rbits > &  reg  )  [inline]

Concatenation operator. Using this operator, one can concatenate two BitReg objects to create another BitReg object.


The documentation for this class was generated from the following file:

Generated on Sat May 16 21:35:20 2009 for SEAL by  doxygen 1.5.5