RTC Toolkit 5.1.0
Loading...
Searching...
No Matches
Public Member Functions | List of all members
rtctk::componentFramework::EventSubscriberIf Class Referenceabstract

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

#include <rtctk/componentFramework/eventServiceIf.hpp>

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

Public Member Functions

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

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(const JsonPayload &)> 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 MockEventSubscriber, rtctk::componentFramework::MalDdsEventSubscriber, and MockEventSubscriber.

◆ 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: