#include <vos/corelibs/vos/refcount.hh>
Inheritance diagram for VOS::RefCounted:
It also provides a facility for tracking references to this object, so that they may be notified when the application wants this object to be deleted. You can use vRef to automatically release RefCounted objects when they would normally be destroyed (go out of scope).
class Foo : public virtual RefCounted { ... };
Definition at line 153 of file refcount.hh.
|
Construct the refcount object with a starting count of 1.
Definition at line 160 of file refcount.hh. |
|
copy constructor, need to reset count for copy
Definition at line 163 of file refcount.hh. |
|
Destructor. (Cleans up excise listeners) Definition at line 166 of file refcount.hh. |
|
|
Add an excise listener. When the excise method is called on this object, each excise listener will be notified so that it may clean up any references to this object. Referenced by VOS::VobjectImplementation::addChildListener(), VOS::VobjectImplementation::addMessageHandler(), VOS::VobjectImplementation::addParentListener(), VOS::VobjectImplementation::addTypeListener(), and VOS::VobjectImplementation::addUpdateHandler(). |
|
This method is used by release() to destroy this object if the refcount reaches 0. By default, it simply calls "delete this". However, you can override it in a subclass if you need to do something other than deleting this object. |
|
Try to cause all known references to this object to release their references so the object will be deleted, by calling ObjectExciseListener::notifyObjectExcise().
Reimplemented in VOS::LocalMetaObject, VOS::MetaObject, VOS::RemoteMetaObject, VOS::RemoteSite, VOS::RemoteSocketSite, and VOS::VobjectImplementation. Referenced by VOS::RemoteSite::excise(). |
|
Get the current reference count.
Reimplemented in VOS::LocalMetaObject, VOS::MetaObject, and VOS::RemoteMetaObject. Referenced by VOS::RemoteVobject::acquire(), VOS::VobjectImplementation::excise(), and VOS::RemoteVobject::release(). |
|
|
Remove an excise listener.
Referenced by VOS::VobjectImplementation::excise(), VOS::VobjectImplementation::removeChildListener(), VOS::VobjectImplementation::removeMessageHandler(), VOS::VobjectImplementation::removeParentListener(), VOS::VobjectImplementation::removeTypeListener(), VOS::VobjectImplementation::removeUpdateHandler(), and VOS::VobjectImplementation::~VobjectImplementation(). |