Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   Related Pages  

Event.h

00001 /*
00002  * Copyright 2003 Michael A. Marsh, Cornell University. All rights reserved.
00003  * This software is released under the modified BSD license.
00004  * See the file LICENSE in the top-level directory for details.
00005  */
00006 //
00007 // $Id: Event.h,v 1.3 2004/05/19 15:56:50 mmarsh Exp $
00008 //
00009 // $Log: Event.h,v $
00010 // Revision 1.3  2004/05/19 15:56:50  mmarsh
00011 // *** empty log message ***
00012 //
00013 // Revision 1.2  2003/11/04 22:31:48  mmarsh
00014 // *** empty log message ***
00015 //
00016 //
00017 
00018 #ifndef __CODEX_EVENTS_EVENT_H__
00019 #define __CODEX_EVENTS_EVENT_H__
00020 
00025 namespace CODEX_Events
00026 {
00027    class Activity;
00028 
00035    class EventBase
00036    {
00037       public :
00042          EventBase( Activity* source );
00043 
00045          virtual ~EventBase();
00046 
00052          virtual bool handle() = 0;
00053 
00055          Activity* source();
00056 
00057       protected :
00059          Activity* m_source;
00060    };
00061 
00068    class EventAck : public EventBase
00069    {
00070       public :
00072          EventAck( Activity* destination, bool failure=false );
00073 
00075          virtual ~EventAck();
00076          bool handle();
00077 
00079          bool failure() const { return m_failure; }
00080 
00081       private :
00082          Activity* m_destination;
00083          bool      m_failure;
00084    };
00085 
00086    class DataHandler;
00087 
00097    class DataEvent : public EventBase
00098    {
00099       public :
00101          DataEvent( Activity* source, DataHandler* destination );
00102 
00104          virtual ~DataEvent();
00105          bool handle();
00106 
00107       private :
00108          DataHandler* m_destination;
00109    };
00110 
00111    class CloseHandler;
00112 
00120    class CloseEvent : public EventBase
00121    {
00122       public :
00124          CloseEvent( Activity* source, CloseHandler* destination );
00125 
00127          virtual ~CloseEvent();
00128          bool handle();
00129 
00130       private :
00131          CloseHandler* m_destination;
00132    };
00133 
00134 }
00135 
00136 #endif /* __CODEX_EVENTS_EVENT_H__ */

Generated on Wed Jun 2 16:32:55 2004 for COrnell Data EXchange (CODEX) by doxygen1.2.18