12#ifndef ARCCORE_BASE_AUTOREF2_H
13#define ARCCORE_BASE_AUTOREF2_H
64 from.m_value =
nullptr;
78 from.m_value =
nullptr;
109 bool isNull()
const {
return !
m_value; }
110 operator bool()
const {
return m_value; }
112 friend bool operator==(
const ThatClass& a,
const ThatClass& b)
114 return a.get() == b.get();
116 friend bool operator!=(
const ThatClass& a,
const ThatClass& b)
118 return a.get() != b.get();
Definitions and globals of Arccore.
ThatClass & operator=(ThatClass &&from) noexcept
Move operator.
AutoRef2(const ThatClass &from)
Constructs a reference referencing from.
AutoRef2()=default
Constructs an instance without a reference.
void _addRef()
Adds a reference to the encapsulated object if not null.
AutoRef2(ThatClass &&from) noexcept
Constructs a reference referencing from.
void _changeValue(T *new_value)
Changes the referenced object to new_value.
~AutoRef2()
Destructor. Decrements the reference counter of the pointed object.
T * m_value
Pointer to the referenced object.
ThatClass & operator=(const ThatClass &from)
Copy operator.
T * get() const
Returns the object referenced by the instance.
T & operator*() const
Returns the object referenced by the instance.
void _removeRef() noexcept
Removes a reference to the encapsulated object if not null.
ThatClass & operator=(T *new_value)
Assigns the value new_value to the instance.
T * operator->() const
Returns the object referenced by the instance.
AutoRef2(T *t)
Constructs an instance referencing t.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --