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);
73 LOG4CPLUS_TRACE(
GetLogger(),
"Received command 'GetVersion'");
74 return InjectReqRepEvent<events::GetVersion>(m_engine);
77 ::elt::mal::future<std::string>
Exit()
override {
78 LOG4CPLUS_TRACE(
GetLogger(),
"Received command 'Exit'");
79 return InjectReqRepEvent<events::Exit>(m_engine);
82 ::elt::mal::future<std::string>
SetLogLevel(
const std::string& level)
override {
83 LOG4CPLUS_TRACE(
GetLogger(),
"Received command 'SetLogLevel' with payload '" + level +
"'");
84 return InjectReqRepEvent<events::SetLogLevel>(m_engine, level);
93 #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:77
Wrapper around the SCXML State Machine Engine.
Definition: commandReplier.cpp:20
::elt::mal::future< std::string > Reset() override
Definition: stdCmdsImpl.hpp:52
Definition: stateMachineEngine.hpp:31
log4cplus::Logger & GetLogger(const std::string &name="")
Get handle to a specific logger (used with logging macros)
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 > SetLogLevel(const std::string &level) override
Definition: stdCmdsImpl.hpp:82
::elt::mal::future< std::string > GetVersion() override
Definition: stdCmdsImpl.hpp:72
Provides core functionality of an RTC Component.
::elt::mal::future< std::string > Init() override
Definition: stdCmdsImpl.hpp:42
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