GIOP_Utils.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 //=============================================================================
00004 /**
00005  *  @file     GIOP_Utils.h
00006  *
00007  *  GIOP_Utils.h,v 1.24 2005/11/24 11:05:45 ossama Exp
00008  *
00009  *   GIOP utility definitions
00010  *
00011  *
00012  *  @author  Chris Cleeland <cleeland@cs.wustl.edu>
00013  *  @author  Carlos O' Ryan <coryan@uci.edu>
00014  */
00015 //=============================================================================
00016 
00017 #ifndef TAO_GIOP_UTILS_H
00018 #define TAO_GIOP_UTILS_H
00019 
00020 #include /**/ "ace/pre.h"
00021 
00022 #include "tao/Object.h"
00023 
00024 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00025 # pragma once
00026 #endif /* ACE_LACKS_PRAGMA_ONCE */
00027 
00028 #include "tao/IOP_IORC.h"
00029 
00030 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
00031 class ACE_Time_Value;
00032 ACE_END_VERSIONED_NAMESPACE_DECL
00033 
00034 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00035 
00036 class TAO_Transport;
00037 
00038 /**
00039  * All GIOP messages include a header and message type.  Not
00040  * really a message type, but needed to bring that information
00041  * back somehow.
00042  */
00043 typedef enum GIOP_Messages
00044 {
00045   // = GIOP message types.
00046   TAO_GIOP_REQUEST = 0,                // sent by client.
00047   TAO_GIOP_REPLY = 1,                  // by server.
00048   TAO_GIOP_CANCELREQUEST = 2,          // by client.
00049   TAO_GIOP_LOCATEREQUEST = 3,          // by client.
00050   TAO_GIOP_LOCATEREPLY = 4,
00051   TAO_GIOP_CLOSECONNECTION = 5,
00052   TAO_GIOP_MESSAGERROR = 6,           // by both.
00053   TAO_GIOP_FRAGMENT = 7                // by both.
00054 }  TAO_GIOP_Message_Type;
00055 
00056 
00057 typedef enum GIOP_LocateStatusType
00058 {
00059   TAO_GIOP_UNKNOWN_OBJECT,
00060   TAO_GIOP_OBJECT_HERE,
00061   TAO_GIOP_OBJECT_FORWARD,
00062   TAO_GIOP_OBJECT_FORWARD_PERM,      //GIOP1.2
00063   TAO_GIOP_LOC_SYSTEM_EXCEPTION,     // GIOP1.2
00064   TAO_GIOP_LOC_NEEDS_ADDRESSING_MODE //GIOP 1.2
00065 }TAO_GIOP_Locate_Status_Type;
00066 
00067 /**
00068  * @class TAO_GIOP_Locate_Status_Msg
00069  *
00070  * @brief Hold the relevant information for every type of Locate mesg.
00071  *
00072  * This class is there to hold the relevant info for different
00073  * types of locate status messages. As on date we dont know much
00074  * about other mesg types other than OBJECT_FORWARD. This clss can
00075  * be clearly defined as time progresses.
00076  */
00077 class TAO_Export TAO_GIOP_Locate_Status_Msg
00078 {
00079 public:
00080   /// The value will need to be used when the Message type is
00081   /// TAO_GIOP_OBJECT_FORWARD
00082   CORBA::Object_var forward_location_var;
00083 
00084   /// Stype of Locate status message
00085   ///@@ Other mesg types.
00086   TAO_GIOP_Locate_Status_Type status;
00087 };
00088 
00089 
00090 typedef enum GIOP_ReplyStatusType
00091 {
00092   /// Request completed successfully
00093   TAO_GIOP_NO_EXCEPTION,
00094 
00095   /// Request terminated with user exception
00096   TAO_GIOP_USER_EXCEPTION,
00097 
00098   /// Request terminated with system exception
00099   TAO_GIOP_SYSTEM_EXCEPTION,
00100 
00101   /// Reply is a location forward type
00102   TAO_GIOP_LOCATION_FORWARD,
00103 
00104   /// GIOP 1.2, Reply is a location forward perm type..
00105   TAO_GIOP_LOCATION_FORWARD_PERM,
00106 
00107   /// GIOP1.2,
00108   TAO_GIOP_NEEDS_ADDRESSING_MODE
00109 
00110 } TAO_GIOP_Reply_Status_Type;
00111 
00112 
00113 /**
00114  * @class TAO_GIOP_ReplyHeader
00115  *
00116  * @brief This class embodies the header of a GIOP reply.
00117  * @@Not used. Could be used in future
00118  */
00119 class TAO_Export TAO_GIOP_ReplyHeader
00120 {
00121 public:
00122   /// Information
00123   IOP::ServiceContextList service_info;
00124 
00125   /// Unique identifier of the request for which this is a reply.
00126   CORBA::ULong request_id;
00127 
00128   /// Status of the reply (see above enum).
00129   TAO_GIOP_Reply_Status_Type reply_status;
00130 };
00131 
00132 /**
00133  * @class TAO_GIOP_Utils
00134  *
00135  * @brief Utility class that has some commonly used methods for both GIOP
00136  * Base  & GIOP lite
00137  */
00138 class TAO_Export TAO_GIOP_Utils
00139 {
00140 public:
00141   static int read_bytes_input (TAO_Transport *transport,
00142                                TAO_InputCDR &cdr,
00143                                CORBA::ULong buf_size,
00144                                ACE_Time_Value *value = 0);
00145 
00146   static ssize_t read_buffer (TAO_Transport *transport,
00147                               char *buf,
00148                               size_t len,
00149                               ACE_Time_Value *max_wait_time = 0);
00150 };
00151 
00152 TAO_END_VERSIONED_NAMESPACE_DECL
00153 
00154 #include /**/ "ace/post.h"
00155 #endif /*TAO_GIOP_UTILS_H */

Generated on Thu Nov 9 11:54:12 2006 for TAO by doxygen 1.3.6