C3D Toolkit  Kernel - 110050, Vision - 2.5.0.18

Reference-counted object. More...

#include <reference_item.h>

+ Inheritance diagram for MbRefItem:

Public Member Functions

 MbRefItem ()
 Constructor without parameters.
 
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.
 

Detailed Description

Reference-counted object.

Object counting number of its owners.
Is used as one of parent classes of geometric objects.
If inheritor of current class is captured by other object or algorithm, then the other object or algorithm has to increase reference counter by one by AddRef() method. At refusal of use of the successor of this class by other object (for example at destruction) or by algorithm, the other object or algorithm has to decrease reference counter by one by Release() method. Such rule allows to use the same inheritor of current class simultaneously by several other objects or algorithms and guarantees that the object will be removed when it becomes unnecessary.

Note
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
SPtr

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