#include <line.h>
Line
object is used to denote one bit of a lcs::Bus object. Various operators are supported to facilitate bit operations.
Public Member Functions | |
bool | isLocked (void) |
Bus< 1 > | makeBus (void) |
void | operator= (const LineState &value) |
const LineState | operator() (void) const |
const LineState | operator| (const Line &line) const |
const LineState | operator & (const Line &line) const |
const LineState | operator^ (const Line &line) const |
bool | operator== (const LineState &state) const |
bool | operator!= (const LineState &state) const |
Private Member Functions | |
Line (void) | |
Line (const Line &line) | |
virtual | ~Line () |
const Line & | operator= (const Line &line) |
void | drive (Module *mod) |
void | unDrive (Module *mod) |
void | lock (Module *mod) |
void | unLock (Module *mod) |
Friends | |
class | Bus |
class | InputBus |
lcs::Line::Line | ( | void | ) | [private] |
Default constructor.
lcs::Line::Line | ( | const Line & | line | ) | [private] |
Copy constructor.
virtual lcs::Line::~Line | ( | ) | [private, virtual] |
Destructor.
void lcs::Line::drive | ( | Module * | mod | ) | [private] |
A lcs::Module (or its derivative) should register to be driven by the line using this function. If registered, a change in the line state will call the function lcs::Module::propogate.
mod | Pointer to the lcs::Module object which has to be driven by the line. |
bool lcs::Line::isLocked | ( | void | ) |
Returns true
if the line is locked, else returns false
.
void lcs::Line::lock | ( | Module * | mod | ) | [private] |
Locks the line with a module.
mod | Pointer to the lcs::Module object with which the line should be locked. |
Overloaded bit 'and' operator. Performs a 'and' operation of the line states of two Line objects.
bool lcs::Line::operator!= | ( | const LineState & | state | ) | const [inline] |
Overloaded logical inequality operator. Compares the line state with a LineState variable.
state | The LineState variable with which the comparison should be made. |
const LineState lcs::Line::operator() | ( | void | ) | const [inline] |
Returns the line state.
void lcs::Line::operator= | ( | const LineState & | value | ) |
Overloaded assignment operator which sets the line state using a LineState variable.
value | The value to which the line state should be changed. |
bool lcs::Line::operator== | ( | const LineState & | state | ) | const [inline] |
Overloaded logical equality operator. Compares the line state with a LineState variable.
state | The LineState variable with which the comparison should be made. |
Overloaded bit 'xor' operator. Performs a 'xor' operation of the line states of two Line objects.
Overloaded bit 'or' operator. Performs a 'or' operation of the line states of two Line objects.
void lcs::Line::unDrive | ( | Module * | mod | ) | [private] |
A lcs::Module (or its derivative) can de-register itself from being driven by the line using this function. See Line::drive for more information.
mod | Pointer to the lcs::Module object which should be de-registered from being driven by the line. |
void lcs::Line::unLock | ( | Module * | mod | ) | [private] |
Unlocks the line from the lcs::Module
object pointed to by the passed pointer.
mod | Pointer to the lcs::Module object from which the line should be unlocked. |
friend class InputBus [friend] |
lcs::InputBus classes of all sizes are friends of this class.