add several functions and update others
This commit is contained in:
parent
10df712a45
commit
65142fa5d8
@ -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
|
||||||
|
@ -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
|
||||||
|
@ -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);
|
||||||
|
Loading…
Reference in New Issue
Block a user