5 #ifndef DDS_INTERCOM_H_ 6 #define DDS_INTERCOM_H_ 13 #include <boost/property_tree/json_parser.hpp> 14 #include <boost/signals2/signal.hpp> 18 namespace internal_api
20 class CIntercomServiceCore;
34 namespace intercom_api
54 void start(
const std::string& _sessionID =
"");
63 std::shared_ptr<internal_api::CIntercomServiceCore> m_impl;
73 typedef boost::signals2::signal<void(
74 const std::string& ,
const std::string& , uint64_t )>
82 void putValue(
const std::string& _key,
const std::string& _value);
83 void subscribe(signal_t::slot_function_type _subscriber);
97 typedef boost::signals2::signal<void(
98 const std::string& ,
const std::string& , uint64_t )>
107 void send(
const std::string& _command,
const std::string& _condition);
108 void subscribe(signal_t::slot_function_type _subscriber);
138 return _os <<
"info";
141 return _os <<
"error";
157 void fromJSON(
const std::string& _json);
161 void fromPT(
const boost::property_tree::ptree& _pt);
185 void fromJSON(
const std::string& _json);
189 void fromPT(
const boost::property_tree::ptree& _pt);
211 void fromJSON(
const std::string& _json);
215 void fromPT(
const boost::property_tree::ptree& _pt);
271 void onSubmit(signalSubmit_t::slot_function_type _subscriber);
275 void onMessage(signalMessage_t::slot_function_type _subscriber);
291 void start(
bool _block =
true);
299 void notify(std::istream& _stream);
std::string m_cfgFilePath
Path to the configuration file.
Definition: Intercom.h:168
Structure holds information of submit notification.
Definition: Intercom.h:146
bool operator==(const SSubmit &_val) const
Equality operator.
Definition: dds_rms_plugin_protocol.cpp:86
void fromPT(const boost::property_tree::ptree &_pt)
Init structure from boost's property tree.
Definition: dds_rms_plugin_protocol.cpp:167
~CKeyValue()
Definition: Intercom.cpp:61
void fromJSON(const std::string &_json)
Init structure from JSON.
Definition: dds_rms_plugin_protocol.cpp:159
std::string m_id
ID for communication with DDS commander.
Definition: Intercom.h:220
Structure holds information of message notification.
Definition: Intercom.h:174
Definition: Intercom.h:93
void fromPT(const boost::property_tree::ptree &_pt)
Init structure from boost's property tree.
Definition: dds_rms_plugin_protocol.cpp:125
boost::signals2::signal< void(const std::string &, const std::string &, uint64_t)> signal_t
Definition: Intercom.h:75
bool operator==(const SInit &_val) const
Equality operator.
Definition: dds_rms_plugin_protocol.cpp:173
SSubmit()
Default constructor.
Definition: dds_rms_plugin_protocol.cpp:41
uint32_t m_nInstances
A number of instances.
Definition: Intercom.h:166
boost::signals2::signal< void(const std::string &, const std::string &, uint64_t)> signal_t
Definition: Intercom.h:99
void start(bool _block=true)
Send initial request to the commander and start listening for notifications.
Definition: dds_rms_plugin_protocol.cpp:221
EMsgSeverity m_msgSeverity
Message severity.
Definition: Intercom.h:194
std::string m_id
ID for communication with DDS commander.
Definition: Intercom.h:196
uint32_t m_slots
A number of task slots.
Definition: Intercom.h:167
void start(const std::string &_sessionID="")
Start DDS service, i.e. receiving and sending messages.
Definition: Intercom.cpp:37
boost::signals2::signal< void(const SMessage &)> signalMessage_t
Callback function for message notifications.
Definition: Intercom.h:258
const std::string g_sRmsAgentSign
Sign that is send to commander if RMS plug-in is connecting to it.
Definition: Intercom.h:121
void send(const std::string &_command, const std::string &_condition)
Definition: Intercom.cpp:97
CKeyValue(CIntercomService &_service)
Definition: Intercom.cpp:56
void fromJSON(const std::string &_json)
Init structure from JSON.
Definition: dds_rms_plugin_protocol.cpp:68
boost::signals2::signal< void(const SSubmit &)> signalSubmit_t
Callback function for submit notifications.
Definition: Intercom.h:255
void unsubscribe()
Definition: Intercom.cpp:77
void onMessage(signalMessage_t::slot_function_type _subscriber)
Subscribe for message notifications.
Definition: dds_rms_plugin_protocol.cpp:210
Miscellaneous functions and helpers are located here.
Definition: AgentConnectionManager.h:13
Definition: Intercom.h:39
const std::string g_sToolsAPISign
Sign that is send to commander if Tools-API is connecting to it.
Definition: Intercom.h:123
void subscribeOnReply(replySignal_t::slot_function_type _subscriber)
Definition: Intercom.cpp:108
boost::signals2::signal< void(const std::string &)> replySignal_t
Definition: Intercom.h:100
void fromPT(const boost::property_tree::ptree &_pt)
Init structure from boost's property tree.
Definition: dds_rms_plugin_protocol.cpp:76
void subscribe(signal_t::slot_function_type _subscriber)
Definition: Intercom.cpp:71
void subscribeOnError(errorSignal_t::slot_function_type _subscriber)
Subscribe on error messages from DDS intercom service.
Definition: Intercom.cpp:25
void subscribe(signal_t::slot_function_type _subscriber)
Definition: Intercom.cpp:102
void sendMessage(EMsgSeverity _severity, const std::string &_msg)
Send message to DDS commander.
Definition: dds_rms_plugin_protocol.cpp:241
std::string m_id
ID for communication with DDS commander.
Definition: Intercom.h:169
void waitCondition()
Definition: Intercom.cpp:42
Definition: Intercom.h:69
std::string m_wrkPackagePath
A full path of the agent worker package, which needs to be deployed.
Definition: Intercom.h:170
EMsgSeverity
Enumeration with message severity.
Definition: Intercom.h:126
std::string toJSON()
Converts structure to JSON.
Definition: dds_rms_plugin_protocol.cpp:52
CCustomCmd(CIntercomService &_service)
Definition: Intercom.cpp:87
Class implements basic API for DDS RMS plug-ins.
Definition: Intercom.h:251
void notify(std::istream &_stream)
Parse the input stream and notify subscribers.
Definition: dds_rms_plugin_protocol.cpp:250
SMessage()
Default constructor.
Definition: dds_rms_plugin_protocol.cpp:96
void subscribeOnTaskDone(taskDoneSignal_t::slot_function_type _subscriber)
Subscribe on Task Done events.
Definition: Intercom.cpp:31
void fromJSON(const std::string &_json)
Init structure from JSON.
Definition: dds_rms_plugin_protocol.cpp:117
Structure holds information of init notification.
Definition: Intercom.h:200
std::string toJSON()
Converts structure to JSON.
Definition: dds_rms_plugin_protocol.cpp:103
CRMSPluginProtocol(const std::string &_id)
Constructor with ID.
Definition: dds_rms_plugin_protocol.cpp:182
void stop()
Stop waiting.
Definition: dds_rms_plugin_protocol.cpp:236
SInit()
Default constructor.
Definition: dds_rms_plugin_protocol.cpp:142
boost::signals2::signal< void(uint64_t, uint32_t)> taskDoneSignal_t
Definition: Intercom.h:43
std::string toJSON()
Converts structure to JSON.
Definition: dds_rms_plugin_protocol.cpp:146
void putValue(const std::string &_key, const std::string &_value)
Definition: Intercom.cpp:66
CIntercomService()
Definition: Intercom.cpp:15
bool operator==(const SMessage &_val) const
Equality operator.
Definition: dds_rms_plugin_protocol.cpp:133
~CRMSPluginProtocol()
Destructor.
Definition: dds_rms_plugin_protocol.cpp:199
void unsubscribe()
Definition: Intercom.cpp:114
std::ostream & operator<<(std::ostream &_os, EMsgSeverity _severity)
Support ostreaming EMsgSeverity.
Definition: Intercom.h:133
void onSubmit(signalSubmit_t::slot_function_type _subscriber)
Subscribe for submit notifications.
Definition: dds_rms_plugin_protocol.cpp:205
std::string m_msg
Message text.
Definition: Intercom.h:195
~CIntercomService()
Definition: Intercom.cpp:20
~CCustomCmd()
Definition: Intercom.cpp:92
void stopCondition()
Definition: Intercom.cpp:47