Messaging service for PicoScenes platform.
More...
#include <PicoScenesMessagingService.hxx>
|
| void | append2MessageQueue (const UniversalMessageType &message) |
| | Add message to queue.
|
| |
| void | clearMessageQueue () |
| | Clear all pending messages @thread_safety Thread-safe operation.
|
| |
| void | send (const ModularPicoScenesRxFrame &rxFrame, const std::string &destination, const std::string &source, const std::string &description="") |
| | Send Rx frame message.
|
| |
| void | send (const ModularPicoScenesTxFrame &txFrame, const std::string &destination, const std::string &source, const std::string &description="") |
| | Send Tx frame message.
|
| |
| void | send (const std::string &textContent, const std::string &destination, const std::string &source, const std::string &description="") |
| | Send text message.
|
| |
| void | send (const pt::ptree &ptree, const std::string &destination, const std::string &source, const std::string &description="") |
| | Send property tree message.
|
| |
| void | send (const U8Vector &data, const std::string &destination, const std::string &source, const std::string &description="") |
| | Send binary data message (vector)
|
| |
| void | send (const uint8_t *data, size_t bufferLength, const std::string &destination, const std::string &source, const std::string &description="") |
| | Send binary data message (raw buffer)
|
| |
| void | registerMessageHandler (const std::string &handlerName, std::function< void(const UniversalMessageType &)> handler) |
| | Register message handler.
|
| |
| void | unregisterHandler (const std::string &handlerName) |
| | Unregister message handler.
|
| |
|
| static std::shared_ptr< PicoScenesMessagingService > | getInstance (const std::string &messagingChannelId="default") |
| | Get singleton instance for specified channel.
|
| |
| static UniversalMessageType | makeMessage (const std::any &object, const std::string &destination, const std::string &source, const std::string &description) |
| | Create a universal message.
|
| |
Messaging service for PicoScenes platform.
Implements a singleton-based messaging system that supports:
- Multiple message channels
- Various message types (frames, text, binary data)
- Thread-safe message handling
- Dynamic handler registration
Definition at line 30 of file PicoScenesMessagingService.hxx.
◆ append2MessageQueue()
Add message to queue.
- Parameters
-
| message | Message to append @thread_safety Thread-safe operation |
◆ clearMessageQueue()
| void PicoScenesMessagingService::clearMessageQueue |
( |
| ) |
|
Clear all pending messages @thread_safety Thread-safe operation.
◆ getInstance()
| static std::shared_ptr< PicoScenesMessagingService > PicoScenesMessagingService::getInstance |
( |
const std::string & |
messagingChannelId = "default" | ) |
|
|
static |
Get singleton instance for specified channel.
- Parameters
-
| messagingChannelId | Channel identifier (defaults to "default") |
- Returns
- Shared pointer to messaging service instance
◆ makeMessage()
| static UniversalMessageType PicoScenesMessagingService::makeMessage |
( |
const std::any & |
object, |
|
|
const std::string & |
destination, |
|
|
const std::string & |
source, |
|
|
const std::string & |
description |
|
) |
| |
|
static |
Create a universal message.
- Parameters
-
| object | Message payload |
| destination | Target identifier |
| source | Sender identifier |
| description | Message description |
- Returns
- Constructed universal message
◆ registerMessageHandler()
| void PicoScenesMessagingService::registerMessageHandler |
( |
const std::string & |
handlerName, |
|
|
std::function< void(const UniversalMessageType &)> |
handler |
|
) |
| |
Register message handler.
- Parameters
-
| handlerName | Unique handler identifier |
| handler | Handler function @thread_safety Thread-safe operation |
◆ send() [1/6]
| void PicoScenesMessagingService::send |
( |
const ModularPicoScenesRxFrame & |
rxFrame, |
|
|
const std::string & |
destination, |
|
|
const std::string & |
source, |
|
|
const std::string & |
description = "" |
|
) |
| |
Send Rx frame message.
- Parameters
-
| rxFrame | Receive frame to send |
| destination | Target identifier |
| source | Sender identifier |
| description | Optional message description |
◆ send() [2/6]
| void PicoScenesMessagingService::send |
( |
const ModularPicoScenesTxFrame & |
txFrame, |
|
|
const std::string & |
destination, |
|
|
const std::string & |
source, |
|
|
const std::string & |
description = "" |
|
) |
| |
Send Tx frame message.
- Parameters
-
| txFrame | Transmit frame to send |
| destination | Target identifier |
| source | Sender identifier |
| description | Optional message description |
◆ send() [3/6]
| void PicoScenesMessagingService::send |
( |
const pt::ptree & |
ptree, |
|
|
const std::string & |
destination, |
|
|
const std::string & |
source, |
|
|
const std::string & |
description = "" |
|
) |
| |
Send property tree message.
- Parameters
-
| ptree | Property tree to send |
| destination | Target identifier |
| source | Sender identifier |
| description | Optional message description |
◆ send() [4/6]
| void PicoScenesMessagingService::send |
( |
const std::string & |
textContent, |
|
|
const std::string & |
destination, |
|
|
const std::string & |
source, |
|
|
const std::string & |
description = "" |
|
) |
| |
Send text message.
- Parameters
-
| textContent | Text content to send |
| destination | Target identifier |
| source | Sender identifier |
| description | Optional message description |
◆ send() [5/6]
| void PicoScenesMessagingService::send |
( |
const U8Vector & |
data, |
|
|
const std::string & |
destination, |
|
|
const std::string & |
source, |
|
|
const std::string & |
description = "" |
|
) |
| |
Send binary data message (vector)
- Parameters
-
| data | Binary data vector |
| destination | Target identifier |
| source | Sender identifier |
| description | Optional message description |
◆ send() [6/6]
| void PicoScenesMessagingService::send |
( |
const uint8_t * |
data, |
|
|
size_t |
bufferLength, |
|
|
const std::string & |
destination, |
|
|
const std::string & |
source, |
|
|
const std::string & |
description = "" |
|
) |
| |
Send binary data message (raw buffer)
- Parameters
-
| data | Pointer to data buffer |
| bufferLength | Length of buffer |
| destination | Target identifier |
| source | Sender identifier |
| description | Optional message description |
◆ unregisterHandler()
| void PicoScenesMessagingService::unregisterHandler |
( |
const std::string & |
handlerName | ) |
|
Unregister message handler.
- Parameters
-
| handlerName | Handler identifier to remove @thread_safety Thread-safe operation |
The documentation for this class was generated from the following file: