-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEvent.h
More file actions
53 lines (37 loc) · 1.23 KB
/
Event.h
File metadata and controls
53 lines (37 loc) · 1.23 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
#ifndef EVENT_H
#define EVENT_H
#include <vector>
#include "IMSimInternal.h"
#include "Entity.h"
#include "Simulation.h"
#include "Continuous/ConditionsContainer.h"
namespace IMSim {
class Condition;
class ConditionsContainer;
class BlockContainer;
class Event: public Entity {
public:
// construction
explicit Event(Simulation *simulation): Entity(simulation) {}
Event(Simulation *simulation, const char* name): Entity(simulation, name) {}
// lifetime
virtual void activate();
void terminate();
// scheduling
void schedule();
void schedule(PRIORITY priority );
void scheduleAt(TIME at, PRIORITY priority = 0);
void schedulePeriodically(TIME from, TIME interval = 0, PRIORITY priority = 0);
void scheduleOmnipresent(TIME from, TIME interval = 0, PRIORITY priority = 0);
// conditions
void addCondition(Condition *condition);
protected:
void _schedule(TIME from, TIME interval = 0, PRIORITY priority = 0, bool omnipresent = false, ACTION_CALLBACK callback = NULL, void* data = NULL);
ConditionsContainer* getConditionsContainer();
BlockContainer* getBlockContainer();
TIME now();
private:
virtual void action() = 0;
};
}
#endif /* EVENT_H */