#include <PolymorphEvent.h>

Public Member Functions | |
| virtual void | send () const =0 |
Protected Member Functions | |
| virtual | ~PolymorphEvent () |
| Need virtual destructor for polymorphic queues. | |
Static Protected Member Functions | |
| template<typename EvType> | |
| static void | sendTypedEvent (const EvType &event) |
struct ConcreteEvent: public PolymorphEvent { // ... your event-specific data and methods ... // ... and the override: virtual void send() const { sendTypedEvent(*this); } };
Definition at line 37 of file PolymorphEvent.h.
| virtual PolymorphEvent::~PolymorphEvent | ( | ) | [inline, protected, virtual] |
| virtual void PolymorphEvent::send | ( | ) | const [pure virtual] |
Causes this event to be sent out to all listeners. The subclass must provide an override so the event can be used polymorphically. This allows you to have a container of PolymorphEvent's of unknown concrete types, e.g. to queue events of different types.
Implemented in cdHeartbeat, cdIncoming, cdResponse, cdShutdown, cdTelemetryFrame, cdInteractiveCommand, dvHeartbeat, dvIncoming, dvResponse, dvQueryMD, dvShutdown, dvTelemetryFrame, mdAttention, mdClientBirth, mdClientDeath, mdDeviceCommand, mdIncoming, mdCDPulse, mdResponse, and mdTelemetryFrame.
| static void PolymorphEvent::sendTypedEvent | ( | const EvType & | event | ) | [inline, static, protected] |
The class derived from PolymorphEvent must override send() to make it call EventSender<EvType>::send(). It can also simply override it by making it call this method, sendTypedEvent, with *this. This method is really just a helper to simplify the syntax required for overriding send().
Definition at line 61 of file PolymorphEvent.h.
1.5.6