ALBA
|
#include <albaEventBase.h>
Public Member Functions | |
albaEventBase (void *sender=NULL, albaID id=ID_NO_EVENT, void *data=NULL, albaID channel=MCH_UP) | |
virtual | ~albaEventBase () |
albaTypeMacro (albaEventBase, albaObject) | |
albaEventBase (const albaEventBase &c) | |
virtual void | DeepCopy (const albaEventBase *alba_event) |
void | SetSender (void *sender) |
void * | GetSender () |
void | SetId (albaID id) |
albaID | GetId () |
albaID | GetChannel () |
void | SetChannel (albaID channel) |
void | SetData (void *calldata) |
void * | GetData () |
Public Member Functions inherited from albaObject | |
albaObject () | |
virtual | ~albaObject () |
virtual void | Delete () |
virtual const char * | GetTypeName () const |
virtual bool | IsA (const char *type_name) const |
virtual bool | IsA (const albaTypeID &type_id) const |
virtual albaObject * | NewObjectInstance () const =0 |
virtual const albaTypeID & | GetTypeId () const |
virtual void | Print (std::ostream &os, const int indent=0) const |
albaObject (const albaObject &c) | |
Protected Attributes | |
void * | m_Sender |
void * | m_Data |
albaID | m_Id |
albaID | m_Channel |
Protected Attributes inherited from albaObject | |
bool | m_HeapFlag |
Additional Inherited Members | |
Static Public Member Functions inherited from albaObject | |
static const char * | GetStaticTypeName () |
static bool | IsStaticType (const char *type_name) |
static bool | IsStaticType (const albaTypeID &type_id) |
static const albaTypeID & | GetStaticTypeId () |
static albaObject * | SafeDownCast (albaObject *o) |
Implementation of the message object for the Subject/Observer design pattern.
albaEventBase is a class implementing the "message" in the Subject/Observer design pattern. Objective of this object is to contain the message sent by subjects and received by observers when an event is invoked. Fields of the basic events are:
More complex messages can be defined inheriting from this class. The RTTI mechanism ensure to be able recognized and cast the real kind of event.
Definition at line 48 of file albaEventBase.h.
albaEventBase::albaEventBase | ( | void * | sender = NULL , |
albaID | id = ID_NO_EVENT , |
||
void * | data = NULL , |
||
albaID | channel = MCH_UP |
||
) |
|
virtual |
albaEventBase::albaEventBase | ( | const albaEventBase & | c | ) |
copy constructor, this makes a copy of the event
albaEventBase::albaTypeMacro | ( | albaEventBase | , |
albaObject | |||
) |
|
virtual |
Reimplemented in albaEvent, and albaEventInteraction.
void albaEventBase::SetSender | ( | void * | sender | ) |
set the sender (invoker) of this event
void * albaEventBase::GetSender | ( | ) |
return sender (invoker) of this event
void albaEventBase::SetId | ( | albaID | id | ) |
set Id for this event
albaID albaEventBase::GetId | ( | ) |
return Id of this event
albaID albaEventBase::GetChannel | ( | ) |
return channel this event is travelling through
void albaEventBase::SetChannel | ( | albaID | channel | ) |
set channel this event is travelling through
void albaEventBase::SetData | ( | void * | calldata | ) |
set call data, data sent by sender (event's invoker) to all observers
void * albaEventBase::GetData | ( | ) |
return call data, data sent by sender (event's invoker) to all observers
|
protected |
Definition at line 86 of file albaEventBase.h.
|
protected |
Definition at line 87 of file albaEventBase.h.
|
protected |
Definition at line 88 of file albaEventBase.h.
|
protected |
Definition at line 89 of file albaEventBase.h.