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