#include <RcObject.h>
Public Member Functions | |
virtual | ~RcObject () |
virtual void | _add_ref () |
virtual void | _remove_ref () |
long | ref_count () const |
This accessor is purely for debugging purposes. | |
WeakObject * | _get_weak_object () const |
Protected Member Functions | |
RcObject () | |
Private Member Functions | |
RcObject (const RcObject &) | |
RcObject & | operator= (const RcObject &) |
Private Attributes | |
ACE_Atomic_Op< ACE_SYNCH_MUTEX, long > | ref_count_ |
WeakObject * | weak_object_ |
Definition at line 53 of file RcObject.h.
virtual OpenDDS::DCPS::RcObject::~RcObject | ( | ) | [inline, virtual] |
Definition at line 56 of file RcObject.h.
References OpenDDS::DCPS::WeakObject::_remove_ref(), and weak_object_.
00056 { 00057 weak_object_->_remove_ref(); 00058 }
OpenDDS::DCPS::RcObject::RcObject | ( | ) | [inline, protected] |
Definition at line 84 of file RcObject.h.
00085 : ref_count_(1) 00086 , weak_object_( new WeakObject(this) ) 00087 {}
OpenDDS::DCPS::RcObject::RcObject | ( | const RcObject & | ) | [private] |
virtual void OpenDDS::DCPS::RcObject::_add_ref | ( | void | ) | [inline, virtual] |
Reimplemented in OpenDDS::DCPS::LocalObjectBase, and OpenDDS::DCPS::SendResponseListener.
Definition at line 60 of file RcObject.h.
References ref_count_.
Referenced by OpenDDS::DCPS::Replayer::_duplicate(), OpenDDS::DCPS::TopicDescriptionImpl::add_entity_ref(), OpenDDS::DCPS::TcpConnection::add_reference(), OpenDDS::DCPS::RcEventHandler::add_reference(), OpenDDS::DCPS::WeakObject::lock(), OpenDDS::DCPS::TcpConnection::spawn_reconnect_thread(), and OpenDDS::DCPS::TransportReactorTask::svc().
00060 { 00061 ++this->ref_count_; 00062 }
WeakObject* OpenDDS::DCPS::RcObject::_get_weak_object | ( | ) | const [inline] |
Definition at line 77 of file RcObject.h.
References OpenDDS::DCPS::WeakObject::_add_ref(), and weak_object_.
00077 { 00078 weak_object_->_add_ref(); 00079 return weak_object_; 00080 }
virtual void OpenDDS::DCPS::RcObject::_remove_ref | ( | void | ) | [inline, virtual] |
Reimplemented in OpenDDS::DCPS::LocalObjectBase, and OpenDDS::DCPS::SendResponseListener.
Definition at line 64 of file RcObject.h.
References ref_count_, OpenDDS::DCPS::WeakObject::set_expire(), and weak_object_.
Referenced by OpenDDS::DCPS::TransportReactorTask::close(), TAO::Objref_Traits< OpenDDS::DCPS::Replayer >::release(), OpenDDS::DCPS::TopicDescriptionImpl::remove_entity_ref(), OpenDDS::DCPS::TcpConnection::remove_reference(), OpenDDS::DCPS::RcEventHandler::remove_reference(), and OpenDDS::DCPS::TcpConnection::spawn_reconnect_thread().
00064 { 00065 const long new_count = --this->ref_count_; 00066 if (new_count == 0 && weak_object_->set_expire()) { 00067 delete this; 00068 } 00069 }
long OpenDDS::DCPS::RcObject::ref_count | ( | ) | const [inline] |
This accessor is purely for debugging purposes.
Definition at line 72 of file RcObject.h.
References ref_count_, and ACE_Atomic_Op< ACE_LOCK, TYPE >::value().
Referenced by OpenDDS::DCPS::WeakObject::set_expire().
00072 { 00073 return this->ref_count_.value(); 00074 }
ACE_Atomic_Op<ACE_SYNCH_MUTEX, long> OpenDDS::DCPS::RcObject::ref_count_ [private] |
Definition at line 92 of file RcObject.h.
Referenced by _add_ref(), _remove_ref(), and ref_count().
WeakObject* OpenDDS::DCPS::RcObject::weak_object_ [private] |
Definition at line 93 of file RcObject.h.
Referenced by _get_weak_object(), _remove_ref(), and ~RcObject().