Struct EventPublisher::Subscriber

Nested Relationships

This struct is a nested type of Class EventPublisher.

Inheritance Relationships

Derived Types

Struct Documentation

struct Subscriber

Subscribers to the event/message dispatcher will implement this interface.

Subclassed by gpa::playback::DefaultPlaybackSubscriber, gpa::playback::MetricsExtractor, gpa::runtime::ActionPublisher

Public Functions

virtual ~Subscriber()
virtual void OnEvent(char const *topic, EventData const &event) = 0

When an event/message is available on a topic for which this subscriber has registered, it will be delivered via this method.

Note

If the data in the event/message needs to be used beyond the scope of this method, the implementation should copy the relevant contents of the event/message and not attempt to cache the event object itself, as there is no guarantee that the event object will be available beyond this method's return.

Parameters
  • topic -- Name of the topic ("channel") on which the event was published.

  • event -- The event data. The implementation should use the EventData::ID() method to determine the actual event/message type, and cast accordingly.