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