13#ifndef RTCTK_EXAMPLECUSTOM_CUSTOMCMDSIMPL_HPP
14#define RTCTK_EXAMPLECUSTOM_CUSTOMCMDSIMPL_HPP
16#include "Rtctkexif.hpp"
17#include "customEvents.rad.hpp"
28namespace cfw = componentFramework;
32 static void Register(cfw::CommandReplier& replier, cfw::StateMachineEngine& engine) {
33 std::shared_ptr<elt::mal::rr::RrEntity> rr_service =
34 std::make_shared<CustomCmdsImpl>(engine);
35 replier.RegisterService<rtctkexif::AsyncCustomCmds>(
"CustomCmds", rr_service);
39 : m_logger(cfw::
GetLogger(
"app")), m_engine(engine) {
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(
const std::string& 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;
54 cfw::StateMachineEngine& m_engine;
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 > Bar(const std::string &args) override
Definition customCmdsImpl.hpp:47
::elt::mal::future< std::string > Foo() override
Definition customCmdsImpl.hpp:42
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:192
Definition businessLogic.cpp:23
Wrapper around the SCXML State Machine Engine.