-
Notifications
You must be signed in to change notification settings - Fork 1
/
Event.cpp
37 lines (35 loc) · 1017 Bytes
/
Event.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#include "Event.hpp"
Event::Event() {
lineNum = -1; idx = -1;
type = EventType::undefined;
context = nullptr;
loopId = -1; startLoopId = -2;
}
Event::Event(const int num) : lineNum(num) {
type = EventType::undefined; idx = -1;
context = nullptr;
loopId = -1; startLoopId = -2;
}
Event::Event(const int num, const Event::EventType t) : lineNum(num), type(t) {
context = nullptr; idx = -1;
loopId = -1; startLoopId = -2;
}
bool Event::operator== (const Event& rhs) const{
if(lineNum != rhs.lineNum || type != rhs.type ){ // not same line number
return false;
}
// if(type == EventType::Condition){
// // if conditional, value should be same
// if(value != rhs.value){
// // return false;
// }
// }
// should also compare context here
return true;
}
bool Event::operator!= (const Event& rhs) const{
return !(this->operator==(rhs));
}
void Event::print(){
std::cout << "L" << lineNum << "=" << value ;
}