Encapsulation of a pointer with a reference counter. More...
#include <arccore/base/AutoRef2.h>
Public Types | |
| using | ThatClass = AutoRef2<T> |
Public Member Functions | |
| AutoRef2 ()=default | |
| Constructs an instance without a reference. | |
| AutoRef2 (T *t) | |
| Constructs an instance referencing t. | |
| AutoRef2 (const ThatClass &from) | |
| Constructs a reference referencing from. | |
| AutoRef2 (ThatClass &&from) noexcept | |
| Constructs a reference referencing from. | |
| ThatClass & | operator= (const ThatClass &from) |
| Copy operator. | |
| ThatClass & | operator= (ThatClass &&from) noexcept |
| Move operator. | |
| ThatClass & | operator= (T *new_value) |
| Assigns the value new_value to the instance. | |
| ~AutoRef2 () | |
| Destructor. Decrements the reference counter of the pointed object. | |
| T * | operator-> () const |
| Returns the object referenced by the instance. | |
| T & | operator* () const |
| Returns the object referenced by the instance. | |
| T * | get () const |
| Returns the object referenced by the instance. | |
| bool | isNull () const |
| operator bool () const | |
Friends | |
| bool | operator== (const ThatClass &a, const ThatClass &b) |
| bool | operator!= (const ThatClass &a, const ThatClass &b) |
Encapsulation of a pointer with a reference counter.
This class encapsulates a pointer of a type that implements the methods of the abstract class ISharedReference (the template parameter does not need to derive from this class) and increments (addRef()) or decrements (removeRef()) the reference counter of the pointed element during successive assignments. This class performs no action based on the reference counter value; the eventual destruction of the object when the reference counter reaches zero is handled by the object itself.
Definition at line 40 of file AutoRef2.h.
| using Arcane::AutoRef2< T >::ThatClass = AutoRef2<T> |
Definition at line 44 of file AutoRef2.h.
|
inlineexplicit |
Constructs an instance referencing t.
Definition at line 51 of file AutoRef2.h.
|
inline |
Constructs a reference referencing from.
Definition at line 56 of file AutoRef2.h.
|
inlinenoexcept |
Constructs a reference referencing from.
Definition at line 61 of file AutoRef2.h.
|
inline |
Destructor. Decrements the reference counter of the pointed object.
Definition at line 90 of file AutoRef2.h.
|
inline |
Returns the object referenced by the instance.
Definition at line 107 of file AutoRef2.h.
|
inline |
Definition at line 109 of file AutoRef2.h.
|
inline |
Definition at line 110 of file AutoRef2.h.
|
inline |
Returns the object referenced by the instance.
Definition at line 100 of file AutoRef2.h.
|
inline |
Returns the object referenced by the instance.
Definition at line 93 of file AutoRef2.h.
|
inline |
Copy operator.
Definition at line 68 of file AutoRef2.h.
|
inline |
Assigns the value new_value to the instance.
Definition at line 83 of file AutoRef2.h.
|
inlinenoexcept |
Move operator.
Definition at line 74 of file AutoRef2.h.
|
friend |
Definition at line 116 of file AutoRef2.h.
|
friend |
Definition at line 112 of file AutoRef2.h.