#include #include #include #include #include "node.h" #include "gateOR.h" gateOR::gateOR() { configureEmpty(); } gateOR::gateOR(string inName) { configureName(inName); } gateOR::gateOR (node* input1, node* input2, node* out) { configureForTwoInputs(input1, input2, out); } int gateOR::compute() { //Check status of inputs for(node* inNode : inputs) { if (!inNode->alreadyComputed) //input undefined { cout<setValue(false); //output value is 0 for(node* inNode : inputs) //check if output value will be 1, then overwrite { if(inNode->value) //if only one in is high, out is high { output->setValue(true); } } return -1; }