lcs::Line Class Reference

#include <line.h>

List of all members.


Detailed Description

A class to encapsulate a data line. A 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 Lineoperator= (const Line &line)
void drive (Module *mod)
void unDrive (Module *mod)
void lock (Module *mod)
void unLock (Module *mod)

Friends

class Bus
class InputBus


Constructor & Destructor Documentation

lcs::Line::Line ( void   )  [private]

Default constructor.

lcs::Line::Line ( const Line line  )  [private]

Copy constructor.

virtual lcs::Line::~Line (  )  [private, virtual]

Destructor.


Member Function Documentation

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.

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

Parameters:
mod Pointer to the lcs::Module object with which the line should be locked.

Bus<1> lcs::Line::makeBus ( void   ) 

Returns a single line lcs::Bus object encapsulating the line.

const LineState lcs::Line::operator & ( const Line line  )  const [inline]

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.

Parameters:
state The LineState variable with which the comparison should be made.

const LineState lcs::Line::operator() ( void   )  const [inline]

Returns the line state.

const Line& lcs::Line::operator= ( const Line line  )  [private]

Overloaded assignment operator. The LHS Line object and the RHS Line object will both share the same line data after assignment.

void lcs::Line::operator= ( const LineState value  ) 

Overloaded assignment operator which sets the line state using a LineState variable.

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

Parameters:
state The LineState variable with which the comparison should be made.

const LineState lcs::Line::operator^ ( const Line line  )  const [inline]

Overloaded bit 'xor' operator. Performs a 'xor' operation of the line states of two Line objects.

const LineState lcs::Line::operator| ( const Line line  )  const [inline]

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.

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

Parameters:
mod Pointer to the lcs::Module object from which the line should be unlocked.


Friends And Related Function Documentation

friend class Bus [friend]

lcs::Bus classes of all sizes are friends of this class.

friend class InputBus [friend]

lcs::InputBus classes of all sizes are friends of this class.


Generated on Sat Oct 14 11:23:40 2006 for libLCS by  doxygen 1.4.7