- A Logic Circuit Simulation Library in C++ |
#include <bus.h>
Bus::getLineAccessor
and Bus::lock
for more information on why and when to use a LineAccessor
object.
Public Member Functions | |
LineAccessor () | |
LineAccessor (Line *lineDataPtr) | |
LineAccessor (const LineAccessor &la) | |
bool | isValid () const |
Line & | operator[] (int index) |
void | operator= (int value) |
lcs::Bus< bits >::LineAccessor::LineAccessor | ( | ) | [inline] |
Default constructor. An object initialised through a default constructor is practically useless. Always use the lcs::LineAccessor object returned by the function lcs::Bus::getLineAccessor()
.
The only usefull constructor. User will never need to initialise a LineAccessor
object through the constructor. Unless very sure, let the function Bus::getLineAccessor
construct and return a lcs::LineAccessor
object for you.
lcs::Bus< bits >::LineAccessor::LineAccessor | ( | const LineAccessor & | la | ) | [inline] |
Copy constructor.
bool lcs::Bus< bits >::LineAccessor::isValid | ( | ) | const |
Returns true
if the LineAccessor
can access valid bus line data, false
if not.
void lcs::Bus< bits >::LineAccessor::operator= | ( | int | value | ) |
Makes a bitwise assignment to the lines of the bus object according to the bit representation of the integer value
. A lcs::ShortCircuitException
is thrown if modifying line states is illegal.
Overloaded operator for line access. Usage is very similar to accessing array elements from arrays of standard data types. An lcs::OutOfRangeException
is thrown if index
is beyond the bus width. A lcs::ShortCircuitException
is thrown if the line access is illegal.
index | The index into the bus bits. |