Uniot Core
0.8.1
Loading...
Searching...
No Matches
uniot::EventEmitter< T_topic, T_msg, T_data > Class Template Reference

#include <EventEmitter.h>

Inheritance diagram for uniot::EventEmitter< T_topic, T_msg, T_data >:
[legend]

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.
 

Constructor & Destructor Documentation

◆ ~EventEmitter()

template<class T_topic, class T_msg, class T_data>
virtual uniot::EventEmitter< T_topic, T_msg, T_data >::~EventEmitter ( )
virtualdefault

Virtual destructor to ensure proper cleanup of derived classes.

Member Function Documentation

◆ emitEvent()

template<class T_topic, class T_msg, class T_data>
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.

Parameters
topicThe topic of the event
msgThe message/code of the event

◆ getTypeId()

template<class T_topic, class T_msg, class T_data>
virtual type_id uniot::EventEmitter< T_topic, T_msg, T_data >::getTypeId ( ) const
inlineoverridevirtual

Returns the type identifier for this EventEmitter.

Implements the base class virtual method to enable type identification via the Type system.

Return values
type_idThe 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 >.


The documentation for this class was generated from the following files: