Implementation of a reference counter using std::atomic. More...
#include <arcane/core/SharedReference.h>
Public Member Functions | |
| void | addRef () override |
| Increments the reference counter. | |
| void | removeRef () override |
| Decrements the reference counter. | |
| Int32 | refCount () const override |
| Returns the value of the reference counter. | |
| virtual void | deleteMe ()=0 |
| Destroys the referenced object. | |
| Public Member Functions inherited from Arcane::ISharedReference | |
| virtual | ~ISharedReference ()=default |
| Releases resources. | |
Private Attributes | |
| std::atomic< Int32 > | m_ref_count |
| Number of references on the object. | |
Implementation of a reference counter using std::atomic.
Definition at line 34 of file SharedReference.h.
|
inline |
Definition at line 39 of file SharedReference.h.
|
overridevirtual |
Increments the reference counter.
Implements Arcane::ISharedReference.
Definition at line 27 of file SharedReference.cc.
References m_ref_count.
Referenced by Arcane::ItemPairGroupImpl::addRef().
|
pure virtual |
Destroys the referenced object.
Implemented in Arcane::ItemGroupImpl, Arcane::ItemPairGroupImpl, Arcane::PropertiesImpl, and Arcane::VariableCollection::Impl.
Referenced by removeRef().
|
inlineoverridevirtual |
Returns the value of the reference counter.
Implements Arcane::ISharedReference.
Definition at line 47 of file SharedReference.h.
References m_ref_count.
Referenced by Arcane::ItemGroupImpl::nbRef(), and Arcane::ItemPairGroupImpl::nbRef().
|
overridevirtual |
Decrements the reference counter.
Implements Arcane::ISharedReference.
Definition at line 36 of file SharedReference.cc.
References Arcane::arcaneNoReferenceErrorCallTerminate(), deleteMe(), and m_ref_count.
Referenced by Arcane::ItemPairGroupImpl::removeRef().
|
private |
Number of references on the object.
Definition at line 54 of file SharedReference.h.
Referenced by addRef(), refCount(), and removeRef().