Scheduler
timeoutEvent.h
Go to the documentation of this file.
1 
10 #ifndef TIMEOUTEVENT_H
11 #define TIMEOUTEVENT_H
12 
13 #include "event.h"
14 #include "eventType.h"
15 
16 namespace Scheduler
17 {
18 
19 class TimeOut : public Event
20 {
21 public:
22  TimeOut(double time, bool renew=true) : Event(time, renew){};
23  void process() override;
24  virtual void doWork();
25  virtual std::shared_ptr<TimeOut> getNextTimeout()=0;
26  double getInterval();
27  void setInterval(double inter);
28 protected:
29  double interval{2.0};
30 };
31 
32 class SchedTimeOut : public TimeOut
33 {
34 public:
35  SchedTimeOut(double time, bool renew=true) : TimeOut(time, renew){eventType=schedTimeOut;};
36  std::shared_ptr<TimeOut> getNextTimeout();
37  std::string getName();
38 };
39 
40 class UsageUpdate : public TimeOut
41 {
42 public:
43  UsageUpdate(double time, bool renew=true) : TimeOut(time, renew){eventType=usageUpdate;};
44  std::string getName() override;
45  void doWork() override;
46  std::shared_ptr<TimeOut> getNextTimeout() override;
47 protected:
48 };
49 
50 class StatsTick : public TimeOut
51 {
52 public:
53  StatsTick(double time, bool renew = true) : TimeOut(time,renew){eventType=statsTick;};
54  std::string getName() override;
55  void doWork() override;
56  std::shared_ptr<TimeOut> getNextTimeout() override;
57 };
58 
59 class FreqUpdate : public TimeOut
60 {
61 public:
62  FreqUpdate(double time, bool renew=true) : TimeOut(time, renew){eventType=freqUpdate;};
63  std::string getName();
64  std::shared_ptr<TimeOut> getNextTimeout() override;
65  void doWork() override;
66 };
67 class DummyEvent : public TimeOut
68 {
69 public:
70  DummyEvent(double time, bool renew = true) : TimeOut(time, renew){eventType=nothing;};
71  std::string getName() override;
72  std::shared_ptr<TimeOut> getNextTimeout() override;
73  void doWork() override;
74 };
75 
76 }
77 #endif
StatsTick(double time, bool renew=true)
Definition: timeoutEvent.h:53
UsageUpdate(double time, bool renew=true)
Definition: timeoutEvent.h:43
DummyEvent(double time, bool renew=true)
Definition: timeoutEvent.h:70
TimeOut(double time, bool renew=true)
Definition: timeoutEvent.h:22
void setInterval(double inter)
virtual void doWork()
virtual std::shared_ptr< TimeOut > getNextTimeout()=0
void process() override
handle the the event TODO: &#39;process&#39; is maybe not the best word for that, given that our simulator ac...
SchedTimeOut(double time, bool renew=true)
Definition: timeoutEvent.h:35
bool renew
Definition: event.h:59
FreqUpdate(double time, bool renew=true)
Definition: timeoutEvent.h:62
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 std::string getName()=0
get the name of the event
double time
Definition: event.h:58