diff options
author | Loek Le Blansch <loek@pipeframe.xyz> | 2024-06-12 20:54:58 +0200 |
---|---|---|
committer | Loek Le Blansch <loek@pipeframe.xyz> | 2024-06-12 20:54:58 +0200 |
commit | e54371f2143cd2c28b349b1850590f300e3bee30 (patch) | |
tree | 7f9858829c25d627fa51a387045604909d9667b2 | |
parent | 068a4971084bd1e415c6523c3b5eb5a48de520ca (diff) |
smol cleanup
-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; } |