RTC Toolkit 5.0.0
Loading...
Searching...
No Matches
loopCmdsImpl.hpp
Go to the documentation of this file.
1
13#ifndef RTCTK_COMPONENTFRAMEWORK_LOOPCMDSIMPL_HPP
14#define RTCTK_COMPONENTFRAMEWORK_LOOPCMDSIMPL_HPP
15
16#include <Rtctkif.hpp>
18#include <rtctk/componentFramework/events.rad.hpp>
22
23#include <mal/Cii.hpp>
24
25#include <memory>
26#include <string>
27
29
35class LoopCmdsImpl : public rtctkif::AsyncLoopCmds {
36public:
38 std::shared_ptr<elt::mal::rr::RrEntity> rr_service = std::make_shared<LoopCmdsImpl>(engine);
39 replier.RegisterService<rtctkif::AsyncLoopCmds>("LoopCmds", rr_service);
40 }
41
43 : m_logger(GetLogger("rtctk")), m_engine(engine) {
44 }
45
46 ::elt::mal::future<std::string> Open() override {
47 LOG4CPLUS_TRACE(m_logger, "Received command 'Open'");
48 return InjectReqRepEvent<events::Open>(m_engine);
49 }
50
51 ::elt::mal::future<std::string> Close() override {
52 LOG4CPLUS_TRACE(m_logger, "Received command 'Close'");
53 return InjectReqRepEvent<events::Close>(m_engine);
54 }
55
56private:
57 log4cplus::Logger& m_logger;
58 StateMachineEngine& m_engine;
59};
60
61} // namespace rtctk::componentFramework
62
63#endif
Class that handles reception of commands using MAL.
Definition commandReplier.hpp:30
Class that handles reception of commands Open and Close using MAL.
Definition loopCmdsImpl.hpp:35
static void Register(CommandReplier &replier, StateMachineEngine &engine)
Definition loopCmdsImpl.hpp:37
LoopCmdsImpl(StateMachineEngine &engine)
Definition loopCmdsImpl.hpp:42
::elt::mal::future< std::string > Open() override
Definition loopCmdsImpl.hpp:46
::elt::mal::future< std::string > Close() override
Definition loopCmdsImpl.hpp:51
Definition stateMachineEngine.hpp:35
Receive commands via MAL.
Logging Support Library based on log4cplus.
Provides core functionality of an RTC Component.
Definition commandReplier.cpp:22
elt::mal::future< std::string > InjectReqRepEvent(StateMachineEngine &engine)
Definition malEventInjector.hpp:23
Wrapper around the SCXML State Machine Engine.