#include <cstdio> #include <iostream> #include <string> #include "node.h" #include "gate.h" void gate::configureEmpty() { name = "NoName"; } void gate::configureName(string inName) { name = inName; } void gate::configureForTwoInputs (node* input1, node* input2, node* out) { name = "NoName"; inputs.push_back(input1); inputs.push_back(input2); output = out; } void gate::showValue() { cout<<name<<" value is :"; //inputs for (node* inNode : inputs) //for all input nodes { if(inNode->alreadyComputed) { cout<<" "<< inNode->value; } else cout<<" ?"; } //output if(output->alreadyComputed) { cout << " | " << output->value << endl; } else cout << " | ?" << endl; } int gate::compute() { cout<<" ENTERED WRONG COMPUTE"<<endl; return -1; }