SMACC
Loading...
Searching...
No Matches
cb_timer_countdown_loop.h
Go to the documentation of this file.
1#pragma once
2
3#include <smacc/smacc.h>
5
6namespace cl_ros_timer
7{
8
10{
11public:
12 CbTimerCountdownLoop(uint64_t triggerTickCount);
13
14 virtual void onEntry() override;
15 virtual void onExit() override;
16
17 template <typename TOrthogonal, typename TSourceObject>
19 {
20 this->postCountDownEvent_ = [=]() {
21 this->template postEvent<EvTimer<TSourceObject, TOrthogonal>>();
22 };
23 }
24
25 template <typename T>
26 boost::signals2::connection onTimerTick(void (T::*callback)(), T *object)
27 {
28 return this->getStateMachine()->createSignalConnection(onTimerTick_, callback, object);
29 }
30
31private:
32 uint64_t tickCounter_;
34
36 std::function<void()> postCountDownEvent_;
39};
40} // namespace cl_ros_timer
smacc::SmaccSignal< void()> onTimerTick_
boost::signals2::connection onTimerTick(void(T::*callback)(), T *object)
ISmaccStateMachine * getStateMachine()
boost::signals2::connection createSignalConnection(TSmaccSignal &signal, TMemberFunctionPrototype callback, TSmaccObjectType *object)