diff options
-rw-r--r-- | Node.cpp (renamed from Gate.cpp) | 14 | ||||
-rw-r--r-- | Node.h (renamed from Gate.h) | 8 |
2 files changed, 11 insertions, 11 deletions
@@ -1,22 +1,22 @@ -#include "Gate.h" +#include "Node.h" #include <iostream> -Gate::Gate(){} -Gate::~Gate(){} -void Gate::addInput(Net* net){ +Node::Node(){} +Node::~Node(){} +void Node::addInput(Net* net){ net->attach(this); } -void Gate::setOutput(Net* net){ +void Node::setOutput(Net* net){ this->output = net; } -void Gate::update(){ +void Node::update(){ std::cout << "updated" << std::endl; this->compare(); } -/*/ Concrete Gates: /*/ +/*/ Concrete Nodes: /*/ void GateAnd::compare(){ SignalLevel new_out = HIGH; @@ -7,7 +7,7 @@ -class Gate: Observer { +class Node: Observer { protected: std::string label; std::string type; @@ -16,15 +16,15 @@ class Gate: Observer { Net* output; public: - Gate(/* args */); - virtual ~Gate(); + Node(/* args */); + virtual ~Node(); void update(); virtual void addInput(Net*); virtual void setOutput(Net*); virtual void compare() = 0; }; -class GateAnd: public Gate { +class GateAnd: public Node { public: GateAnd(){}; ~GateAnd(){}; |