12#ifndef RTCTK_EXAMPLECUSTOM_CUSTOMCMDSIMPL_HPP
13#define RTCTK_EXAMPLECUSTOM_CUSTOMCMDSIMPL_HPP
15#include "Rtctkexif.hpp"
16#include "customEvents.rad.hpp"
27namespace cfw = componentFramework;
31 static void Register(cfw::CommandReplier& replier, cfw::StateMachineEngine& engine) {
32 std::shared_ptr<elt::mal::rr::RrEntity> rr_service =
33 std::make_shared<CustomCmdsImpl>(engine);
34 replier.RegisterService<rtctkexif::AsyncCustomCmds>(
"CustomCmds", rr_service);
38 : m_logger(cfw::
GetLogger(
"app")), m_engine(engine) {
41 ::elt::mal::future<std::string>
Foo()
override {
42 LOG4CPLUS_TRACE(m_logger,
"Received command 'Foo'");
43 return cfw::InjectReqRepEvent<events::Foo>(this->m_engine);
46 ::elt::mal::future<std::string>
Bar(
const std::string& args)
override {
47 LOG4CPLUS_TRACE(m_logger,
"Received command 'Bar' with payload '" + args +
"'");
48 return cfw::InjectReqRepEvent<events::Bar>(this->m_engine, args);
52 log4cplus::Logger& m_logger;
53 cfw::StateMachineEngine& m_engine;
static void Register(cfw::CommandReplier &replier, cfw::StateMachineEngine &engine)
Definition customCmdsImpl.hpp:31
CustomCmdsImpl(cfw::StateMachineEngine &engine)
Definition customCmdsImpl.hpp:37
::elt::mal::future< std::string > Bar(const std::string &args) override
Definition customCmdsImpl.hpp:46
::elt::mal::future< std::string > Foo() override
Definition customCmdsImpl.hpp:41
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
Definition businessLogic.cpp:22
Wrapper around the SCXML State Machine Engine.