2017-04-23 19:13:23 -04:00
|
|
|
#ifndef GATE
|
|
|
|
#define GATE
|
|
|
|
|
|
|
|
#include "Event.h"
|
|
|
|
|
|
|
|
class Wire;
|
|
|
|
|
2017-04-26 11:20:20 -04:00
|
|
|
// this class provides a base class for all other Gate classes (provided in
|
|
|
|
// other files)
|
2017-04-23 19:13:23 -04:00
|
|
|
class Gate {
|
|
|
|
public:
|
|
|
|
virtual Event evaluate(int) = 0;
|
2017-04-23 19:53:37 -04:00
|
|
|
void setOut(int time, int value);
|
2017-04-23 19:13:23 -04:00
|
|
|
protected:
|
|
|
|
Wire *in1, *in2, *out;
|
|
|
|
int delay;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // !GATE
|