RTC Toolkit 6.0.0
Loading...
Searching...
No Matches
suspCmdsImpl.hpp
Go to the documentation of this file.
1
11
12#ifndef RTCTK_COMPONENTFRAMEWORK_SUSPCMDSIMPL_HPP
13#define RTCTK_COMPONENTFRAMEWORK_SUSPCMDSIMPL_HPP
14
15#include <Rtctkif.hpp>
17#include <rtctk/componentFramework/events.rad.hpp>
21
22#include <mal/Cii.hpp>
23
24#include <memory>
25#include <string>
26
28
34class SuspCmdsImpl : public rtctkif::AsyncSuspCmds {
35public:
36 static void Register(CommandReplier& replier, StateMachineEngine& engine) {
37 std::shared_ptr<elt::mal::rr::RrEntity> rr_service = std::make_shared<SuspCmdsImpl>(engine);
38 replier.RegisterService<rtctkif::AsyncSuspCmds>("SuspCmds", rr_service);
39 }
40
42 : m_logger(GetLogger("rtctk")), m_engine(engine) {
43 }
44
45 ::elt::mal::future<std::string> Suspend() override {
46 LOG4CPLUS_TRACE(m_logger, "Received command 'Suspend'");
48 }
49
50 ::elt::mal::future<std::string> Resume() override {
51 LOG4CPLUS_TRACE(m_logger, "Received command 'Resume'");
52 return InjectReqRepEvent<events::Resume>(m_engine);
53 }
54
55private:
56 log4cplus::Logger& m_logger;
57 StateMachineEngine& m_engine;
58};
59
60} // namespace rtctk::componentFramework
61
62#endif // RTCTK_COMPONENTFRAMEWORK_SUSPCMDSIMPL_HPP
Class that handles reception of commands using MAL.
Definition commandReplier.hpp:29
void RegisterService(const std::string &name, std::shared_ptr< elt::mal::rr::RrEntity > &service)
Definition commandReplier.hpp:36
Definition stateMachineEngine.hpp:34
SuspCmdsImpl(StateMachineEngine &engine)
Definition suspCmdsImpl.hpp:41
static void Register(CommandReplier &replier, StateMachineEngine &engine)
Definition suspCmdsImpl.hpp:36
::elt::mal::future< std::string > Resume() override
Definition suspCmdsImpl.hpp:50
::elt::mal::future< std::string > Suspend() override
Definition suspCmdsImpl.hpp:45
Receive commands via MAL.
log4cplus::Logger & GetLogger(const std::string &name="app")
Get handle to a specific logger.
Definition logger.cpp:191
Logging Support Library based on log4cplus.
Provides core functionality of an RTC Component.
Definition commandReplier.cpp:21
elt::mal::future< std::string > InjectReqRepEvent(StateMachineEngine &engine)
Definition malEventInjector.hpp:22
Wrapper around the SCXML State Machine Engine.