00001 // -*- C++ -*- 00002 00003 //============================================================================= 00004 /** 00005 * @file Pluggable_Messaging_Utils.h 00006 * 00007 * $Id: Pluggable_Messaging_Utils.h 82307 2008-07-14 18:48:22Z johnnyw $ 00008 * 00009 * Utility classes for the TAO pluggable messaging framework. 00010 * 00011 * @author Balachandran Natarajan <bala@cs.wustl.edu> 00012 */ 00013 //============================================================================= 00014 00015 00016 #ifndef TAO_PLUGGABLE_MESSAGING_UTILS_H 00017 #define TAO_PLUGGABLE_MESSAGING_UTILS_H 00018 00019 #include /**/ "ace/pre.h" 00020 00021 #include "tao/GIOPC.h" 00022 00023 #if !defined (ACE_LACKS_PRAGMA_ONCE) 00024 # pragma once 00025 #endif /* ACE_LACKS_PRAGMA_ONCE */ 00026 00027 TAO_BEGIN_VERSIONED_NAMESPACE_DECL 00028 00029 class TAO_Transport; 00030 00031 /** 00032 * @class TAO_Pluggable_Reply_Params_Base 00033 * 00034 * @brief TAO_Pluggable_Reply_Params_Base 00035 * 00036 * This represents a set of data that would be assembled by the 00037 * acceptor to pass to the connector. This base class is used by 00038 * TAO_ServerRequest. The child class TAO_Pluggable_Reply_Params 00039 * is used on the client side, and contains an additional 00040 * TAO_InputCDR member, not needed on the server side. 00041 */ 00042 class TAO_Export TAO_Pluggable_Reply_Params_Base 00043 { 00044 public: 00045 /// Constructor. 00046 TAO_Pluggable_Reply_Params_Base (void); 00047 00048 /// The IOP service context list. 00049 IOP::ServiceContextList svc_ctx_; 00050 00051 /// The request id for which the reply we (connector) has received. 00052 CORBA::ULong request_id_; 00053 00054 /** 00055 * Since this class no longer contains an NVList, this is the 00056 * way to determine if the request was DSI, so we can use Carlos' 00057 * service context list no-deep-copy optimization. 00058 */ 00059 CORBA::Boolean is_dsi_; 00060 00061 /// Info required for DSI optimization that pads the outgoing 00062 /// CDR stream according to the alignment of the NVList. 00063 ptrdiff_t dsi_nvlist_align_; 00064 00065 /** 00066 * Get and Set methods for the service context list that we dont 00067 * own. This is useful for cases where the application objects own 00068 * a service context list and would like to pass on their contents 00069 * without a copy. 00070 */ 00071 IOP::ServiceContextList &service_context_notowned (void); 00072 void service_context_notowned (IOP::ServiceContextList *svc); 00073 00074 /// A flag that indicates if there is any data is going to get 00075 /// marshalled in the reply 00076 CORBA::Boolean argument_flag_; 00077 00078 GIOP::ReplyStatusType reply_status (void) const; 00079 void reply_status (GIOP::ReplyStatusType status); 00080 00081 GIOP::LocateStatusType locate_reply_status (void) const; 00082 void locate_reply_status (GIOP::LocateStatusType status); 00083 00084 protected: 00085 /// The service context list that we don't own. 00086 IOP::ServiceContextList *service_context_; 00087 private: 00088 /// The reply status. 00089 GIOP::ReplyStatusType reply_status_; 00090 00091 /// The locate reply status 00092 GIOP::LocateStatusType locate_reply_status_; 00093 }; 00094 00095 /** 00096 * @class TAO_Pluggable_Reply_Params 00097 * 00098 * @brief TAO_Pluggable_Connector_Params 00099 * 00100 */ 00101 class TAO_Export TAO_Pluggable_Reply_Params 00102 : public TAO_Pluggable_Reply_Params_Base 00103 { 00104 public: 00105 /// Constructor. 00106 TAO_Pluggable_Reply_Params (TAO_Transport *t); 00107 00108 /// The stream with the non-demarshaled reply. This stream will be 00109 /// passed up to the stubs to demarshal the parameter values. 00110 TAO_InputCDR *input_cdr_; 00111 00112 TAO_Transport *transport_; 00113 }; 00114 00115 TAO_END_VERSIONED_NAMESPACE_DECL 00116 00117 #if defined (__ACE_INLINE__) 00118 #include "tao/Pluggable_Messaging_Utils.inl" 00119 #endif /* __ACE_INLINE__ */ 00120 00121 #include /**/ "ace/post.h" 00122 00123 #endif /* TAO_PLUGGABLE_MESSAGING_UTILS_H */