SubscribeEvents¶
-
virtual PSubscription IEventSource::SubscribeEvents(const std::vector<PEvent> &events, EventOccurredHandler handler) = 0¶
Subscribes a callback to be executed when any of the selected events occur.
- Parameters
events – Events of this event source that should trigger the callback.
handler – Function to be called when any of the selected events occur.
- Returns
PSubscription – An ISubscription for the callback.
- Throws
CInvalidArgumentException
– Empty vector of events specified.CInvalidArgumentException
– One or more of the selected events are not part of this event source.CInvalidArgumentException
– Empty callback handler specified.COutOfResourcesException
– No resources available to subscribe callback.CCommunicationErrorException
– Protocol error.CConnectionLostException
– Connection to controller lost.CRebootedException
– Controller has been rebooted since this object reference was retrieved, invalidating this reference.CIncompatibleException
– Incompatible firmware version loaded (only applicable if entity is a controller).CObjectDestroyedException
– Object is destroyed (only applicable if entity is disposable).