add several functions and update others

This commit is contained in:
Joel Beckmeyer 2017-04-25 13:53:59 -04:00
parent 10df712a45
commit 65142fa5d8
3 changed files with 4 additions and 3 deletions

View File

@ -6,7 +6,7 @@ using namespace std;
class Event { class Event {
public: public:
Event(int num, int value, int setTime, Wire * output); Event(int value, int setTime, Wire * output);
friend bool operator<(const Event &e1, const Event &e2); friend bool operator<(const Event &e1, const Event &e2);
int getValue() const; int getValue() const;
@ -16,6 +16,7 @@ class Event {
private: private:
int evNum, evValue, evTime; int evNum, evValue, evTime;
Wire *out; Wire *out;
static int numOfEvents;
}; };
#endif // !EVENT #endif // !EVENT

View File

@ -31,7 +31,6 @@ class Simulation {
priority_queue<Event> e; priority_queue<Event> e;
vector<Gate*> gates; vector<Gate*> gates;
vector<Wire*> wires; vector<Wire*> wires;
int eventNum;
}; };
#endif // !SIMULATION #endif // !SIMULATION

View File

@ -22,7 +22,8 @@ class Wire {
string getName() const; string getName() const;
int getLast() const; int getLast() const;
bool setValue(int newValue, int setTime); void setValue(int newValue, int setTime);
bool doesChange(int newValue, int setTime);
void convertToIO(string newName); void convertToIO(string newName);
Gate* getGate(int index); Gate* getGate(int index);
void setLast(int last); void setLast(int last);