Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

UnicastRequestEvent.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: UnicastRequestEvent.h,v 1.4 2005/01/21 19:44:18 mmarsh Exp $
00008 //
00009 // $Log: UnicastRequestEvent.h,v $
00010 // Revision 1.4  2005/01/21 19:44:18  mmarsh
00011 // Updated for compatibility with Doxygen 1.4.1
00012 //
00013 // Revision 1.3  2004/05/19 15:56:59  mmarsh
00014 // *** empty log message ***
00015 //
00016 // Revision 1.2  2003/11/04 22:31:51  mmarsh
00017 // *** empty log message ***
00018 //
00019 //
00020 
00021 #ifndef __CODEX_SERVER_UNICASTREQUESTEVENT_H__
00022 #define __CODEX_SERVER_UNICASTREQUESTEVENT_H__
00023 
00024 #include "CODEX_Events/Event.h"
00025 #include "CODEX_Events/Activity.h"
00026 #include "CODEX_Quorum/Message.h"
00027 #include "CODEX_Quorum/ResponseCallback.h"
00028 #include "CODEX_Quorum/QuorumSystem.h"
00029 #include "UnicastRequestHandler.h"
00030 #include "ServerState.h"
00031 
00032 namespace CODEX_Server
00033 {
00038    class UnicastRequestEvent : public CODEX_Events::EventBase
00039    {
00040       public :
00042          UnicastRequestEvent( CODEX_Events::Activity* source,
00043                               UnicastRequestHandler* destination,
00044                               const CODEX_Quorum::MessageVector& messages,
00045                               const unsigned char* key,
00046                               CODEX_Quorum::ResponseCallback* cb );
00047 
00049          virtual ~UnicastRequestEvent();
00050 
00052          const CODEX_Quorum::MessageVector& messages() const
00053          {
00054             return m_messages;
00055          }
00056 
00058          const unsigned char* key() const { return m_key; }
00059 
00061          CODEX_Quorum::ReturnVector& retVals() { return m_retVals; }
00062 
00064          CODEX_Quorum::ResponseCallback* cb() const { return m_cb; }
00065 
00067          bool bcast() const { return m_bcast; }
00068 
00070          void setBcast() { m_bcast = true; }
00071 
00073          unsigned long time() const { return m_time; }
00074 
00076          void updateTime( unsigned long time ) { m_time = time; }
00077 
00079          bool handle() { return m_destination->handler( *this ); }
00080 
00081       private :
00082          UnicastRequestHandler*           m_destination;
00083          CODEX_Quorum::MessageVector      m_messages;
00084          unsigned char                    m_key[ ServerState::nMID ];
00085          CODEX_Quorum::ResponseCallback*  m_cb;
00086          CODEX_Quorum::ReturnVector       m_retVals;
00087          bool                             m_bcast;
00088          unsigned long                    m_time;
00089    };
00090 
00091 }
00092 
00093 #endif /* __CODEX_SERVER_UNICASTREQUESTEVENT_H__ */

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