Revert "Minor modernization of DynamicAny code"
[ACE_TAO.git] / TAO / tao / TAO_Server_Request.inl
blobb7feb853996c3475a15112978a02960b02de7cfd
1 // -*- C++ -*-
2 #include "tao/GIOP_Utils.h"
4 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
6 // This constructor is used by the CSD clone.
7 ACE_INLINE
8 TAO_ServerRequest::TAO_ServerRequest ()
9   : mesg_base_ (0),
10     operation_ (0),
11     operation_len_ (0),
12     release_operation_ (false),
13     is_forwarded_ (false),
14     incoming_ (0),
15     outgoing_ (0),
16     response_expected_ (false),
17     deferred_reply_ (false),
18     sync_with_server_ (false),
19     is_queued_ (false),
20     is_dsi_ (false),
21     reply_status_ (GIOP::NO_EXCEPTION),
22     orb_core_ (0),
23     request_id_ (0),
24     profile_ (0),
25     requesting_principal_ (0),
26     dsi_nvlist_align_ (0),
27     operation_details_ (0),
28     argument_flag_ (true)
29 #if TAO_HAS_INTERCEPTORS == 1
30   , interceptor_count_ (0)
31   , rs_pi_current_ ()
32   , caught_exception_ (0)
33   , pi_reply_status_ (-1)
34 #endif  /* TAO_HAS_INTERCEPTORS == 1 */
35   ,  transport_(0)
39 ACE_INLINE TAO_ORB_Core *
40 TAO_ServerRequest::orb_core () const
42   return this->orb_core_;
45 ACE_INLINE TAO_InputCDR *
46 TAO_ServerRequest::incoming () const
48   return this->incoming_;
51 ACE_INLINE TAO_OutputCDR *
52 TAO_ServerRequest::outgoing () const
54   return this->outgoing_;
57 ACE_INLINE const char *
58 TAO_ServerRequest::operation () const
60   return (this->operation_ == 0 ? "" : this->operation_);
63 ACE_INLINE void
64 TAO_ServerRequest::operation (const char *operation,
65                               size_t length,
66                               int release)
68   if (this->release_operation_)
69     CORBA::string_free (const_cast <char*> (this->operation_));
71   this->operation_len_ = (length == 0 ? std::strlen (operation) : length);
72   this->release_operation_ = release;
73   this->operation_ = operation;
76 ACE_INLINE size_t
77 TAO_ServerRequest::operation_length () const
79   return this->operation_len_;
82 ACE_INLINE CORBA::Boolean
83 TAO_ServerRequest::response_expected () const
85   return this->response_expected_;
88 ACE_INLINE CORBA::Boolean
89 TAO_ServerRequest::deferred_reply () const
91   return this->deferred_reply_;
94 ACE_INLINE void
95 TAO_ServerRequest::response_expected (CORBA::Boolean response)
97   this->response_expected_ = response;
100 ACE_INLINE void
101 TAO_ServerRequest::sync_before_dispatch ()
103   if (this->sync_with_server_ &&
104       this->transport_ != 0 &&
105       this->is_queued_)
106     {
107       this->send_no_exception_reply ();
108     }
111 ACE_INLINE void
112 TAO_ServerRequest::sync_after_dispatch ()
114   if (this->sync_with_server_ &&
115       this->transport_ != 0 &&
116       !this->is_queued_)
117     {
118       this->send_no_exception_reply ();
119     }
122 ACE_INLINE CORBA::Boolean
123 TAO_ServerRequest::sync_with_server () const
125   return this->sync_with_server_;
128 ACE_INLINE void
129 TAO_ServerRequest::sync_with_server (CORBA::Boolean sync_flag)
131   this->sync_with_server_ = sync_flag;
134 ACE_INLINE CORBA::Boolean
135 TAO_ServerRequest::is_queued () const
137   return this->is_queued_;
140 ACE_INLINE void
141 TAO_ServerRequest::is_queued (CORBA::Boolean queued_flag)
143   this->is_queued_ = queued_flag;
146 ACE_INLINE TAO::ObjectKey &
147 TAO_ServerRequest::object_key ()
149   return this->profile_.object_key ();
152 ACE_INLINE TAO_Service_Context &
153 TAO_ServerRequest::request_service_context ()
155   return this->request_service_context_;
158 ACE_INLINE IOP::ServiceContextList &
159 TAO_ServerRequest::reply_service_info ()
161   return this->reply_service_context ().service_info ();
164 ACE_INLINE IOP::ServiceContextList &
165 TAO_ServerRequest::request_service_info ()
167   return this->request_service_context ().service_info ();
170 ACE_INLINE TAO_Transport *
171 TAO_ServerRequest::transport ()
173   return this->transport_.get ();
176 ACE_INLINE CORBA::ULong
177 TAO_ServerRequest::request_id ()
179   return this->request_id_;
182 ACE_INLINE void
183 TAO_ServerRequest::request_id (CORBA::ULong req)
185   this->request_id_ = req;
188 ACE_INLINE void
189 TAO_ServerRequest::requesting_principal (const CORBA::OctetSeq &principal)
191   this->requesting_principal_ = principal;
194 ACE_INLINE TAO_Tagged_Profile &
195 TAO_ServerRequest::profile ()
197   return this->profile_;
200 ACE_INLINE void
201 TAO_ServerRequest::forward_location (CORBA::Object_ptr forward_reference)
203   this->forward_location_ =
204     CORBA::Object::_duplicate (forward_reference);
205   this->is_forwarded_ = true;
208 ACE_INLINE CORBA::Object_ptr
209 TAO_ServerRequest::forward_location ()
211   return CORBA::Object::_duplicate (this->forward_location_.in ());
214 ACE_INLINE bool
215 TAO_ServerRequest::is_forwarded () const
217   return this->is_forwarded_;
220 ACE_INLINE GIOP::ReplyStatusType
221 TAO_ServerRequest::reply_status ()
223   return this->reply_status_;
226 ACE_INLINE void
227 TAO_ServerRequest::reply_status (GIOP::ReplyStatusType reply_status)
229   this->reply_status_ = reply_status;
232 ACE_INLINE void
233 TAO_ServerRequest::is_dsi ()
235   this->is_dsi_ = true;
238 ACE_INLINE TAO_Operation_Details const *
239 TAO_ServerRequest::operation_details () const
241   return this->operation_details_;
244 ACE_INLINE void
245 TAO_ServerRequest::dsi_nvlist_align (ptrdiff_t alignment)
247   this->dsi_nvlist_align_ = alignment;
250 ACE_INLINE CORBA::Boolean
251 TAO_ServerRequest::argument_flag ()
253   return this->argument_flag_;
256 ACE_INLINE void
257 TAO_ServerRequest::argument_flag (CORBA::Boolean flag)
259   this->argument_flag_ = flag;
262 ACE_INLINE bool
263 TAO_ServerRequest::collocated () const
265   return this->transport_.get () == 0;
269 #if TAO_HAS_INTERCEPTORS == 1
270 ACE_INLINE size_t &
271 TAO_ServerRequest::interceptor_count ()
273   return this->interceptor_count_;
276 ACE_INLINE CORBA::Exception *
277 TAO_ServerRequest::caught_exception ()
279   return this->caught_exception_;
282 ACE_INLINE void
283 TAO_ServerRequest::pi_reply_status (PortableInterceptor::ReplyStatus s)
285   this->pi_reply_status_ = s;
288 ACE_INLINE PortableInterceptor::ReplyStatus
289 TAO_ServerRequest::pi_reply_status ()
291   return this->pi_reply_status_;
294 #endif  /* TAO_HAS_INTERCEPTORS == 1 */
296 TAO_END_VERSIONED_NAMESPACE_DECL