00001 // $Id: Reply_Dispatcher.cpp 85001 2009-03-31 10:06:45Z msmit $ 00002 00003 #include "tao/Reply_Dispatcher.h" 00004 00005 ACE_RCSID (tao, 00006 Reply_Dispatcher, 00007 "$Id: Reply_Dispatcher.cpp 85001 2009-03-31 10:06:45Z msmit $") 00008 00009 #if !defined (__ACE_INLINE__) 00010 #include "tao/Reply_Dispatcher.inl" 00011 #endif /* __ACE_INLINE__ */ 00012 00013 TAO_BEGIN_VERSIONED_NAMESPACE_DECL 00014 00015 // Constructor. 00016 TAO_Reply_Dispatcher::TAO_Reply_Dispatcher (ACE_Allocator *allocator) 00017 // Just an invalid reply status. 00018 : locate_reply_status_ (GIOP::UNKNOWN_OBJECT) 00019 , reply_status_ (GIOP::NO_EXCEPTION) 00020 , refcnt_ (1) 00021 , allocator_(allocator) 00022 { 00023 } 00024 00025 // Destructor. 00026 TAO_Reply_Dispatcher::~TAO_Reply_Dispatcher (void) 00027 { 00028 } 00029 00030 00031 void 00032 TAO_Reply_Dispatcher::intrusive_add_ref (TAO_Reply_Dispatcher* rd) 00033 { 00034 if (rd != 0) 00035 { 00036 ++rd->refcnt_; 00037 } 00038 } 00039 00040 void 00041 TAO_Reply_Dispatcher::intrusive_remove_ref (TAO_Reply_Dispatcher* rd) 00042 { 00043 if (rd != 0) 00044 { 00045 long tmp = --rd->refcnt_; 00046 if (tmp <= 0) 00047 { 00048 if (rd->allocator_) 00049 { 00050 ACE_DES_FREE (rd, 00051 rd->allocator_->free, 00052 TAO_Reply_Dispatcher); 00053 } 00054 else 00055 { 00056 delete rd; 00057 } 00058 } 00059 } 00060 } 00061 00062 TAO_END_VERSIONED_NAMESPACE_DECL