diff options
-rw-r--r-- | Node.h | 2 | ||||
-rw-r--r-- | NodeInput.h | 21 | ||||
-rw-r--r-- | main.cpp | 4 |
3 files changed, 15 insertions, 12 deletions
@@ -26,8 +26,6 @@ public: protected: Node(const char * type); - string label; - vector<Net *> inputs; Net * output = nullptr; diff --git a/NodeInput.h b/NodeInput.h index f277130..4bd7b59 100644 --- a/NodeInput.h +++ b/NodeInput.h @@ -10,32 +10,35 @@ public: ~NodeInput() = default; protected: - NodeInput(const char * type) : Node(type) {} + using Node::Node; }; class NodeInputLow : public NodeInput { +public: + virtual NodeInputLow * clone() const; + protected: SignalLevel level(); - NodeInputLow(const char * type) : NodeInput(type) {} - NodeInputLow * clone() const; + using NodeInput::NodeInput; + // NodeInputLow(const char * type) : NodeInput(type) {} private: NodeInputLow(const NodeInputLow *) : NodeInput() {} - using NodeInput::NodeInput; constexpr static const char * type = "input_low"; static NodeInputLow instance; }; class NodeInputHigh : public NodeInput { +public: + virtual NodeInputHigh * clone() const; + protected: - NodeInputHigh(const char * type) : NodeInput(type) {} + SignalLevel level(); + using NodeInput::NodeInput; + // NodeInputHigh(const char * type) : NodeInput(type) {} private: - SignalLevel level(); NodeInputHigh(const NodeInputHigh *) : NodeInput() {} - NodeInputHigh * clone() const; - - using NodeInput::NodeInput; constexpr static const char * type = "input_high"; static NodeInputHigh instance; }; @@ -16,7 +16,8 @@ int main(int argc, char** argv) { main_parser.set_circuit(circuit); - ifstream file("circuits/and-test.txt"); + // ifstream file("circuits/and-test.txt"); + ifstream file("circuits/full-adder.txt"); try { file >> main_parser; @@ -35,6 +36,7 @@ int main(int argc, char** argv) { } // cout << "Circuit output: " << circuit.getOutput() << endl; + // cout << circuit.result(); return EXIT_SUCCESS; } |