RTC Toolkit 5.1.0
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
rtctk::componentFramework::TypedEventSubscriber< EventType > Class Template Reference

An event subscriber that is aware of event types. More...

#include <rtctk/componentFramework/typedEventService.hpp>

Public Member Functions

 ~TypedEventSubscriber ()
 
void Subscribe (std::function< void(const EventType &)> cb)
 Subscribes to an event of a specific type.
 
void Unsubscribe ()
 Unsubscribes from a specified event type.
 

Public Attributes

friend TypedEventService
 

Detailed Description

template<typename EventType>
class rtctk::componentFramework::TypedEventSubscriber< EventType >

An event subscriber that is aware of event types.

Template Parameters
EventTypeThe event type.
Thread Safety
thread-safe
Deprecated
Use EventSubscriberIf instead.

Constructor & Destructor Documentation

◆ ~TypedEventSubscriber()

Member Function Documentation

◆ Subscribe()

template<typename EventType >
void rtctk::componentFramework::TypedEventSubscriber< EventType >::Subscribe ( std::function< void(const EventType &)> cb)
inline

Subscribes to an event of a specific type.

Note
Do not call Publish, Subscribe or Unsubscribe from within the subscrption callback, this will lead to deadlocks!!!
Parameters
[in]cbThe callback with the event object.
Thread Safety
thread-safe

◆ Unsubscribe()

Unsubscribes from a specified event type.

Thread Safety
thread-safe

Member Data Documentation

◆ TypedEventService


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