aboutsummaryrefslogtreecommitdiff
path: root/NodeOutput.cpp
blob: cf1b979cf2cd711843fdb18c198c4a5a05002cad (plain)
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
#include "NodeOutput.h"
#include "Exception.h"

NodeOutput NodeOutput::instance(NodeOutput::type);

NodeOutput::NodeOutput(const char * type) : Node(type) { init(); }

void NodeOutput::init() {
	this->min_inputs = 1;
	this->max_inputs = 1;
}

void NodeOutput::sim() {
	Node::sim();
	this->input = this->inputs[0]->getLevel();
}

NodeOutput::NodeOutput(const NodeOutput * prototype) : Node() { init(); }

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

void NodeOutput::setOutput(Net *) {
	throw CircuitException("NodeOutput cannot have an output");
}

SignalLevel NodeOutput::level() {
	return this->input;
}