The Class OneInputGate. More...
#include <OneInputGate.h>
Public Member Functions | |
| OneInputGate (size_t id, const OneInputFunc &func, const std::string &outputName, const std::string &inputName, const SimTime &delay) | |
| Instantiates a new one input gate. | |
| OneInputGate (const OneInputGate &that) | |
| virtual OneInputGate * | clone () 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 const std::string | getGateName () const |
| name depends on the logic function this gate is implementing | |
| virtual size_t | getInputIndex (const std::string &net) const |
| Gets the index of the input whose name is matching the net. | |
| virtual const std::string | toString () const |
| A string representation. | |
Protected Member Functions | |
| virtual LogicVal | evalOutput () const |
| execEvent follows the same logic as TwoInputGate::execEvent() | |
| virtual void | execEvent (Graph &graph, GNode &myNode, const EventTy &event) |
| Exec event. | |
Private Attributes | |
| const OneInputFunc & | func |
| a functor which computes an output LogicVal when provided an input LogicVal | |
The Class OneInputGate.
| OneInputGate::OneInputGate | ( | size_t | id, | |
| const OneInputFunc & | func, | |||
| const std::string & | outputName, | |||
| const std::string & | inputName, | |||
| const SimTime & | delay | |||
| ) | [inline] |
Instantiates a new one input gate.
| id | ||
| func,: | the functor providing mapping from input values to output values | |
| outputName | the output name | |
| inputName | the input name | |
| delay | the delay |
| OneInputGate::OneInputGate | ( | const OneInputGate & | that | ) | [inline] |
| virtual OneInputGate* OneInputGate::clone | ( | ) | const [inline, virtual] |
| virtual LogicVal OneInputGate::evalOutput | ( | ) | const [inline, protected, virtual] |
execEvent follows the same logic as TwoInputGate::execEvent()
calls the functor to compute output value
Implements BaseLogicGate.
| virtual void OneInputGate::execEvent | ( | Graph & | graph, | |
| GNode & | myNode, | |||
| const EventTy & | e | |||
| ) | [inline, protected, virtual] |
Exec event.
The user code should override this method inorder to define the semantics of executing and event on a sub-type
| graph,: | the graph containg simulation objects as nodes and communication links as edges | |
| myNode,: | the node in the graph that has this SimObject as its node data | |
| e,: | the input event |
Implements AbstractSimObject.
| virtual const std::string OneInputGate::getGateName | ( | ) | const [inline, virtual] |
| virtual size_t OneInputGate::getInputIndex | ( | const std::string & | net | ) | const [inline, virtual] |
Gets the index of the input whose name is matching the net.
| net | name of the net an input of this gate is connected to |
Implements LogicGate.
| virtual const std::string& OneInputGate::getOutputName | ( | ) | const [inline, virtual] |
| virtual bool OneInputGate::hasInputName | ( | const std::string & | net | ) | const [inline, virtual] |
Checks for input name.
| net | the wire name |
Reimplemented from BaseOneInputGate.
| virtual bool OneInputGate::hasOutputName | ( | const std::string & | net | ) | const [inline, virtual] |
Checks for output name.
| net | the wire name |
Reimplemented from BaseOneInputGate.
| virtual const std::string OneInputGate::toString | ( | ) | const [inline, virtual] |
A string representation.
Reimplemented from BaseOneInputGate.
const OneInputFunc& OneInputGate::func [private] |
a functor which computes an output LogicVal when provided an input LogicVal
1.6.3