CallbackEventListener
The CallbackEventListener class provides a mechanism for handling events by allowing the registration of callback functions. This enables to define custom behaviors that should occur when specific events are emitted, without the need to create specialized listener classes.
Template Parameters:
T_topicThe type representing the event topic.T_msgThe type representing the event message.T_dataThe type representing the data associated with the event.
Methods:
CallbackEventListener(EventListenerCallback callback)Constructs aCallbackEventListenerwith the specified callback function.void onEventReceived(T_topic topic, T_msg msg)Invoked when an event matching the subscribed topic is received. Executes the registered callback function with the event's topic and message.topic(T_topic): The topic of the received event.msg(T_msg): The message associated with the received event.
Private Members:
EventListenerCallback mCallbackStores the callback function to be executed upon receiving an event.
Last updated