forked from SWE501-Spring2017-Bogazici/FinalProject
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEvent.cpp
More file actions
65 lines (49 loc) · 1.1 KB
/
Event.cpp
File metadata and controls
65 lines (49 loc) · 1.1 KB
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/*
* Event.cpp
*
* Created on: Jun 2, 2017
* Author: Can Candan
*/
#include <iostream>
#include "Event.h"
#include "easylogging++.h"
using namespace std;
Event::Event() {
// TODO Auto-generated constructor stub
}
Event::Event(Simulation* sim, Task* task, double time) : sim(sim), task(task), time(time) {
}
double Event::getTime() const {
return time;
}
void Event::setTime(double time) {
this->time = time;
}
Event::~Event() {
// TODO Auto-generated destructor stub
}
void Event::log() {
LOG(INFO) << this->name << " @:" << to_string(this->time) << " t:" << to_string(task->getId());
}
Task *Event::getTask() const {
return task;
}
void Event::setTask(Task *task) {
Event::task = task;
}
Simulation *Event::getSim() const {
return sim;
}
void Event::setSim(Simulation *sim) {
Event::sim = sim;
}
const string &Event::getName() const {
return name;
}
void Event::setName(const string &name) {
Event::name = name;
}
ostream &operator<<(ostream &os, const Event &event) {
os << "time: " << event.time << " task: " << event.task << " sim: " << event.sim;
return os;
}