38template <
class T_topic,
class T_msg,
class T_data>
54template <
class T_topic,
class T_msg,
class T_data>
56 friend class EventBus<T_topic, T_msg, T_data>;
99 auto sentSomewhere =
false;
102 sentSomewhere |= sent;
105 return sentSomewhere;
122 callback(eventBus->
getId(), empty, data);
143 if (connectedEventBus->getId() == eventBus->
getId()) {
Definition IterableQueue.h:36
unsigned int getId()
Gets the unique identifier of this EventBus.
Definition EventBus.h:94
T_data receiveDataFromChannel(T_topic topic)
Receives data from a specific data channel.
Definition EventBus.cpp:76
bool sendDataToChannel(T_topic topic, T_data data)
Sends data to a specific data channel.
Definition EventBus.cpp:71
bool isDataChannelEmpty(T_topic topic)
Checks if a data channel is empty.
Definition EventBus.cpp:81
Entity that can connect to and interact with EventBus instances.
Definition EventEntity.h:55
std::function< void(unsigned int, bool, T_data)> DataChannelCallback
Callback type for handling data received from channels.
Definition EventEntity.h:66
void receiveDataFromChannel(T_topic channel, DataChannelCallback callback)
Receives data from a specific channel on all connected EventBus instances.
Definition EventEntity.h:117
bool sendDataToChannel(T_topic channel, T_data data)
Sends data to a specific channel on all connected EventBus instances.
Definition EventEntity.h:98
virtual ~EventEntity()
Destructor - disconnects from all connected EventBus instances.
Definition EventEntity.cpp:27
bool connectUnique(EventBus< T_topic, T_msg, T_data > *eventBus)
Connects to an EventBus instance if not already connected.
Definition EventEntity.h:139
virtual type_id getTypeId() const override
Returns the type ID of this class.
Definition EventEntity.h:83
IterableQueue< EventBus< T_topic, T_msg, T_data > * > mEventBusQueue
Queue of EventBus instances this entity is connected to.
Definition EventEntity.h:158
Interface for objects that expose their runtime type information.
Definition TypeId.h:52
static type_id getTypeId()
Get the unique type identifier for a given type T.
Definition TypeId.h:82
#define UNIOT_LOG_INFO(...)
Log an INFO level message Used for general information about system operation. Only compiled if UNIOT...
Definition Logger.h:268
const void * type_id
Type alias for a unique type identifier.
Definition TypeId.h:43
Contains all classes and functions related to the Uniot Core.