-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGate.h
45 lines (39 loc) · 844 Bytes
/
Gate.h
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
45
#ifndef GATE_H
#define GATE_H
#include "Tag.h"
#include "kpabe.hpp"
class Gate
{
public:
enum Type
{
OR,
AND
};
public:
bool evaluate(vector<bool> &matches);
void makeParent();
void print(vector<Tag> &subArray);
Gate(Type, int, bool, int, bool);
Gate(Type, Gate *, int, bool);
Gate(Type, Gate *, Gate *);
Gate(int, bool = false);
Gate(const Gate &other);
Gate(){};
Gate &operator=(const Gate &other);
Node createABETree();
private:
bool _isLeftGate = true;
bool _isRightGate = true;
bool _parent = false;
bool _valueOnly = false;
Type _gateType = Gate::Type::OR;
Gate *_leftGate = 0;
Gate *_rightGate = 0;
//Interest Info
int _left = -1;
int _right = -1;
bool _leftNOT = false;
bool _rightNOT = false;
};
#endif