Interface of a reference counter. More...
#include <arcane/core/ISharedReference.h>
Public Member Functions | |
| virtual | ~ISharedReference ()=default |
| Releases resources. | |
| virtual void | addRef ()=0 |
| Increments the reference counter. | |
| virtual void | removeRef ()=0 |
| Decrements the reference counter. | |
| virtual Int32 | refCount () const =0 |
| Returns the value of the reference counter. | |
Interface of a reference counter.
The reference counter allows a class instance to know the number of references on it. When this number reaches zero, it means that the instance is no longer used. This system is used primarily to automatically free memory when the number of references drops to zero.
This class is used through classes like AutoRefT which allow automatically incrementing or decrementing the counter of the objects they point to.
Definition at line 42 of file ISharedReference.h.
|
pure virtual |
Increments the reference counter.
Implemented in Arcane::ItemPairGroupImpl, and Arcane::SharedReference.
|
pure virtual |
Returns the value of the reference counter.
Implemented in Arcane::SharedReference.
|
pure virtual |
Decrements the reference counter.
Implemented in Arcane::ItemPairGroupImpl, and Arcane::SharedReference.