Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
Arcane::ISharedReference Class Referenceabstract

Interface of a reference counter. More...

#include <arcane/core/ISharedReference.h>

Inheritance diagram for Arcane::ISharedReference:
Collaboration diagram for Arcane::ISharedReference:

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.

Detailed Description

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.

Member Function Documentation

◆ addRef()

virtual void Arcane::ISharedReference::addRef ( )
pure virtual

Increments the reference counter.

Implemented in Arcane::ItemPairGroupImpl, and Arcane::SharedReference.

◆ refCount()

virtual Int32 Arcane::ISharedReference::refCount ( ) const
pure virtual

Returns the value of the reference counter.

Implemented in Arcane::SharedReference.

◆ removeRef()

virtual void Arcane::ISharedReference::removeRef ( )
pure virtual

Decrements the reference counter.

Implemented in Arcane::ItemPairGroupImpl, and Arcane::SharedReference.


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