|
| void | registerHandler (MessageType type, IMessageHandler *handler) |
| | Registers a handler for a specific message type.
|
| |
| bool | dispatch (const std::string &messageId, const std::string &payload, MessageType type, System &system) |
| | Dispatches a message to the appropriate handler.
|
| |
| bool | hasHandler (MessageType type) const |
| | Checks if a handler is registered for a message type.
|
| |
| size_t | getHandlerCount () const |
| | Gets the number of registered handlers.
|
| |
◆ dispatch()
| bool HandlerDispatcher::dispatch |
( |
const std::string & |
messageId, |
|
|
const std::string & |
payload, |
|
|
MessageType |
type, |
|
|
System & |
system |
|
) |
| |
Dispatches a message to the appropriate handler.
- Parameters
-
| messageId | The message ID |
| payload | The message payload |
| type | The message type |
| system | Reference to the system |
- Returns
- true if handler was found and executed, false otherwise
◆ getHandlerCount()
| size_t HandlerDispatcher::getHandlerCount |
( |
| ) |
const |
Gets the number of registered handlers.
- Returns
- Number of handlers
◆ hasHandler()
| bool HandlerDispatcher::hasHandler |
( |
MessageType |
type | ) |
const |
Checks if a handler is registered for a message type.
- Parameters
-
- Returns
- true if handler exists
◆ registerHandler()
| void HandlerDispatcher::registerHandler |
( |
MessageType |
type, |
|
|
IMessageHandler * |
handler |
|
) |
| |
Registers a handler for a specific message type.
- Parameters
-
| type | The message type to handle |
| handler | Pointer to the handler (not owned by dispatcher) |
The documentation for this class was generated from the following files: