ADTF  3.18.2
IEventSinkabstract

The class IEventSink provides a generic event listener interface for Internal Events. More...

Public Member Functions

 ADTF_IID (IEventSink, "event_sink.ant.ucom.adtf.iid")
 Marks the IEventSink to be castable with the ucom_cast<> More...
 
virtual tResult HandleEvent (const IEventSource &oSource, const void *pvEventData)=0
 Handle event. More...
 

Protected Member Functions

 ~IEventSink ()=default
 Protected destructor --> Use implemented Destroy() instead of delete!
 

Detailed Description

The class IEventSink provides a generic event listener interface for Internal Events.

Definition at line 26 of file event_source_intf.h.

Member Function Documentation

◆ ADTF_IID()

ADTF_IID ( IEventSink  ,
"event_sink.ant.ucom.adtf.iid"   
)

Marks the IEventSink to be castable with the ucom_cast<>

See also
ADTF_IID(_interface, _striid)

◆ HandleEvent()

virtual tResult HandleEvent ( const IEventSource oSource,
const void *  pvEventData 
)
pure virtual

Handle event.

The HandleEvent method is called by the event source for all registered event sinks to handle event data.

Parameters
[in]oSourcePointer to calling event source interface.
[in]pvEventDataPointer to event specific data.
Returns
Returns a standard result code. If ERR_CANCELED is returned, the event source stops calling the following event sinks, but it depends on the behavior of the implementation if the CANCEL return will result i.e. in a break of action.

IMPORTANT: Keen in mind that HandleEvent may be called from different threads. If you are sure that the event you want to handle comes only from one thread and/or you use only local members and other threadsafe methods, nothing must be done. Otherwise the critical code must be protected.