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.cc,v 1.3 2004/05/19 15:56:50 mmarsh Exp $ 00008 // 00009 // $Log: Event.cc,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 #include "Event.h" 00019 #include "Activity.h" 00020 00021 using namespace CODEX_Events; 00022 00023 EventBase::EventBase( Activity* source ) : 00024 m_source( source ) 00025 { 00026 } 00027 00028 EventBase::~EventBase() 00029 { 00030 } 00031 00032 Activity* 00033 EventBase::source() 00034 { 00035 return m_source; 00036 } 00037 00038 EventAck::EventAck( Activity* destination, bool failure ) : 00039 EventBase( 0 ), 00040 m_destination( destination ), 00041 m_failure( failure ) 00042 { 00043 } 00044 00045 EventAck::~EventAck() 00046 { 00047 } 00048 00049 bool 00050 EventAck::handle() 00051 { 00052 if ( 0 != m_destination ) 00053 { 00054 return m_destination->handler( *this ); 00055 } 00056 return true; 00057 } 00058 00059 DataEvent::DataEvent( Activity* source, DataHandler* destination ) : 00060 EventBase( source ), 00061 m_destination( destination ) 00062 { 00063 } 00064 00065 DataEvent::~DataEvent() 00066 { 00067 } 00068 00069 bool 00070 DataEvent::handle() 00071 { 00072 return m_destination->handler( *this ); 00073 } 00074 00075 CloseEvent::CloseEvent( Activity* source, CloseHandler* destination ) : 00076 EventBase( source ), 00077 m_destination( destination ) 00078 { 00079 } 00080 00081 CloseEvent::~CloseEvent() 00082 { 00083 } 00084 00085 bool 00086 CloseEvent::handle() 00087 { 00088 return m_destination->handler( *this ); 00089 }
1.4.1