16#ifndef __albaEventBroadcaster_h
17#define __albaEventBroadcaster_h
29class albaObserversList;
long albaID
type for IDs inside ALBA
Implementation of the message object for the Subject/Observer design pattern.
This class inerith form albaEventSender and extends albaEventSender with the capacity of send events ...
albaObserversList m_Observers
list of observers
albaEventBroadcaster(void *owner=NULL)
std::list< albaObserver * > albaObserversList
virtual ~albaEventBroadcaster()
void InvokeEvent(albaEventBase &e)
invoke an event of this subject
void InvokeEvent(void *sender, albaID id=ID_NO_EVENT, void *data=NULL)
invoke an event of this subject
void AddObserver(albaObserver *obj)
Register an observer of this subject.
void GetObservers(std::vector< albaObserver * > &olist)
return a vector with the list of observers of this event source
albaEventBroadcaster(const albaEventBroadcaster &c)
albaID GetChannel()
return the channel assigned to this event source.
void RemoveAllObservers()
remove all observers at once
bool RemoveObserver(albaObserver *obj)
Unregister an observer.
void AddObserver(albaObserver &obj)
Register an observer of this subject.
virtual void SetListener(albaObserver *o)
Removes all the observer and add o to the observer list.
albaID m_Channel
a channel assigned to this event source, if <0 no channel is assigned
albaObserverCallback * AddObserverCallback(void(*f)(void *sender, albaID eid, void *clientdata, void *calldata))
Add as observer a callback function.
void SetChannel(albaID ch)
set the channel Id assigned to this event source.
bool HasObservers()
return true if this class has observers
void InvokeEvent(albaEventBase *e)
invoke an event of this subject
bool IsObserver(albaObserver *obj)
return true if object is an observer of this subject
class acting as an interface for objects using ALBA hierarchical event communication model This objec...
Concrete implementation of Observer calling a callback function.
Interface implementing the Observer of the Subject/Observer design pattern.