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
5using namespace BPMNOS::Execution;
6
8 eventDispatchers.push_back(eventDispatcher);
9}
10
11std::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
void subscribe(EventDispatcher *eventDispatcher)
std::shared_ptr< Event > fetchEvent(SystemState *systemState)
std::vector< EventDispatcher * > eventDispatchers
A class representing the state that the execution or simulation of a given scenario is in.
Definition SystemState.h:21