1#ifndef REPETITION_STATE_H
2#define REPETITION_STATE_H
7#include "./timer_set_state.h"
37 auto _delay = std::chrono::milliseconds(_doubledDelay);
38 bool _interrupted = this->
WaitFor(_delay);
64 std::function<
void()> onTimerExpired,
65 uint32_t repetitionsMax,
66 int repetitionsBaseDelay) : helper::
MachineState<T>(currentState),
71 if (repetitionsBaseDelay < 0)
73 throw std::invalid_argument(
"Invalid repetition base delay.");
MachineState(T state) noexcept
Constructor.
Definition: machine_state.h:70
Server's or client's service repetition state.
Definition: repetition_state.h:24
const int RepetitionsMax
Maximum iteration in repetition phase.
Definition: repetition_state.h:27
RepetitionState(T currentState, T nextState, T stoppedState, std::function< void()> onTimerExpired, uint32_t repetitionsMax, int repetitionsBaseDelay)
Constructor.
Definition: repetition_state.h:60
virtual void SetTimer() override
Set the phase time on state activation.
Definition: repetition_state.h:32
const int RepetitionsBaseDelay
Repetition iteration delay in milliseconds.
Definition: repetition_state.h:30
Server's or client's service timer set state.
Definition: timer_set_state.h:24
bool WaitFor(std::chrono::milliseconds duration)
Wait for certian period of time.
Definition: timer_set_state.h:49
const std::function< void()> OnTimerExpired
Delegate which is invoked by timer's thread when the timer is expired.
Definition: timer_set_state.h:76