Go to the documentation of this file.
12 #ifndef RTCTK_COMPONENTFRAMEWORK_STDCMDSIMPL_HPP
13 #define RTCTK_COMPONENTFRAMEWORK_STDCMDSIMPL_HPP
17 #include <rtctk/componentFramework/events.rad.hpp>
22 #include <mal/Cii.hpp>
35 std::shared_ptr<elt::mal::rr::RrEntity> rr_service = std::make_shared<StdCmdsImpl>(engine);
42 ::elt::mal::future<std::string>
Init()
override {
43 LOG4CPLUS_TRACE(
GetLogger(),
"Received command 'Init'");
44 return InjectReqRepEvent<events::Init>(m_engine);
47 ::elt::mal::future<std::string>
Stop()
override {
48 LOG4CPLUS_TRACE(
GetLogger(),
"Received command 'Stop'");
49 return InjectReqRepEvent<events::Stop>(m_engine);
52 ::elt::mal::future<std::string>
Reset()
override {
53 LOG4CPLUS_TRACE(
GetLogger(),
"Received command 'Reset'");
54 return InjectReqRepEvent<events::Reset>(m_engine);
57 ::elt::mal::future<std::string>
Enable()
override {
58 LOG4CPLUS_TRACE(
GetLogger(),
"Received command 'Enable'");
59 return InjectReqRepEvent<events::Enable>(m_engine);
62 ::elt::mal::future<std::string>
Disable()
override {
63 LOG4CPLUS_TRACE(
GetLogger(),
"Received command 'Disable'");
64 return InjectReqRepEvent<events::Disable>(m_engine);
67 ::elt::mal::future<std::string>
GetState()
override {
68 LOG4CPLUS_TRACE(
GetLogger(),
"Received command 'GetState'");
69 return InjectReqRepEvent<events::GetState>(m_engine);
72 ::elt::mal::future<std::string>
GetStatus()
override {
73 LOG4CPLUS_TRACE(
GetLogger(),
"Received command 'GetStatus'");
74 return InjectReqRepEvent<events::GetStatus>(m_engine);
78 LOG4CPLUS_TRACE(
GetLogger(),
"Received command 'GetVersion'");
79 return InjectReqRepEvent<events::GetVersion>(m_engine);
82 ::elt::mal::future<std::string>
Exit()
override {
83 LOG4CPLUS_TRACE(
GetLogger(),
"Received command 'Exit'");
84 return InjectReqRepEvent<events::Exit>(m_engine);
87 ::elt::mal::future<std::string>
88 SetLogLevel(std::shared_ptr<stdif::LogInfo>
const& info)
override {
90 "Received command 'SetLogLevel' with logger '" + info->getLogger() +
91 "' and level '" + info->getLevel() +
"'");
92 auto ev = std::make_shared<events::SetLogLevel>(info->clone());
93 auto f = ev->GetPayload().GetReplyFuture();
104 #endif // RTCTK_COMPONENTFRAMEWORK_STDCMDSIMPL_HPP
::elt::mal::future< std::string > GetState() override
Definition: stdCmdsImpl.hpp:67
Receive commands via MAL.
StdCmdsImpl(StateMachineEngine &engine)
Definition: stdCmdsImpl.hpp:39
::elt::mal::future< std::string > Exit() override
Definition: stdCmdsImpl.hpp:82
Wrapper around the SCXML State Machine Engine.
Definition: commandReplier.cpp:20
::elt::mal::future< std::string > Reset() override
Definition: stdCmdsImpl.hpp:52
::elt::mal::future< std::string > GetStatus() override
Definition: stdCmdsImpl.hpp:72
Definition: stateMachineEngine.hpp:31
log4cplus::Logger & GetLogger(const std::string &name="")
Get handle to a specific logger (used with logging macros)
::elt::mal::future< std::string > SetLogLevel(std::shared_ptr< stdif::LogInfo > const &info) override
Definition: stdCmdsImpl.hpp:88
Class that handles reception of commands using MAL.
Definition: commandReplier.hpp:26
::elt::mal::future< std::string > Stop() override
Definition: stdCmdsImpl.hpp:47
Logging Support Library based on log4cplus.
void RegisterService(std::string const &name, std::shared_ptr< elt::mal::rr::RrEntity > &service)
Definition: commandReplier.hpp:33
::elt::mal::future< std::string > Disable() override
Definition: stdCmdsImpl.hpp:62
::elt::mal::future< std::string > GetVersion() override
Definition: stdCmdsImpl.hpp:77
Provides core functionality of an RTC Component.
::elt::mal::future< std::string > Init() override
Definition: stdCmdsImpl.hpp:42
void PostEvent(rad::SharedEvent s)
Injects a new event into the state machine engine.
Definition: stateMachineEngine.cpp:124
Class that handles reception of stdif commands.
Definition: stdCmdsImpl.hpp:32
::elt::mal::future< std::string > Enable() override
Definition: stdCmdsImpl.hpp:57
static void Register(CommandReplier &replier, StateMachineEngine &engine)
Definition: stdCmdsImpl.hpp:34