00001 // -*- C++ -*- 00002 // 00003 // $Id: Request.inl 79339 2007-08-14 17:49:17Z sowayaa $ 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 return this->args_->add_element (CORBA::ARG_IN)->any_; 00097 } 00098 00099 ACE_INLINE CORBA::Any & 00100 CORBA::Request::add_in_arg (const CORBA::Char *name) 00101 { 00102 return this->args_->add_item (name, CORBA::ARG_IN)->any_; 00103 } 00104 00105 ACE_INLINE CORBA::Any & 00106 CORBA::Request::add_inout_arg (void) 00107 { 00108 return this->args_->add_element (CORBA::ARG_INOUT)->any_; 00109 } 00110 00111 ACE_INLINE CORBA::Any & 00112 CORBA::Request::add_inout_arg (const CORBA::Char *name) 00113 { 00114 return this->args_->add_item (name, CORBA::ARG_INOUT)->any_; 00115 } 00116 00117 ACE_INLINE CORBA::Any & 00118 CORBA::Request::add_out_arg (void) 00119 { 00120 return this->args_->add_element (CORBA::ARG_OUT)->any_; 00121 } 00122 00123 ACE_INLINE CORBA::Any & 00124 CORBA::Request::add_out_arg (const CORBA::Char *name) 00125 { 00126 return this->args_->add_item (name, CORBA::ARG_OUT)->any_; 00127 } 00128 00129 ACE_INLINE void 00130 CORBA::Request::set_return_type (CORBA::TypeCode_ptr tc) 00131 { 00132 this->result_->any_._tao_set_typecode (tc); 00133 } 00134 00135 ACE_INLINE CORBA::Any & 00136 CORBA::Request::return_value (void ) 00137 { 00138 return this->result_->any_; 00139 } 00140 00141 ACE_INLINE CORBA::Context_ptr 00142 CORBA::Request::ctx (void) const 00143 { 00144 return this->ctx_; 00145 } 00146 00147 ACE_INLINE void 00148 CORBA::Request::ctx (CORBA::Context_ptr ctx) 00149 { 00150 this->ctx_ = ctx; 00151 } 00152 00153 ACE_INLINE void 00154 CORBA::Request::_tao_lazy_evaluation (bool lazy_evaluation) 00155 { 00156 this->lazy_evaluation_ = lazy_evaluation; 00157 } 00158 00159 ACE_INLINE int 00160 CORBA::Request::_tao_byte_order (void) const 00161 { 00162 return this->byte_order_; 00163 } 00164 00165 ACE_INLINE void 00166 CORBA::Request::_tao_byte_order (int byte_order) 00167 { 00168 this->byte_order_ = byte_order; 00169 } 00170 00171 ACE_INLINE void 00172 CORBA::Request::raw_user_exception (TAO_InputCDR &cdr) 00173 { 00174 this->raw_user_exception_.set (cdr.start ()->rd_ptr (), 00175 cdr.start ()->length (), 00176 1); 00177 } 00178 00179 ACE_INLINE ACE_CString & 00180 CORBA::Request::raw_user_exception (void) 00181 { 00182 return this->raw_user_exception_; 00183 } 00184 00185 ACE_INLINE CORBA::Boolean 00186 CORBA::Request::response_received (void) 00187 { 00188 ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, 00189 ace_mon, 00190 this->lock_, 00191 false); 00192 00193 return this->response_received_; 00194 } 00195 00196 TAO_END_VERSIONED_NAMESPACE_DECL