ADTF
cEventSource

The class cEventSource provides a basic implementation of IEventSource and wraps code to manage lists of pointers to IEventSink interfaces. More...

Inheritance diagram for cEventSource:
[legend]

Public Member Functions

tResult FireEvent (const void *pvEventData) const
 Fire event. More...
 
tResult RegisterEventSink (IEventSink &oEventSink)
 
tResult UnregisterEventSink (IEventSink &oEventSink)
 
- Public Member Functions inherited from object< IEventSource >
tResult GetInterface (const char *i_strIID, void *&o_pInterface) override
 Query interfaces on an object. More...
 
tResult GetInterface (const char *i_strIID, const void *&o_pInterface) const override
 Provides const correct interface querying. More...
 
void Destroy () const override
 Destruct and deallocate instantiations of type IObject. More...
 
- Public Member Functions inherited from IObject
 ADTF_IID (IObject, "object.ant.ucom.adtf.iid")
 Marks the IObject to be castable with the ucom_cast() More...
 

Private Attributes

std::vector< IEventSink * > m_oEventSinks
 

Additional Inherited Members

- Protected Member Functions inherited from IObject
 ~IObject ()=default
 Protected destructor --> Use implemented Destroy() instead of delete!
 

Detailed Description

The class cEventSource provides a basic implementation of IEventSource and wraps code to manage lists of pointers to IEventSink interfaces.

This will show you how to define such simple event.

Warning
: This is only a simple Internal Event pattern and is different from the IKernel Signals !!

Definition at line 30 of file event_source.h.

Member Function Documentation

◆ FireEvent()

tResult FireEvent ( const void *  pvEventData) const

Fire event.

The FireEvent method sends an event to all registered event sinks. If one event sink returns ERR_CANCELED, the calling loop is aborted.

Parameters
pvEventData[in] Pointer to event specific data.
Returns
Returns a standard result code. If cancelled, ERR_CANCELED is returned.