TwoInputGate Class Reference

The Class TwoInputGate. More...

#include <TwoInputGate.h>

Inheritance diagram for TwoInputGate:
LogicGate BaseTwoInputGate AbstractSimObject BaseLogicGate SimObject

List of all members.

Public Member Functions

 TwoInputGate (size_t id, const TwoInputFunc &func, const std::string &outputName, const std::string &input1Name, const std::string &input2Name, const SimTime &delay)
 Instantiates a new two input gate.
 TwoInputGate (const TwoInputGate &that)
virtual TwoInputGateclone () const
 a way to construct different subtypes
virtual bool hasInputName (const std::string &net) const
 Checks for input name.
virtual bool hasOutputName (const std::string &net) const
 Checks for output name.
virtual const std::string & getOutputName () const
 Gets the output name.
virtual size_t getInputIndex (const std::string &net) const
virtual const std::string getGateName () const
 The name of the gate depends on the functionality it's implementing.
virtual const std::string toString () const
 for debugging

Protected Member Functions

virtual LogicVal evalOutput () const
 compute the new value of the output by calling the functor
virtual void execEvent (Graph &graph, GNode &myNode, const EventTy &event)
 The basic idea is to find which input is updated by the LogicUpdate stored in the event.

Private Attributes

const TwoInputFuncfunc
 The functor that computes a value for the output of the gate when provided with the values of the input.

Detailed Description

The Class TwoInputGate.


Constructor & Destructor Documentation

TwoInputGate::TwoInputGate ( size_t  id,
const TwoInputFunc func,
const std::string &  outputName,
const std::string &  input1Name,
const std::string &  input2Name,
const SimTime delay 
) [inline]

Instantiates a new two input gate.

Parameters:
id 
func,: functor implementing the function from inputs to outputs
outputName the output name
input1Name the input 1 name
input2Name the input 2 name
delay the delay
TwoInputGate::TwoInputGate ( const TwoInputGate that  )  [inline]

Member Function Documentation

virtual TwoInputGate* TwoInputGate::clone (  )  const [inline, virtual]

a way to construct different subtypes

Returns:
a copy of this

Implements AbstractSimObject.

virtual LogicVal TwoInputGate::evalOutput (  )  const [inline, protected, virtual]

compute the new value of the output by calling the functor

Implements BaseLogicGate.

virtual void TwoInputGate::execEvent ( Graph graph,
GNode myNode,
const EventTy event 
) [inline, protected, virtual]

The basic idea is to find which input is updated by the LogicUpdate stored in the event.

Then after updating the input, the output is evaluated, and the updated value of the output is sent as a LogicUpdate to all the out-going neighbors to which the output feeds

Implements AbstractSimObject.

virtual const std::string TwoInputGate::getGateName (  )  const [inline, virtual]

The name of the gate depends on the functionality it's implementing.

virtual size_t TwoInputGate::getInputIndex ( const std::string &  net  )  const [inline, virtual]
Parameters:
net name of the wire to query
Returns:
0 if the first input has the same name as 'net' and 1 if the 2nd input has the same name as 'net' otherwise throws and error

Implements LogicGate.

virtual const std::string& TwoInputGate::getOutputName (  )  const [inline, virtual]

Gets the output name.

Returns:
the output name

Reimplemented from BaseTwoInputGate.

virtual bool TwoInputGate::hasInputName ( const std::string &  net  )  const [inline, virtual]

Checks for input name.

Parameters:
net the net
Returns:
true, if this gate has an input with the name net

Reimplemented from BaseTwoInputGate.

virtual bool TwoInputGate::hasOutputName ( const std::string &  net  )  const [inline, virtual]

Checks for output name.

Parameters:
net the net
Returns:
true, if this gate has an output with the name net

Reimplemented from BaseTwoInputGate.

virtual const std::string TwoInputGate::toString (  )  const [inline, virtual]

for debugging

Reimplemented from BaseTwoInputGate.


Member Data Documentation

const TwoInputFunc& TwoInputGate::func [private]

The functor that computes a value for the output of the gate when provided with the values of the input.


The documentation for this class was generated from the following file:
Generated on Tue Aug 2 11:51:29 2011 for Galois by  doxygen 1.6.3