RTC Toolkit 6.0.0
Loading...
Searching...
No Matches
malEventInjector.hpp
Go to the documentation of this file.
1
11
12#ifndef RTCTK_COMPONENTFRAMEWORK_MALEVENTINJECTOR_HPP
13#define RTCTK_COMPONENTFRAMEWORK_MALEVENTINJECTOR_HPP
14
16
17#include <mal/utility/future.hpp>
18
20
21template <typename EventType>
22elt::mal::future<std::string> InjectReqRepEvent(StateMachineEngine& engine) {
23 auto ev = std::make_unique<EventType>();
24 auto f = ev->GetPayload().GetReplyFuture();
25 engine.PostEvent(std::move(ev));
26 return f;
27}
28
29template <typename EventType, typename PayloadType>
30elt::mal::future<std::string> InjectReqRepEvent(StateMachineEngine& engine, PayloadType& payload) {
31 auto ev = std::make_unique<EventType>(payload);
32 auto f = ev->GetPayload().GetReplyFuture();
33 engine.PostEvent(std::move(ev));
34 return f;
35}
36
37} // namespace rtctk::componentFramework
38
39#endif
Definition stateMachineEngine.hpp:34
void PostEvent(rad::SharedEvent s)
Injects a new event into the state machine engine.
Definition stateMachineEngine.cpp:145
Definition commandReplier.cpp:21
elt::mal::future< std::string > InjectReqRepEvent(StateMachineEngine &engine)
Definition malEventInjector.hpp:22
Wrapper around the SCXML State Machine Engine.