From e54371f2143cd2c28b349b1850590f300e3bee30 Mon Sep 17 00:00:00 2001 From: Loek Le Blansch Date: Wed, 12 Jun 2024 20:54:58 +0200 Subject: smol cleanup --- Node.h | 2 -- NodeInput.h | 21 ++++++++++++--------- main.cpp | 4 +++- 3 files changed, 15 insertions(+), 12 deletions(-) diff --git a/Node.h b/Node.h index 110928b..9fbea6f 100644 --- a/Node.h +++ b/Node.h @@ -26,8 +26,6 @@ public: protected: Node(const char * type); - string label; - vector 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; }; diff --git a/main.cpp b/main.cpp index 0e73d6f..f92af8a 100644 --- a/main.cpp +++ b/main.cpp @@ -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; } -- cgit v1.2.3