BPMN-OS
BPMN for optimization and simulation
Loading...
Searching...
No Matches
EventListener.cpp
Go to the documentation of this file.
1
#include "
EventListener.h
"
2
#include "
Engine.h
"
3
#include "
Event.h
"
4
5
using namespace
BPMNOS::Execution
;
6
7
void
EventListener::subscribe
(
EventDispatcher
* eventDispatcher) {
8
eventDispatchers
.push_back(eventDispatcher);
9
}
10
11
std::shared_ptr<Event>
EventListener::fetchEvent
(
SystemState
* systemState) {
12
for
(
auto
& eventDispatcher :
eventDispatchers
) {
13
if
(
auto
event = eventDispatcher->dispatchEvent(systemState) ) {
14
return
event;
15
}
16
}
17
return
nullptr
;
18
}
19
Engine.h
EventListener.h
Event.h
BPMNOS::Execution::EventDispatcher
Definition
EventDispatcher.h:11
BPMNOS::Execution::EventListener::subscribe
void subscribe(EventDispatcher *eventDispatcher)
Definition
EventListener.cpp:7
BPMNOS::Execution::EventListener::fetchEvent
std::shared_ptr< Event > fetchEvent(SystemState *systemState)
Definition
EventListener.cpp:11
BPMNOS::Execution::EventListener::eventDispatchers
std::vector< EventDispatcher * > eventDispatchers
Definition
EventListener.h:16
BPMNOS::Execution::SystemState
A class representing the state that the execution or simulation of a given scenario is in.
Definition
SystemState.h:21
BPMNOS::Execution
Definition
Controller.h:9