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