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

SupportedKeyStoredEvent.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: SupportedKeyStoredEvent.h,v 1.3 2004/05/19 15:56:53 mmarsh Exp $
00008 //
00009 // $Log: SupportedKeyStoredEvent.h,v $
00010 // Revision 1.3  2004/05/19 15:56:53  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_SUPPORTEDKEYSTOREDEVENT_H__
00019 #define __CODEX_KEYSERVICE_SUPPORTEDKEYSTOREDEVENT_H__
00020 
00021 #include "SupportedKeyStoredMsg.h"
00022 #include "SupportedClientResponseEvent.h"
00023 
00024 namespace CODEX_KeyService
00025 {
00033    class SupportedKeyStoredEvent : public SupportedClientResponseEventBase
00034    {
00035       public :
00037          typedef SupportedKeyStoredMsg  MsgType;
00038 
00040          SupportedKeyStoredEvent(
00041             CODEX_Events::Activity* source,
00042             unsigned char* server,
00043             unsigned char* seqNum,
00044             SupportedClientResponseHandler* destination,
00045             const MsgType& message ) :
00046             SupportedClientResponseEventBase( source, server, seqNum ),
00047             m_destination( destination ),
00048             m_message( message )
00049          {}
00050 
00052          SupportedKeyStoredEvent(
00053             CODEX_Events::Activity* source,
00054             unsigned char* server,
00055             unsigned char* seqNum,
00056             SupportedClientResponseHandler* destination ) :
00057             SupportedClientResponseEventBase( source, server, seqNum ),
00058             m_destination( destination )
00059          {}
00060 
00062          virtual ~SupportedKeyStoredEvent() {}
00063 
00065          const MsgType& message() const { return m_message; }
00066 
00071          bool handle();
00072 
00080          void reRoute( SupportedClientResponseHandler* newDestination )
00081          {
00082             m_destination = newDestination;
00083          }
00084 
00086          int marshal( unsigned char ** pp )
00087          {
00088             return m_message.marshal(pp);
00089          }
00090 
00092          bool unmarshal( unsigned char ** pp, long length )
00093          {
00094             if ( NULL == m_message.unmarshal( NULL, pp, length ) )
00095             {
00096                return false;
00097             }
00098             return true;
00099          }
00100 
00101       private :
00102          SupportedClientResponseHandler*  m_destination;
00103          MsgType                          m_message;
00104    };
00105 }
00106 
00107 #endif /* __CODEX_KEYSERVICE_SUPPORTEDKEYSTOREDEVENT_H__ */

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