- A Logic Circuit Simulation Library in C++ |
#include <bitbuff.h>
Inheritance diagram for lcs::BitBuff< bits >:
lcs::Bit
objects. Objects of this class should typically be used as temporary/intermediate data storage buffers.
Public Member Functions | |
BitBuff (void) | |
BitBuff (const BitBuff< bits > ®) | |
virtual | ~BitBuff () |
template<int w> | |
const BitBuff< w > | partSelect (int s) |
void | notify (Module *mod, int bit=-1) |
void | stopNotification (Module *mod, int bit=-1) |
int | width (void) |
unsigned long | toInt (void) const |
std::string | toStr (void) const |
template<int rbits> | |
BitBuff< bits > & | operator= (const BitBuff< rbits > &rhs) |
template<int w, ExprType Type, typename LExprType, typename RExprType> | |
BitBuff< bits > & | operator= (const Expression< w, Type, LExprType, RExprType > &expr) |
template<int rbits> | |
BitBuff< bits > & | operator= (const InputBus< rbits > &rhs) |
const Expression< 1, BITBUFF_EXPR, void, void > | operator[] (int index) const throw (OutOfRangeException<int>) |
Expression< 1, BITBUFF_EXPR, void, void > | operator[] (int index) throw (OutOfRangeException<int>) |
lcs::BitBuff< bits >::BitBuff | ( | void | ) |
Default constructor.
lcs::BitBuff< bits >::BitBuff | ( | const BitBuff< bits > & | reg | ) |
Copy constructor.
lcs::BitBuff< bits >::~BitBuff | ( | ) | [virtual] |
Destructor.
void lcs::BitBuff< bits >::notify | ( | Module * | mod, | |
int | bit = -1 | |||
) |
Registers the module which has to be notified about a bit state change.
mod | Pointer to the module object which seeks to be notified about a bit state change. | |
bit | The index of the bit whose state change should be notified to the module. |
BitBuff< bits > & lcs::BitBuff< bits >::operator= | ( | const InputBus< rbits > & | rhs | ) |
Assignment operator to facilitate assignment using a lcs::InputBus
object.
BitBuff< bits > & lcs::BitBuff< bits >::operator= | ( | const Expression< w, Type, LExprType, RExprType > & | expr | ) |
Assignment operator to facilitate assignment using an lcs::Expression
object. ie., the operator facilitates assignment with an expression of bitwise operations on the right hand side of the assignment operator.
BitBuff< bits > & lcs::BitBuff< bits >::operator= | ( | const BitBuff< rbits > & | rhs | ) |
Assignment operator.
Expression< 1, BITBUFF_EXPR, void, void > lcs::BitBuff< bits >::operator[] | ( | int | index | ) | throw (OutOfRangeException<int>) |
Returns a the suitable expression object when a bitselect is requested. An expression object is returned so that a bitselect can be used in a normal expression of bitwise operations.
const Expression< 1, BITBUFF_EXPR, void, void > lcs::BitBuff< bits >::operator[] | ( | int | index | ) | const throw (OutOfRangeException<int>) |
Returns a the suitable constant expression object when a bitselect is requested. An expression object is returned so that a bitselect can be used in a normal expression of bitwise operations.
Returns a part-buffer formed from a set of consecutive bits of the original BitBuffer
object. If s+w
goes beyond the range of the original bus width, then, only the bits within range are assigned to the bits of the new bus object.
w | The width of the part-buffer. | |
s | The start bit from where the part-buffer should be accumulated. |
void lcs::BitBuff< bits >::stopNotification | ( | Module * | mod, | |
int | bit = -1 | |||
) |
De-registers a module from the list of modules which have to be notified of bit state changes.
mod | Pointer to the module object which seeks to de-register. | |
bit | The index of the bit whose state change was being notified to the module. |
unsigned long lcs::BitBuff< bits >::toInt | ( | void | ) | const |
Converts the binary bit value in the buffer to a decimal integer.
std::string lcs::BitBuff< bits >::toStr | ( | void | ) | const |
Converts the binary bit value in the buffer to a string representation.
int lcs::BitBuff< bits >::width | ( | void | ) | [inline] |
Returns the width of the buffer.