Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef TAO_REQUEST_H
00018 #define TAO_REQUEST_H
00019
00020 #include "ace/pre.h"
00021
00022 #include "tao/orbconf.h"
00023
00024 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00025 # pragma once
00026 #endif
00027
00028
00029
00030 #include "tao/DynamicInterface/Dynamic_Adapter_Impl.h"
00031
00032 #include "tao/DynamicInterface/ExceptionList.h"
00033
00034 #include "tao/ORB.h"
00035 #include "tao/Environment.h"
00036 #include "tao/CDR.h"
00037 #include "tao/GIOPC.h"
00038 #include "tao/AnyTypeCode/NVList.h"
00039
00040 #if defined (TAO_HAS_AMI)
00041 #include "tao/Messaging/Messaging.h"
00042 #endif
00043
00044 #include "ace/SString.h"
00045 #include "ace/Atomic_Op.h"
00046
00047 #if defined (TAO_EXPORT_MACRO)
00048 #undef TAO_EXPORT_MACRO
00049 #endif
00050 #define TAO_EXPORT_MACRO TAO_DynamicInterface_Export
00051
00052 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00053
00054 namespace CORBA
00055 {
00056 class NVList;
00057 typedef NVList *NVList_ptr;
00058
00059 class Context;
00060 typedef Context *Context_ptr;
00061
00062 class ContextList;
00063 typedef ContextList *ContextList_ptr;
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073 class TAO_DynamicInterface_Export Request
00074 {
00075 public:
00076
00077
00078 CORBA::Object_ptr target (void) const;
00079
00080
00081 const CORBA::Char *operation (void) const;
00082
00083
00084 CORBA::NVList_ptr arguments (void);
00085
00086
00087 CORBA::NamedValue_ptr result (void);
00088
00089
00090 CORBA::ExceptionList_ptr exceptions (void);
00091
00092
00093 CORBA::Context_ptr ctx (void) const;
00094
00095
00096 void ctx (CORBA::Context_ptr);
00097
00098
00099
00100 CORBA::ContextList_ptr contexts (void);
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110 CORBA::Any &add_in_arg (void);
00111 CORBA::Any &add_in_arg (const char* name);
00112 CORBA::Any &add_inout_arg (void);
00113 CORBA::Any &add_inout_arg (const char* name);
00114 CORBA::Any &add_out_arg (void);
00115 CORBA::Any &add_out_arg (const char* name);
00116
00117
00118
00119 void set_return_type (CORBA::TypeCode_ptr tc);
00120
00121
00122 CORBA::Any &return_value (void);
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135
00136 void invoke (void);
00137
00138
00139
00140
00141
00142
00143
00144 void send_oneway (void);
00145
00146
00147
00148
00149
00150
00151
00152 void send_deferred (void);
00153 void get_response (void);
00154 CORBA::Boolean poll_response (void);
00155
00156
00157
00158 void handle_response (TAO_InputCDR &incoming, GIOP::ReplyStatusType reply_status);
00159
00160 #if defined (TAO_HAS_AMI)
00161
00162
00163 void sendc (CORBA::Object_ptr handler);
00164
00165 static void _tao_reply_stub (
00166 TAO_InputCDR &_tao_reply_cdr,
00167 Messaging::ReplyHandler_ptr _tao_reply_handler,
00168 CORBA::ULong reply_status);
00169 #endif
00170
00171
00172 static CORBA::Request* _duplicate (CORBA::Request*);
00173 static CORBA::Request* _nil (void);
00174
00175
00176 CORBA::ULong _incr_refcnt (void);
00177 CORBA::ULong _decr_refcnt (void);
00178
00179
00180 void _tao_lazy_evaluation (bool lazy_evaluation);
00181
00182
00183 int _tao_byte_order (void) const;
00184
00185
00186 void _tao_byte_order (int byte_order);
00187
00188
00189
00190 void raw_user_exception (TAO_InputCDR &cdr);
00191
00192
00193 ACE_CString &raw_user_exception (void);
00194
00195
00196
00197 CORBA::Boolean response_received (void);
00198
00199
00200 typedef CORBA::Request_ptr _ptr_type;
00201 typedef CORBA::Request_var _var_type;
00202 typedef CORBA::Request_out _out_type;
00203
00204 private:
00205 friend class ::TAO_Dynamic_Adapter_Impl;
00206
00207
00208
00209
00210 Request (CORBA::Object_ptr obj,
00211 CORBA::ORB_ptr orb,
00212 const CORBA::Char *op,
00213 CORBA::NVList_ptr args,
00214 CORBA::NamedValue_ptr result,
00215 CORBA::Flags flags,
00216 CORBA::ExceptionList_ptr exceptions);
00217
00218 Request (CORBA::Object_ptr obj,
00219 CORBA::ORB_ptr orb,
00220 const CORBA::Char *op);
00221
00222 ~Request (void);
00223
00224 private:
00225
00226
00227 CORBA::Object_ptr target_;
00228
00229
00230 CORBA::ORB_var orb_;
00231
00232
00233 const char * opname_;
00234
00235
00236 CORBA::NVList_ptr args_;
00237
00238
00239 CORBA::NamedValue_ptr result_;
00240
00241
00242 CORBA::Flags flags_;
00243
00244
00245
00246
00247
00248 CORBA::ExceptionList_var exceptions_;
00249
00250
00251 CORBA::ContextList_ptr contexts_;
00252
00253
00254 CORBA::Context_ptr ctx_;
00255
00256
00257 ACE_Atomic_Op<TAO_SYNCH_MUTEX, unsigned long> refcount_;
00258
00259
00260 TAO_SYNCH_MUTEX lock_;
00261
00262
00263 bool lazy_evaluation_;
00264
00265
00266 CORBA::Boolean response_received_;
00267
00268
00269 int byte_order_;
00270
00271
00272
00273 ACE_CString raw_user_exception_;
00274
00275 };
00276 }
00277
00278 TAO_END_VERSIONED_NAMESPACE_DECL
00279
00280 #if defined (__ACE_INLINE__)
00281 # include "tao/DynamicInterface/Request.inl"
00282 #endif
00283
00284 #include "ace/post.h"
00285
00286 #endif