-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathInputGate.cpp
More file actions
44 lines (37 loc) · 850 Bytes
/
InputGate.cpp
File metadata and controls
44 lines (37 loc) · 850 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#include "InputGate.hpp"
vector<InputGate*> InputGate::InputVector = {};
void InputGate::change()
{
if (val == true)
{
val = false;
expr_wvalues = to_string(0);
}
else
{
val = true;
expr_wvalues = to_string(1);
}
calcul = expr + ":" + expr_wvalues;
}
InputGate::InputGate(string n) : Gate()
{
val = 0;
expr = n;
expr_wvalues = to_string(val);
calcul = expr + ":" + expr_wvalues ;
type = "Input";
InputVector.push_back(this);
}
int InputGate::getProf() const {return profondeur;}
vector<vector<Gate*>> InputGate::empiler()
{
//empiler renvoie un vector de vector de Gate*
//ici, on va simplement renvoyer {{InputGate*}}
vector<vector<Gate*>> vect_de_vect = {{}};
vector<Gate*> vect = {};
vect.push_back(this);
vect_de_vect.push_back(vect);
return vect_de_vect;
}
InputGate::~InputGate(){delete this;}