Scheduler
event.h
Go to the documentation of this file.
1 
10 #ifndef EVENT_H
11 #define EVENT_H
12 
13 #include <memory>
14 #include <string>
15 
16 #include "eventType.h"
17 
18 #define PRINT 1
19 namespace Scheduler
20 {
21 
22 class Process;
23 class EventList;
24 class Visitor;
25 
26 class Event
27 {
28 friend EventList;
29 public:
35  Event(double time, bool renew = true);
39  void setTask(std::shared_ptr<Process> task);
43  double getTime();
48  virtual void process()=0;
49  virtual ~Event();
52  virtual void print();
56  virtual std::string getName()=0;
57 protected:
58  double time;
59  bool renew;
60  std::shared_ptr<Process> task{nullptr};
65 };
66 
67 
68 
69 
70 }
71 
72 
73 
74 #endif
TriggeringEvent
Definition: eventType.h:16
std::shared_ptr< Process > task
Definition: event.h:60
virtual void print()
print information about the event
Definition: event.cpp:41
virtual void process()=0
handle the the event TODO: &#39;process&#39; is maybe not the best word for that, given that our simulator ac...
Event(double time, bool renew=true)
Event constructor.
Definition: event.cpp:23
bool renew
Definition: event.h:59
TriggeringEvent eventType
The event type is need by the scheduling discipline, to determine if this kind of event triggers invo...
Definition: event.h:64
virtual ~Event()
Definition: event.cpp:27
double getTime()
get the time at which the event is scheduled
Definition: event.cpp:36
virtual std::string getName()=0
get the name of the event
void setTask(std::shared_ptr< Process > task)
if the event is specific to a task, set it here. TODO not all events have an associated task...
Definition: event.cpp:31
double time
Definition: event.h:58