#include <refcount.hh>
vRef automatically releases its contained object when it goes out of scope (i.e., when it is destroyed). Almost every function in VOS that returns a RefCounted object (e.g. any MetaObject or Vobject) increments that object's reference count before doing so. This means that you must use this class to store that object, or manually call RefCounted::release() on the object when you are done using it.
Note that this class takes care of releasing your object automatically, not acquiring it. For example, if you assign (with =) a pointer (or another vRef) from some vRef and then store that pointer (or other vRef) beyond the life of the original vRef object, its reference count will be incorrect: call acquire() on the object when you store the pointer (or other vRef).
However, the copy constructor does acquire the RefCounted object.
For more discussion and examples, see the VOS manual and the tutorial programs (in "apps/tutorials").
Definition at line 235 of file refcount.hh.
|
Definition at line 240 of file refcount.hh. |
|
Definition at line 241 of file refcount.hh. |
|
Definition at line 242 of file refcount.hh. |
|
Definition at line 243 of file refcount.hh. |
|
Definition at line 244 of file refcount.hh. |
|
Definition at line 263 of file refcount.hh. Referenced by VOS::RemoteSocketSite::flushIncomingBuffers(), VOS::VobjectImplementation::insertChild(), and VOS::VobjectImplementation::setChild(). |
|
Definition at line 261 of file refcount.hh. |
|
Definition at line 259 of file refcount.hh. |
|
Definition at line 257 of file refcount.hh. |
|
Definition at line 260 of file refcount.hh. |
|
Definition at line 249 of file refcount.hh. |
|
Definition at line 247 of file refcount.hh. |
|
Definition at line 246 of file refcount.hh. |
|
Definition at line 256 of file refcount.hh. |
|
Definition at line 264 of file refcount.hh. Referenced by VOS::VobjectImplementation::removeChild(). |