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

RoutedClientMessageEvent.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: RoutedClientMessageEvent.h,v 1.3 2004/05/19 15:56:52 mmarsh Exp $
00008 //
00009 // $Log: RoutedClientMessageEvent.h,v $
00010 // Revision 1.3  2004/05/19 15:56:52  mmarsh
00011 // *** empty log message ***
00012 //
00013 // Revision 1.2  2003/11/04 22:31:49  mmarsh
00014 // *** empty log message ***
00015 //
00016 //
00017 
00018 #ifndef __CODEX_KEYSERVICE_ROUTEDCLIENTMESSAGEEVENT_H__
00019 #define __CODEX_KEYSERVICE_ROUTEDCLIENTMESSAGEEVENT_H__
00020 
00021 #include "ClientMessageEvent.h"
00022 #include "CODEX_Server/RoutingInfo.h"
00023 
00024 namespace CODEX_KeyService
00025 {
00026    class RoutedClientMessageHandler;
00027 
00033    template< class MT >
00034    class RoutedClientMessageEvent : public ClientMessageEvent< MT >,
00035                                     public CODEX_Server::RoutingInfo
00036    {
00037       public :
00042          RoutedClientMessageEvent( CODEX_Events::Activity* source,
00043                                    RoutedClientMessageHandler* destination,
00044                                    unsigned char* server,
00045                                    unsigned char* seqNum ) :
00046             ClientMessageEvent< MT >( source, destination ),
00047             CODEX_Server::RoutingInfo( server, seqNum ),
00048             m_rdestination( destination ),
00049             m_failed( false )
00050          {}
00051 
00053          virtual ~RoutedClientMessageEvent() {}
00054 
00055          bool handle() { return m_rdestination->handler( *this ); }
00056 
00058          void reRoute( RoutedClientMessageHandler* newDestination )
00059          {
00060             ClientMessageEvent< MT >::reRoute( newDestination );
00061             m_rdestination = newDestination;
00062          }
00063 
00065          bool failed() const { return m_failed; }
00066 
00068          void setFailed() { m_failed = true; }
00069 
00070       private :
00071          RoutedClientMessageHandler*  m_rdestination;
00072          bool                         m_failed;
00073    };
00074 }
00075 
00076 #endif /* __CODEX_KEYSERVICE_ROUTEDCLIENTMESSAGEEVENT_H__ */

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