diff options
author | Daniel Jones <admin@danieljon.es> | 2020-07-08 23:15:20 +0930 |
---|---|---|
committer | Daniel Jones <admin@danieljon.es> | 2020-07-08 23:15:20 +0930 |
commit | 3a429d84c0e38b4a33834400aa0213082b634d55 (patch) | |
tree | e897390f88b0893e181c191d8cec1ebef547dfad /Gate.h | |
parent | 848e32a6983cd2d61e3c1e9a489ca6563536099f (diff) | |
download | foxlogicgates-3a429d84c0e38b4a33834400aa0213082b634d55.tar.gz foxlogicgates-3a429d84c0e38b4a33834400aa0213082b634d55.zip |
Made gate updating work on separate thread, added 3 way NAND gate
Becuase of a recursion and stack overflow problem when looping objects i've moved the object updating to a separate thread, and it no longer does recursion. I also added a 3 input NAND gate and paved the work to add more 3 input gates.
Diffstat (limited to 'Gate.h')
-rw-r--r-- | Gate.h | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -35,6 +35,7 @@ class Gate : public Object NOR, XOR, XNOR, + NAND3, }; Gate(GATE_TYPE type = INPUT, int x = 0, int y = 0, int width = 70, int height = 50, int id = -1); @@ -44,8 +45,10 @@ class Gate : public Object GATE_TYPE get_gate_type() { return this->gate_type; }; Object *get_input_gate1() { return this->input_gate1; }; Object *get_input_gate2() { return this->input_gate2; }; + Object *get_input_gate3() { return this->input_gate3; }; void set_input_gate1(Object *gate) { this->input_gate1 = gate; }; void set_input_gate2(Object *gate) { this->input_gate2 = gate; }; + void set_input_gate3(Object *gate) { this->input_gate3 = gate; }; void remove_input_object(int id) override; void update_state() override; @@ -57,6 +60,7 @@ class Gate : public Object /* inputs/outputs */ Object *input_gate1; Object *input_gate2; + Object *input_gate3; std::string get_output_type_text(); |