![]() |
XII Release 0.1.0
|
A protocol wrapper around xiiIpcChannel to send and receive reflected messages instead of raw byte arrays. More...
#include <IpcProcessMessageProtocol.h>
Classes | |
| struct | Event |
| Event data structure for message notifications. More... | |
Public Member Functions | |
| xiiIpcProcessMessageProtocol (xiiIpcChannel *pChannel) | |
| Constructs the protocol wrapper for a given IPC channel. | |
| ~xiiIpcProcessMessageProtocol () | |
| Destructor. Cleans up any queued messages and detaches from the channel. | |
| bool | Send (xiiProcessMessage *pMsg) |
| Sends a reflected process message over the IPC channel. | |
| bool | ProcessMessages () |
| Processes all pending incoming messages. | |
| xiiResult | WaitForMessages (xiiTime timeout=xiiTime::MakeZero()) |
| Waits for new messages to arrive and processes them. | |
Public Attributes | |
| xiiEvent< const Event & > | m_MessageEvent |
| Event fired when a new message is processed. | |
A protocol wrapper around xiiIpcChannel to send and receive reflected messages instead of raw byte arrays.
This class hooks into an existing xiiIpcChannel instance to provide a high-level messaging protocol using reflected messages derived from xiiProcessMessage. The underlying xiiIpcChannel remains responsible for all connection logic, while this protocol focuses solely on message serialization, deserialization, and dispatch.
Received messages are stored in an internal queue and must be processed explicitly by calling ProcessMessages() or WaitForMessages().
| xiiIpcProcessMessageProtocol::xiiIpcProcessMessageProtocol | ( | xiiIpcChannel * | pChannel | ) |
Constructs the protocol wrapper for a given IPC channel.
| pChannel | - Pointer to an existing xiiIpcChannel instance. The channel must remain valid for the lifetime of this protocol object. |
| bool xiiIpcProcessMessageProtocol::ProcessMessages | ( | ) |
Processes all pending incoming messages.
This method dequeues all received messages and broadcasts them via m_MessageEvent. It is not re-entrant; calling it from within a message handler is not supported.
| bool xiiIpcProcessMessageProtocol::Send | ( | xiiProcessMessage * | pMsg | ) |
Sends a reflected process message over the IPC channel.
| pMsg | - Pointer to the message to send. Ownership is not transferred; the message can be safely destroyed after this call returns. |
| xiiResult xiiIpcProcessMessageProtocol::WaitForMessages | ( | xiiTime | timeout = xiiTime::MakeZero() | ) |
Waits for new messages to arrive and processes them.
This method blocks until either a message is received or the specified timeout elapses. Once unblocked, it calls ProcessMessages() to handle all queued messages.
| timeout | Maximum time to wait for a message. Defaults to zero (non-blocking). |
Event fired when a new message is processed.
This event is triggered from the thread calling ProcessMessages() or WaitForMessages().