Lomse library. API documentation  0.30.0
EventNotifier Class Reference

#include <lomse_events.h>

Inheritance diagram for EventNotifier:
Interactor

Detailed Description

Any object that wants to dispatch events must derive from EventNotifier class

Public Member Functions

 EventNotifier (EventsDispatcher *dispatcher)
 
virtual ~EventNotifier ()
 
bool notify_observers (SpEventInfo pEvent, Observable *target)
 
void remove_observer (Observer *observer)
 
Observeradd_observer_for (Observable *target)
 
Observeradd_observer_for_child (Observable *parent, int childType, ImoId childId)
 

Friends

class Observable
 

Constructor & Destructor Documentation

◆ EventNotifier()

EventNotifier::EventNotifier ( EventsDispatcher *  dispatcher)
inline

Constructor.

◆ ~EventNotifier()

virtual EventNotifier::~EventNotifier ( )
virtual

Destructor.

Member Function Documentation

◆ add_observer_for()

Observer* EventNotifier::add_observer_for ( Observable target)

Add Observer for the given event generator target.

◆ add_observer_for_child()

Observer* EventNotifier::add_observer_for_child ( Observable parent,
int  childType,
ImoId  childId 
)

Add Observer for events generated by the object whose ID and type are passed as parameters. The type must be a value from enum Observable::EObservedChild.

◆ notify_observers()

bool EventNotifier::notify_observers ( SpEventInfo  pEvent,
Observable target 
)

Sends the event to all objects observing the event generator object.

◆ remove_observer()

void EventNotifier::remove_observer ( Observer observer)

Remove an Observer.