5 #ifndef DDS_INTERCOM_SERVICE_CORE_H 6 #define DDS_INTERCOM_SERVICE_CORE_H 16 #include <boost/signals2/signal.hpp> 20 namespace internal_api
24 typedef boost::signals2::signal<void(
25 const std::string& ,
const std::string& , uint64_t )>
32 typedef boost::signals2::signal<void(
33 const std::string& ,
const std::string& , uint64_t )>
42 using ptr_t = std::shared_ptr<CIntercomServiceCore>;
62 void sendCustomCmd(
const std::string& _command,
const std::string& _condition);
63 void putValue(
const std::string& _key,
const std::string& _value);
71 void start(
const std::string& _sessionID);
76 void on_cmdUPDATE_KEY_SM(
79 void on_cmdUSER_TASK_DONE_SM(
82 void on_cmdCUSTOM_CMD_SM(
85 void on_cmdSIMPLE_MSG_SM(
89 void setupSMChannel();
90 void setupChannel(
const std::string& _sessionID);
92 template <
class Signal_t,
typename... Args>
93 void execUserSignal(Signal_t& _signal, Args&&... args)
99 catch (std::exception& _e)
101 std::string msg(
"Exception in user code: ");
103 if (!std::is_same<Signal_t, intercom_api::errorSignal_t>::value)
119 boost::asio::io_context m_io_context;
120 boost::thread_group m_workerThreads;
123 std::atomic<bool> m_started;
std::shared_ptr< CAgentChannel > connectionPtr_t
Definition: BaseChannelImpl.h:229
boost::signals2::signal< void(uint64_t, uint32_t)> keyValueTaskDoneSignal_t
Definition: IntercomServiceCore.h:28
Definition: BaseEventHandlersImpl.h:48
boost::signals2::signal< void(const std::string &, const std::string &, uint64_t)> customCmdSignal_t
Definition: IntercomServiceCore.h:34
boost::signals2::signal< void(const std::string &)> customCmdReplySignal_t
Definition: IntercomServiceCore.h:35
connection_t connectKeyValue(keyValueSignal_t::slot_function_type _subscriber)
Definition: IntercomServiceCore.cpp:243
connection_t connectKeyValueTaskDone(keyValueTaskDoneSignal_t::slot_function_type _subscriber)
Definition: IntercomServiceCore.cpp:248
void waitCondition()
Definition: IntercomServiceCore.cpp:406
std::shared_ptr< SEmptyCmd > ptr_t
Definition: CommandAttachmentImpl.h:64
~CIntercomServiceCore()
Definition: IntercomServiceCore.cpp:34
Helper class for conditional events.
Definition: ConditionEvent.h:17
Exception in the user code.
Definition: IntercomErrorCodes.h:27
#define LOG(severity)
Definition: Logger.h:34
static void clean()
Definition: IntercomServiceCore.cpp:395
connection_t connectCustomCmd(customCmdSignal_t::slot_function_type _subscriber)
Definition: IntercomServiceCore.cpp:233
Definition: IntercomServiceCore.h:39
std::shared_ptr< CSMAgentChannel > connectionPtr_t
Definition: BaseSMChannelImpl.h:188
boost::signals2::signal< void(const std::string &, const std::string &, uint64_t)> keyValueSignal_t
Definition: IntercomServiceCore.h:26
Miscellaneous functions and helpers are located here.
Definition: AgentConnectionManager.h:13
CIntercomServiceCore()
Definition: IntercomServiceCore.cpp:20
void disconnectKeyValue()
Definition: IntercomServiceCore.cpp:262
std::shared_ptr< CIntercomServiceCore > ptr_t
Definition: IntercomServiceCore.h:42
void stopCondition()
Definition: IntercomServiceCore.cpp:417
void sendCustomCmd(const std::string &_command, const std::string &_condition)
Definition: IntercomServiceCore.cpp:323
void putValue(const std::string &_key, const std::string &_value)
Definition: IntercomServiceCore.cpp:364
boost::signals2::connection connection_t
Definition: IntercomServiceCore.h:37
void disconnectCustomCmd()
Definition: IntercomServiceCore.cpp:253
void stop()
Definition: IntercomServiceCore.cpp:204
connection_t connectError(intercom_api::errorSignal_t::slot_function_type _subscriber)
Definition: IntercomServiceCore.cpp:228
connection_t connectCustomCmdReply(customCmdReplySignal_t::slot_function_type _subscriber)
Definition: IntercomServiceCore.cpp:238
boost::signals2::signal< void(EErrorCode, const std::string &)> errorSignal_t
Definition: IntercomErrorCodes.h:30
CIntercomServiceCore & operator=(const CIntercomServiceCore &)=delete
void start(const std::string &_sessionID)
Definition: IntercomServiceCore.cpp:38