Skip to content

Latest commit

 

History

History
44 lines (34 loc) · 1.95 KB

File metadata and controls

44 lines (34 loc) · 1.95 KB

SubscriberListener

|SubscriberListener-api| is an abstract class defining the callbacks that will be triggered in response to state changes on the :ref:`dds_layer_subscriber_subscriber`. By default, all these callbacks are empty and do nothing. The user should implement a specialization of this class overriding the callbacks that are needed on the application. Callbacks that are not overridden will maintain their empty implementation.

SubscriberListener inherits from :ref:`dds_layer_subscriber_dataReaderListener`. Therefore, it has the ability to react to all events that are reported to the :ref:`dds_layer_subscriber_dataReader`. Since events are always notified to the most specific Entity Listener that can handle the event, callbacks that SubscriberListener inherits from DataReaderListener will only be called if the triggering DataReader has no Listener attached, or if the callback is disabled by the |StatusMask-api| on the DataReader.

Additionally, SubscriberListener adds the following callback:

Important

For more information about callbacks and its hierarchy, please refer to :ref:`dds_layer_core_entity_commonchars_listener`.

.. literalinclude:: /../code/DDSCodeTester.cpp
   :language: c++
   :start-after: //DDS_SUBSCRIBER_LISTENER_SPECIALIZATION
   :end-before: //!