13#ifndef RTCTK_EXAMPLECUSTOM_CUSTOMCMDSIMPL_HPP
14#define RTCTK_EXAMPLECUSTOM_CUSTOMCMDSIMPL_HPP
16#include "Rtctkexif.hpp"
17#include "customEvents.rad.hpp"
28namespace cfw = componentFramework;
33 std::shared_ptr<elt::mal::rr::RrEntity> rr_service =
34 std::make_shared<CustomCmdsImpl>(engine);
35 replier.
RegisterService<rtctkexif::AsyncCustomCmds>(
"CustomCmds", rr_service);
42 ::elt::mal::future<std::string>
Foo()
override {
43 LOG4CPLUS_TRACE(m_logger,
"Received command 'Foo'");
44 return cfw::InjectReqRepEvent<events::Foo>(this->m_engine);
47 ::elt::mal::future<std::string>
Bar(std::string
const& args)
override {
48 LOG4CPLUS_TRACE(m_logger,
"Received command 'Bar' with payload '" + args +
"'");
49 return cfw::InjectReqRepEvent<events::Bar>(this->m_engine, args);
53 log4cplus::Logger& m_logger;
Class that handles reception of commands using MAL.
Definition: commandReplier.hpp:29
void RegisterService(std::string const &name, std::shared_ptr< elt::mal::rr::RrEntity > &service)
Definition: commandReplier.hpp:36
Definition: stateMachineEngine.hpp:35
Definition: customCmdsImpl.hpp:30
static void Register(cfw::CommandReplier &replier, cfw::StateMachineEngine &engine)
Definition: customCmdsImpl.hpp:32
CustomCmdsImpl(cfw::StateMachineEngine &engine)
Definition: customCmdsImpl.hpp:38
::elt::mal::future< std::string > Foo() override
Definition: customCmdsImpl.hpp:42
::elt::mal::future< std::string > Bar(std::string const &args) override
Definition: customCmdsImpl.hpp:47
Receive commands via MAL.
Logging Support Library based on log4cplus.
Provides core functionality of an RTC Component.
Definition: commandReplier.cpp:22
log4cplus::Logger & GetLogger(const std::string &name="app")
Get handle to a specific logger.
Definition: logger.cpp:180
Definition: businessLogic.cpp:23
Wrapper around the SCXML State Machine Engine.