RTC Toolkit  2.0.0
Public Member Functions | List of all members
rtctk::componentFramework::EventSubscriberIf Class Referenceabstract

Interface class for subscribing to JSON events. More...

#include <eventServiceIf.hpp>

Inheritance diagram for rtctk::componentFramework::EventSubscriberIf:
rtctk::componentFramework::MalDdsEventSubscriber

Public Member Functions

virtual ~EventSubscriberIf ()=default
 
virtual void Subscribe (std::function< void(JsonPayload const &)> cb)=0
 Subscribes to a specified topic. More...
 
virtual void Unsubscribe ()=0
 Unsubscribes from a specified topic. More...
 

Detailed Description

Interface class for subscribing to JSON events.

Constructor & Destructor Documentation

◆ ~EventSubscriberIf()

virtual rtctk::componentFramework::EventSubscriberIf::~EventSubscriberIf ( )
virtualdefault

Member Function Documentation

◆ Subscribe()

virtual void rtctk::componentFramework::EventSubscriberIf::Subscribe ( std::function< void(JsonPayload const &)>  cb)
pure virtual

Subscribes to a specified topic.

Only a single callback can be registered per subscriber.

Note
Do not Publish, Subscribe or Unsubscribe from within the subscrption callback, this will lead to deadlocks!!!
Parameters
[in]cbThe callback returning the JSON object.

Implemented in rtctk::componentFramework::MalDdsEventSubscriber.

◆ Unsubscribe()

virtual void rtctk::componentFramework::EventSubscriberIf::Unsubscribe ( )
pure virtual

Unsubscribes from a specified topic.

Implemented in rtctk::componentFramework::MalDdsEventSubscriber.


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