BPMN-OS
BPMN for optimization and simulation
Loading...
Searching...
No Matches
Metronome.h
Go to the documentation of this file.
1#ifndef BPMNOS_Execution_MetronomeHandler_H
2#define BPMNOS_Execution_MetronomeHandler_H
3
4#include <chrono>
5
6#include <bpmn++.h>
8
9namespace BPMNOS::Execution {
10
11/**
12 * @brief Class creating a clock tick event each time fetchEvent() after sleeping in order to synchronize with real time.
13 */
14class Metronome : public EventDispatcher {
15public:
16 Metronome(unsigned int clockTickDuration = 1000);
17 std::shared_ptr<Event> dispatchEvent( const SystemState* systemState ) override;
18 void initialize(unsigned int clockTickDuration); ///< Change clockTickDuration and set timestamp to current time and
19private:
20 std::chrono::high_resolution_clock::time_point timestamp;
21 unsigned int clockTickDuration; ///< Duration of clock ticks in milliseconds
22};
23
24} // namespace BPMNOS::Execution
25
26#endif // BPMNOS_Execution_MetronomeHandler_H
27
Class creating a clock tick event each time fetchEvent() after sleeping in order to synchronize with ...
Definition Metronome.h:14
Metronome(unsigned int clockTickDuration=1000)
Definition Metronome.cpp:7
std::shared_ptr< Event > dispatchEvent(const SystemState *systemState) override
Definition Metronome.cpp:17
void initialize(unsigned int clockTickDuration)
Change clockTickDuration and set timestamp to current time and.
Definition Metronome.cpp:12
A class representing the state that the execution or simulation of a given scenario is in.
Definition SystemState.h:21