Revert "Minor modernization of DynamicAny code"
[ACE_TAO.git] / TAO / tao / Reply_Dispatcher.cpp
blob93c0819889416e3c68a72126db5f73f47bf0e1c8
1 #include "tao/Reply_Dispatcher.h"
3 #if !defined (__ACE_INLINE__)
4 #include "tao/Reply_Dispatcher.inl"
5 #endif /* __ACE_INLINE__ */
7 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
9 // Constructor.
10 TAO_Reply_Dispatcher::TAO_Reply_Dispatcher (ACE_Allocator *allocator)
11 // Just an invalid reply status.
12 : locate_reply_status_ (GIOP::UNKNOWN_OBJECT)
13 , reply_status_ (GIOP::NO_EXCEPTION)
14 , refcount_ (1)
15 , allocator_(allocator)
19 // Destructor.
20 TAO_Reply_Dispatcher::~TAO_Reply_Dispatcher ()
25 void
26 TAO_Reply_Dispatcher::intrusive_add_ref (TAO_Reply_Dispatcher* rd)
28 if (rd != nullptr)
30 ++rd->refcount_;
34 void
35 TAO_Reply_Dispatcher::intrusive_remove_ref (TAO_Reply_Dispatcher* rd)
37 if (rd != nullptr)
39 uint32_t const tmp = --rd->refcount_;
40 if (tmp == 0)
42 if (rd->allocator_)
44 ACE_DES_FREE (rd,
45 rd->allocator_->free,
46 TAO_Reply_Dispatcher);
48 else
50 delete rd;
56 TAO_END_VERSIONED_NAMESPACE_DECL