ALBA
albaEventBase.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: ALBA (Agile Library for Biomedical Applications)
4 Module: albaEventBase
5 Authors: Marco Petrone, Crimi Gianluigi
6
7 Copyright (c) BIC
8 All rights reserved. See Copyright.txt or
9
10
11 This software is distributed WITHOUT ANY WARRANTY; without even
12 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
13 PURPOSE. See the above copyright notice for more information.
14
15=========================================================================*/
16#ifndef __albaEventBase_h
17#define __albaEventBase_h
18//----------------------------------------------------------------------------
19// includes :
20//----------------------------------------------------------------------------
21#include "albaObject.h"
22#include "albaDecl.h"
23//------------------------------------------------------------------------------
24// Forward declarations
25//------------------------------------------------------------------------------
26
27
28//------------------------------------------------------------------------------
29// albaEventBase
30//------------------------------------------------------------------------------
48class ALBA_EXPORT albaEventBase: public albaObject
49{
50public:
51 albaEventBase(void *sender=NULL,albaID id=ID_NO_EVENT,void *data=NULL, albaID channel=MCH_UP);
52 virtual ~albaEventBase();
53
55
58
59 virtual void DeepCopy(const albaEventBase *alba_event);
60
62 void SetSender(void *sender);
63
65 void *GetSender();
66
68 void SetId(albaID id);
69
72
75
77 void SetChannel(albaID channel);
78
80 void SetData(void *calldata);
81
83 void *GetData();
84
85protected:
86 void *m_Sender;
87 void *m_Data;
90};
91#endif /* __albaEventBase_h */
MCH_UP
channel used to send events up in the tree
Definition: albaDecl.h:387
long albaID
type for IDs inside ALBA
Definition: albaDefines.h:58
#define ID_NO_EVENT
Definition: albaDefines.h:71
Implementation of the message object for the Subject/Observer design pattern.
Definition: albaEventBase.h:49
void SetChannel(albaID channel)
set channel this event is travelling through
albaEventBase(const albaEventBase &c)
copy constructor, this makes a copy of the event
void SetData(void *calldata)
set call data, data sent by sender (event's invoker) to all observers
albaID GetChannel()
return channel this event is travelling through
virtual ~albaEventBase()
albaID m_Channel
Definition: albaEventBase.h:89
albaEventBase(void *sender=NULL, albaID id=ID_NO_EVENT, void *data=NULL, albaID channel=MCH_UP)
void * GetSender()
return sender (invoker) of this event
void * GetData()
return call data, data sent by sender (event's invoker) to all observers
void SetSender(void *sender)
set the sender (invoker) of this event
albaTypeMacro(albaEventBase, albaObject)
void SetId(albaID id)
set Id for this event
albaID GetId()
return Id of this event
virtual void DeepCopy(const albaEventBase *alba_event)
Abstract superclass for all ALBA classes implementing RTTI APIs.
Definition: albaObject.h:38