- A Logic Circuit Simulation Library in C++





lcs::Expression< bits, Type, LExprType, RExprType > Class Template Reference

#include <expression.h>

List of all members.


Detailed Description

template<int bits, ExprType Type, typename LExprType, typename RExprType>
class lcs::Expression< bits, Type, LExprType, RExprType >

A class whose objects are created as temporary objects during operations on lcs::Bus and InputBus objects. A user of libLCS will never need to use this class explicitly. Implicitly, this class is used everytime a continuous assignment is requested using the function lcs::Bus::cass.


Public Member Functions

 Expression (const LExprType &le, const RExprType &re)
 Expression (const Expression< bits, Type, LExprType, RExprType > &e)
const LineState operator[] (int index) const throw (OutOfRangeException<int>)
int width () const
void notify (Module *mod)


Constructor & Destructor Documentation

template<int bits, ExprType Type, typename LExprType, typename RExprType>
lcs::Expression< bits, Type, LExprType, RExprType >::Expression ( const LExprType &  le,
const RExprType &  re 
)

The only usefull constructor. Default constructor is practically useless.

template<int bits, ExprType Type, typename LExprType, typename RExprType>
lcs::Expression< bits, Type, LExprType, RExprType >::Expression ( const Expression< bits, Type, LExprType, RExprType > &  e  ) 

Copy constructor.


Member Function Documentation

template<int bits, ExprType Type, typename LExprType, typename RExprType>
void lcs::Expression< bits, Type, LExprType, RExprType >::notify ( Module mod  )  [inline]

This function can be used by a lcs::Module derivative to be notified of line state changes in the busses used in the expression.

template<int bits, ExprType Type, typename LExprType, typename RExprType>
const LineState lcs::Expression< bits, Type, LExprType, RExprType >::operator[] ( int  index  )  const throw (OutOfRangeException<int>)

Returns the bit state (which is a result of the operation performed by the expression) at the index specified.

template<int bits, ExprType Type, typename LExprType, typename RExprType>
int lcs::Expression< bits, Type, LExprType, RExprType >::width (  )  const [inline]

Returns the width for which an lcs::Expression object is valid.


Copyright © 2006, 2007 Siva Chandra