Class EventConsumer

Class Documentation

class EventConsumer

Simple wrapper for a function that consumes an event.

Public Functions

inline EventConsumer(std::function<void(Event&)> consumer)

Create an event consumer.

Parameters:

consumer – The function to call when an event is received

inline EventConsumer()

Create an empty event consumer that does nothing.

inline void Consume(Event &event)

Consume an event.

Forwards the event to the consuming function

inline bool operator==(const EventConsumer &rhs) const

Check if two EventConsumers are equal.

Compares GUIDs (which should basically never overlap)