Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File 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.4 2005/01/21 19:44:17 mmarsh Exp $
00008 //
00009 // $Log: RoutedClientMessageEvent.h,v $
00010 // Revision 1.4  2005/01/21 19:44:17  mmarsh
00011 // Updated for compatibility with Doxygen 1.4.1
00012 //
00013 // Revision 1.3  2004/05/19 15:56:52  mmarsh
00014 // *** empty log message ***
00015 //
00016 // Revision 1.2  2003/11/04 22:31:49  mmarsh
00017 // *** empty log message ***
00018 //
00019 //
00020 
00021 #ifndef __CODEX_KEYSERVICE_ROUTEDCLIENTMESSAGEEVENT_H__
00022 #define __CODEX_KEYSERVICE_ROUTEDCLIENTMESSAGEEVENT_H__
00023 
00024 #include "ClientMessageEvent.h"
00025 #include "CODEX_Server/RoutingInfo.h"
00026 
00027 namespace CODEX_KeyService
00028 {
00029    class RoutedClientMessageHandler;
00030 
00036    template< class MT >
00037    class RoutedClientMessageEvent : public ClientMessageEvent< MT >,
00038                                     public CODEX_Server::RoutingInfo
00039    {
00040       public :
00045          RoutedClientMessageEvent( CODEX_Events::Activity* source,
00046                                    RoutedClientMessageHandler* destination,
00047                                    unsigned char* server,
00048                                    unsigned char* seqNum ) :
00049             ClientMessageEvent< MT >( source, destination ),
00050             CODEX_Server::RoutingInfo( server, seqNum ),
00051             m_rdestination( destination ),
00052             m_failed( false )
00053          {}
00054 
00056          virtual ~RoutedClientMessageEvent() {}
00057 
00058          bool handle() { return m_rdestination->handler( *this ); }
00059 
00061          void reRoute( RoutedClientMessageHandler* newDestination )
00062          {
00063             ClientMessageEvent< MT >::reRoute( newDestination );
00064             m_rdestination = newDestination;
00065          }
00066 
00068          bool failed() const { return m_failed; }
00069 
00071          void setFailed() { m_failed = true; }
00072 
00073       private :
00074          RoutedClientMessageHandler*  m_rdestination;
00075          bool                         m_failed;
00076    };
00077 }
00078 
00079 #endif /* __CODEX_KEYSERVICE_ROUTEDCLIENTMESSAGEEVENT_H__ */

Generated on Fri May 6 17:41:02 2005 for COrnell Data EXchange (CODEX) by  doxygen 1.4.1