![]() |
|
Uniot Core
|
| 0.8.1 |
#include <EventEmitter.h>
Public Member Functions | |
| virtual | ~EventEmitter ()=default |
| Virtual destructor to ensure proper cleanup of derived classes. | |
| virtual type_id | getTypeId () const override |
| Returns the type identifier for this EventEmitter. | |
| void | emitEvent (T_topic topic, T_msg msg) |
| Emits an event to all registered event buses. | |
Public Member Functions inherited from uniot::EventEntity< T_topic, T_msg, T_data > | |
| virtual | ~EventEntity () |
| Destructor - disconnects from all connected EventBus instances. | |
| bool | sendDataToChannel (T_topic channel, T_data data) |
| Sends data to a specific channel on all connected EventBus instances. | |
| void | receiveDataFromChannel (T_topic channel, DataChannelCallback callback) |
| Receives data from a specific channel on all connected EventBus instances. | |
Additional Inherited Members | |
Public Types inherited from uniot::EventEntity< T_topic, T_msg, T_data > | |
| using | DataChannelCallback = std::function<void(unsigned int, bool, T_data)> |
| Callback type for handling data received from channels. | |
Protected Member Functions inherited from uniot::EventEntity< T_topic, T_msg, T_data > | |
| bool | connectUnique (EventBus< T_topic, T_msg, T_data > *eventBus) |
| Connects to an EventBus instance if not already connected. | |
Protected Attributes inherited from uniot::EventEntity< T_topic, T_msg, T_data > | |
| IterableQueue< EventBus< T_topic, T_msg, T_data > * > | mEventBusQueue |
| Queue of EventBus instances this entity is connected to. | |
|
virtualdefault |
Virtual destructor to ensure proper cleanup of derived classes.
| void uniot::EventEmitter< T_topic, T_msg, T_data >::emitEvent | ( | T_topic | topic, |
| T_msg | msg ) |
Emits an event to all registered event buses.
Broadcasts the specified event (topic and message) to all event buses that have been registered with this emitter.
| topic | The topic of the event |
| msg | The message/code of the event |
|
inlineoverridevirtual |
Returns the type identifier for this EventEmitter.
Implements the base class virtual method to enable type identification via the Type system.
| type_id | The unique type identifier for this EventEmitter specialization |
Reimplemented from uniot::EventEntity< T_topic, T_msg, T_data >.
Reimplemented in uniot::EventListener< T_topic, T_msg, T_data >, uniot::EventListener< unsigned int, int, Bytes >, and uniot::EventListener< unsigned int, int, Bytes >.