aboutsummaryrefslogtreecommitdiff
path: root/GateNot.cpp
blob: c272022c3b77211847185a7d54e1d7a1a4f2b4ba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "GateNot.h"

GateNot GateNot::instance(GateNot::type);

SignalLevel GateNot::level() {
	SignalLevel new_level = LOW;
	for (int i = 0; i < this->inputs.size(); i++){
		SignalLevel l = this->inputs[i]->getLevel();

		if (l == UNDEFINED) return UNDEFINED;
		if (l == HIGH) new_level = HIGH;
	}
	return new_level;
}

GateNot::GateNot(const GateNot * prototype) : Node() { }

GateNot * GateNot::clone() const {
	return new GateNot(this);
}