C3D Toolkit  Kernel - 117982, Vision -

Reference-counted object. More...

#include <reference_item.h>

+ Inheritance diagram for MbRefItem:

Public Member Functions

virtual MbeRefType RefType () const
 Registration type (for copying, duplication).
Functions for registration of references to geometric object by owners of object.
refcount_t GetUseCount () const
 Get count of references (get count of owners of an object).
refcount_t AddRef () const
 Increase count of references by one.
refcount_t DecRef () const
 Decrease count of references by one.
refcount_t Release () const
 Decrease count of references by one and if count of references became zero, then remove itself.

Protected Member Functions

 MbRefItem ()
 Constructor without parameters.

Detailed Description

Reference-counted object.

Object counting number of its owners.
Is used as one of parent classes of geometric objects.
If an instance inheriting this class is captured by other object or used in algorithms, then the other object or algorithm has to increase reference counter by one by AddRef() method. When an instance of this class is released by another object (for example, when the SPtr pointer is destructed) or by the using algorithm, the using object or algorithm must call the Release() method to decrease the reference count. Such rule allows you to guarantee the validity of the MbRefItem instance as long as there is at least one of its users.

It is recommended to use smart pointers of type SPtr to instances of this class. This will simplify the work with the code where you want to take care of the automatic garbage collection.
See also

The documentation for this class was generated from the following file: