ALBA
Public Member Functions | Protected Attributes | List of all members
albaEventBase Class Reference

#include <albaEventBase.h>

Inheritance diagram for albaEventBase:
Inheritance graph
[legend]
Collaboration diagram for albaEventBase:
Collaboration graph
[legend]

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 albaObjectNewObjectInstance () const =0
 
virtual const albaTypeIDGetTypeId () 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 albaTypeIDGetStaticTypeId ()
 
static albaObjectSafeDownCast (albaObject *o)
 

Detailed Description

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.

See also
albaSubject albaObserver albaEvent

Definition at line 48 of file albaEventBase.h.

Constructor & Destructor Documentation

◆ albaEventBase() [1/2]

albaEventBase::albaEventBase ( void *  sender = NULL,
albaID  id = ID_NO_EVENT,
void *  data = NULL,
albaID  channel = MCH_UP 
)

◆ ~albaEventBase()

virtual albaEventBase::~albaEventBase ( )
virtual

◆ albaEventBase() [2/2]

albaEventBase::albaEventBase ( const albaEventBase c)

copy constructor, this makes a copy of the event

Member Function Documentation

◆ albaTypeMacro()

albaEventBase::albaTypeMacro ( albaEventBase  ,
albaObject   
)

◆ DeepCopy()

virtual void albaEventBase::DeepCopy ( const albaEventBase alba_event)
virtual

Reimplemented in albaEvent, and albaEventInteraction.

◆ SetSender()

void albaEventBase::SetSender ( void *  sender)

set the sender (invoker) of this event

◆ GetSender()

void * albaEventBase::GetSender ( )

return sender (invoker) of this event

◆ SetId()

void albaEventBase::SetId ( albaID  id)

set Id for this event

◆ GetId()

albaID albaEventBase::GetId ( )

return Id of this event

◆ GetChannel()

albaID albaEventBase::GetChannel ( )

return channel this event is travelling through

◆ SetChannel()

void albaEventBase::SetChannel ( albaID  channel)

set channel this event is travelling through

◆ SetData()

void albaEventBase::SetData ( void *  calldata)

set call data, data sent by sender (event's invoker) to all observers

◆ GetData()

void * albaEventBase::GetData ( )

return call data, data sent by sender (event's invoker) to all observers

Member Data Documentation

◆ m_Sender

void* albaEventBase::m_Sender
protected

Definition at line 86 of file albaEventBase.h.

◆ m_Data

void* albaEventBase::m_Data
protected

Definition at line 87 of file albaEventBase.h.

◆ m_Id

albaID albaEventBase::m_Id
protected

Definition at line 88 of file albaEventBase.h.

◆ m_Channel

albaID albaEventBase::m_Channel
protected

Definition at line 89 of file albaEventBase.h.


The documentation for this class was generated from the following file: