BPMN-OS
BPMN for optimization and simulation
Loading...
Searching...
No Matches
Event.h
Go to the documentation of this file.
1#ifndef BPMNOS_Execution_Event_H
2#define BPMNOS_Execution_Event_H
3
4#include "Token.h"
5#include "Observable.h"
6
7namespace BPMNOS::Execution {
8
9class Engine;
10
11//class Event;
12//typedef std::vector< std::shared_ptr<Token> > Events;
13
14struct Event : std::enable_shared_from_this<Event>, Observable {
15 constexpr Type getObservableType() const override { return Type::Event; };
16 Event(const Token* token);
17 virtual ~Event() = default; // Virtual destructor
18 const Token* token;
19
20 virtual void processBy(Engine* engine) const = 0;
21
22 /// Returns a pointer of type T of the Event.
23 template<typename T> const T* is() const {
24 return dynamic_cast<const T*>(this);
25 }
26
27 virtual nlohmann::ordered_json jsonify() const = 0;
28};
29
30} // namespace BPMNOS::Execution
31
32#endif // BPMNOS_Execution_Event_H
33
Represents a token running through a (sub)process.
Definition Token.h:35
virtual void processBy(Engine *engine) const =0
const Token * token
Definition Event.h:18
virtual ~Event()=default
virtual nlohmann::ordered_json jsonify() const =0
constexpr Type getObservableType() const override
Definition Event.h:15
const T * is() const
Returns a pointer of type T of the Event.
Definition Event.h:23