CommonGateBase Class Template Reference

#include <CaFactory.h>

Inheritance diagram for CommonGateBase:

Inheritance graph
[legend]

List of all members.


Detailed Description

template<int N>
class CommonGateBase< N >

Common base class for all gates defined by a binary operator.

There is always only one output wire.

Parameters:
N Count of input signals.

Definition at line 255 of file CaFactory.h.


Public Member Functions

virtual TBus operator[] (TBus in) const
 (the core method of IGate interface) Override it to define circuit's behavior.
virtual size_t nInputs () const
 Override this method to return number of circuit's input signals.
virtual size_t nOutputs () const
 Override this method to return number of circuit's output signals.
virtual IGateclone () const =0
 Each final derivation of IGate has to override this method with self-cloning method to keep the simulator working.

Protected Member Functions

virtual bool init () const =0
 Override this method to initialize output value.
virtual void perform (bool &out, bool in) const =0
 Override this method to define the binary operator.

Member Function Documentation

virtual TBus operator[] ( TBus  in  )  const [inline, virtual]

(the core method of IGate interface) Override it to define circuit's behavior.

Parameters:
in Input passed to gate.
Returns:
Returns corresponding output of the gate to given input.

Implements IGate.

Definition at line 257 of file CaFactory.h.

References init(), and perform().

Here is the call graph for this function:

virtual bool init (  )  const [protected, pure virtual]

Override this method to initialize output value.

Returns:
Return value used for output initialization.

Implemented in AndGate, OrGate, and XorGate.

Referenced by operator[]().

Here is the caller graph for this function:

virtual void perform ( bool &  out,
bool  in 
) const [protected, pure virtual]

Override this method to define the binary operator.

Parameters:
out Reference to output signal.
in Corresponding part of input which is being processed.

Implemented in AndGate, OrGate, and XorGate.

Referenced by operator[]().

Here is the caller graph for this function:

virtual size_t nInputs (  )  const [inline, virtual, inherited]

Override this method to return number of circuit's input signals.

Implements IGate.

Definition at line 182 of file CaFactory.h.

virtual size_t nOutputs (  )  const [inline, virtual, inherited]

Override this method to return number of circuit's output signals.

Implements IGate.

Definition at line 185 of file CaFactory.h.

virtual IGate* clone (  )  const [pure virtual, inherited]

Each final derivation of IGate has to override this method with self-cloning method to keep the simulator working.

If you find a way how to do it generically at the top level, please send a patch to nucad@dudka.cz.

Implemented in MuxGate< 3 >, MuxGate< 6 >, BusGate, CrossGate, MulGate, AndGate, OrGate, and XorGate.

Referenced by CaEvaluator::CaEvaluator().

Here is the caller graph for this function:


The documentation for this class was generated from the following file:
Generated on Sat May 2 16:39:38 2009 for nucad by  doxygen 1.5.4