00001 // -*- C++ -*- 00002 // 00003 // Request.inl,v 1.20 2005/11/03 17:38:45 ossama Exp 00004 00005 TAO_BEGIN_VERSIONED_NAMESPACE_DECL 00006 00007 ACE_INLINE 00008 void 00009 CORBA::release (CORBA::Request_ptr x) 00010 { 00011 if (x != 0) 00012 { 00013 x->_decr_refcnt (); 00014 } 00015 } 00016 00017 ACE_INLINE 00018 CORBA::Boolean 00019 CORBA::is_nil (CORBA::Request_ptr x) 00020 { 00021 return (CORBA::Boolean) (x == 0); 00022 } 00023 00024 // =================================================================== 00025 00026 ACE_INLINE CORBA::Request_ptr 00027 CORBA::Request::_duplicate (CORBA::Request_ptr x) 00028 { 00029 if (x != 0) 00030 { 00031 x->_incr_refcnt (); 00032 } 00033 00034 return x; 00035 } 00036 00037 ACE_INLINE CORBA::Request_ptr 00038 CORBA::Request::_nil (void) 00039 { 00040 return 0; 00041 } 00042 00043 ACE_INLINE CORBA::Object_ptr 00044 CORBA::Request::target (void) const 00045 { 00046 return this->target_; 00047 } 00048 00049 // Return the operation name for the request. 00050 ACE_INLINE const CORBA::Char * 00051 CORBA::Request::operation (void) const 00052 { 00053 return this->opname_; 00054 } 00055 00056 // Return the arguments for the request. 00057 ACE_INLINE CORBA::NVList_ptr 00058 CORBA::Request::arguments (void) 00059 { 00060 return this->args_; 00061 } 00062 00063 // Return the result for the request. 00064 ACE_INLINE CORBA::NamedValue_ptr 00065 CORBA::Request::result (void) 00066 { 00067 return this->result_; 00068 } 00069 00070 // Return the exceptions resulting from this request. 00071 ACE_INLINE CORBA::ExceptionList_ptr 00072 CORBA::Request::exceptions (void) 00073 { 00074 return this->exceptions_.in (); 00075 } 00076 00077 // Return the request's contexts 00078 ACE_INLINE CORBA::ContextList_ptr 00079 CORBA::Request::contexts (void) 00080 { 00081 return this->contexts_; 00082 } 00083 00084 //// *** DEPRECATED *** Return the <Environment> for this request. 00085 // ACE_INLINE CORBA::Environment * 00086 // CORBA::Request::env (void) 00087 // { 00088 // return &this->env_; 00089 // } 00090 00091 // The argument manipulation helper functions 00092 00093 ACE_INLINE CORBA::Any & 00094 CORBA::Request::add_in_arg (void) 00095 { 00096 ACE_DECLARE_NEW_CORBA_ENV; 00097 return this->args_->add_element (CORBA::ARG_IN ACE_ENV_ARG_PARAMETER)->any_; 00098 } 00099 00100 ACE_INLINE CORBA::Any & 00101 CORBA::Request::add_in_arg (const CORBA::Char *name) 00102 { 00103 ACE_DECLARE_NEW_CORBA_ENV; 00104 return this->args_->add_item (name, CORBA::ARG_IN ACE_ENV_ARG_PARAMETER)->any_; 00105 } 00106 00107 ACE_INLINE CORBA::Any & 00108 CORBA::Request::add_inout_arg (void) 00109 { 00110 ACE_DECLARE_NEW_CORBA_ENV; 00111 return this->args_->add_element (CORBA::ARG_INOUT ACE_ENV_ARG_PARAMETER)->any_; 00112 } 00113 00114 ACE_INLINE CORBA::Any & 00115 CORBA::Request::add_inout_arg (const CORBA::Char *name) 00116 { 00117 ACE_DECLARE_NEW_CORBA_ENV; 00118 return this->args_->add_item (name, CORBA::ARG_INOUT ACE_ENV_ARG_PARAMETER)->any_; 00119 } 00120 00121 ACE_INLINE CORBA::Any & 00122 CORBA::Request::add_out_arg (void) 00123 { 00124 ACE_DECLARE_NEW_CORBA_ENV; 00125 return this->args_->add_element (CORBA::ARG_OUT ACE_ENV_ARG_PARAMETER)->any_; 00126 } 00127 00128 ACE_INLINE CORBA::Any & 00129 CORBA::Request::add_out_arg (const CORBA::Char *name) 00130 { 00131 ACE_DECLARE_NEW_CORBA_ENV; 00132 return this->args_->add_item (name, CORBA::ARG_OUT ACE_ENV_ARG_PARAMETER)->any_; 00133 } 00134 00135 ACE_INLINE void 00136 CORBA::Request::set_return_type (CORBA::TypeCode_ptr tc) 00137 { 00138 this->result_->any_._tao_set_typecode (tc); 00139 } 00140 00141 ACE_INLINE CORBA::Any & 00142 CORBA::Request::return_value (void ) 00143 { 00144 return this->result_->any_; 00145 } 00146 00147 ACE_INLINE CORBA::Context_ptr 00148 CORBA::Request::ctx (void) const 00149 { 00150 return this->ctx_; 00151 } 00152 00153 ACE_INLINE void 00154 CORBA::Request::ctx (CORBA::Context_ptr ctx) 00155 { 00156 this->ctx_ = ctx; 00157 } 00158 00159 ACE_INLINE void 00160 CORBA::Request::_tao_lazy_evaluation (bool lazy_evaluation) 00161 { 00162 this->lazy_evaluation_ = lazy_evaluation; 00163 } 00164 00165 ACE_INLINE int 00166 CORBA::Request::_tao_byte_order (void) const 00167 { 00168 return this->byte_order_; 00169 } 00170 00171 ACE_INLINE void 00172 CORBA::Request::_tao_byte_order (int byte_order) 00173 { 00174 this->byte_order_ = byte_order; 00175 } 00176 00177 ACE_INLINE void 00178 CORBA::Request::raw_user_exception (TAO_InputCDR &cdr) 00179 { 00180 this->raw_user_exception_.set (cdr.start ()->rd_ptr (), 00181 cdr.start ()->length (), 00182 1); 00183 } 00184 00185 ACE_INLINE ACE_CString & 00186 CORBA::Request::raw_user_exception (void) 00187 { 00188 return this->raw_user_exception_; 00189 } 00190 00191 ACE_INLINE CORBA::Boolean 00192 CORBA::Request::response_received (void) 00193 { 00194 ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, 00195 ace_mon, 00196 this->lock_, 00197 0); 00198 00199 return this->response_received_; 00200 } 00201 00202 TAO_END_VERSIONED_NAMESPACE_DECL