radec/src/Wire.h

44 lines
849 B
C
Raw Permalink Normal View History

2017-04-23 19:18:11 -04:00
#ifndef WIRE
#define WIRE
#include <vector>
#include <queue>
#include <string>
#include <iomanip>
2017-04-23 19:18:11 -04:00
using namespace std;
class Gate;
class Wire {
public:
Wire(int number, bool io, string inName = "");
2017-04-23 19:59:57 -04:00
void addGate(Gate* newGate);
2017-04-23 19:18:11 -04:00
2017-04-23 20:30:15 -04:00
int getValue(int wantedTime) const;
char getChar(int wantedTime) const;
2017-04-23 19:18:11 -04:00
int getNumber() const;
2017-04-23 19:59:57 -04:00
string getName() const;
int getLast() const;
2017-04-23 19:59:57 -04:00
void setValue(int newValue, int setTime);
bool doesChange(int newValue, int setTime);
2017-04-24 19:35:30 -04:00
void convertToIO(string newName);
2017-04-25 20:51:41 -04:00
Gate* getGate(int index) const;
void setLast(int last);
2017-04-25 20:51:41 -04:00
void setPrintLen(int);
friend ostream& operator<<(ostream &out, const Wire &c);
2017-04-23 19:18:11 -04:00
private:
2017-04-25 20:51:41 -04:00
int WireNumber, value, lastEvent, printLen;
2017-04-23 20:30:15 -04:00
vector<int> historyTimes;
vector<int> historyValues;
2017-04-23 19:18:11 -04:00
string name;
bool isPrint;
vector<Gate*> gates;
};
#endif // !WIRE