BPMN-OS
BPMN for optimization and simulation
Loading...
Searching...
No Matches
Notifier.h
Go to the documentation of this file.
1
#ifndef _BPMNOS_Execution_Notifier_H
2
#define _BPMNOS_Execution_Notifier_H
3
4
#include <vector>
5
#include "
Observable.h
"
6
#include "
Observer.h
"
7
8
namespace
BPMNOS::Execution
{
9
10
class
Notifier
{
11
public
:
12
Notifier
();
13
virtual
~Notifier
() =
default
;
14
15
template
<
typename
... ObservableTypes>
16
void
addSubscriber
(
Observer
* subscriber, ObservableTypes... observableTypes) {
17
(subscribers[(size_t)observableTypes].push_back(subscriber), ...);
18
}
19
20
void
notify
(
const
Observable
* observable)
const
;
21
void
notify
(
const
Observable
& observable)
const
;
22
private
:
23
std::vector< std::vector<Observer*> > subscribers;
24
};
25
26
}
// namespace BPMNOS::Execution
27
#endif
// _BPMNOS_Execution_Notifier_H
Observable.h
Observer.h
BPMNOS::Execution::Notifier
Definition
Notifier.h:10
BPMNOS::Execution::Notifier::notify
void notify(const Observable *observable) const
Definition
Notifier.cpp:10
BPMNOS::Execution::Notifier::Notifier
Notifier()
Definition
Notifier.cpp:6
BPMNOS::Execution::Notifier::addSubscriber
void addSubscriber(Observer *subscriber, ObservableTypes... observableTypes)
Definition
Notifier.h:16
BPMNOS::Execution::Notifier::~Notifier
virtual ~Notifier()=default
BPMNOS::Execution::Observer
Definition
Observer.h:9
BPMNOS::Execution
Definition
Controller.h:9
BPMNOS::Execution::Observable
Definition
Observable.h:6