- A Logic Circuit Simulation Library in C++





lcs::Bus< bits >::LineAccessor Class Reference

#include <bus.h>

List of all members.


Detailed Description

template<int bits = 1>
class lcs::Bus< bits >::LineAccessor

This is an inner class to privde a bus write-access control mechanism. This class provides a mechanism to write line data on to a bus. See 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
Lineoperator[] (int index)
void operator= (int value)


Constructor & Destructor Documentation

template<int bits = 1>
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().

template<int bits = 1>
lcs::Bus< bits >::LineAccessor::LineAccessor ( Line lineDataPtr  )  [inline]

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.

Parameters:
lineDataPtr Pointer to the array of lcs::Line objects which constitute a Bus object.

template<int bits = 1>
lcs::Bus< bits >::LineAccessor::LineAccessor ( const LineAccessor la  )  [inline]

Copy constructor.


Member Function Documentation

template<int bits>
bool lcs::Bus< bits >::LineAccessor::isValid (  )  const

Returns true if the LineAccessor can access valid bus line data, false if not.

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

template<int bits>
Line & lcs::Bus< bits >::LineAccessor::operator[] ( int  index  ) 

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.

Parameters:
index The index into the bus bits.


Copyright © 2006, 2007 Siva Chandra