32 operator T* ()
const noexcept {
47 operator bool () const noexcept {
56 return get() == other.get();
64 return !(*
this == other);
71 return get() ==
nullptr;
79 return get()->getRefCount() == 0;
87 return get()->getRefCount() == 1;
93 T*
get()
const noexcept {
101 void set(T* ptr) noexcept {
bool operator!=(const RefBase &other) const noexcept
Check if two refs are not the same.
Definition: RefBase.h:63
RefBase() noexcept=default
Initializes object pointer to nullptr.
bool isUnique() const noexcept
Check if object has only one strong reference.
Definition: RefBase.h:85
RefBase(T *ptr) noexcept
Initializes object pointer with ptr.
Definition: RefBase.h:26
Generic base class of a pointer for reference counted objects.
Definition: RefBase.h:17
T & operator*() const noexcept
Dereference operator.
Definition: RefBase.h:39
T * m_ptr
Raw pointer.
Definition: RefBase.h:106
bool isExpired() const noexcept
Check is object is dead.
Definition: RefBase.h:77
void set(T *ptr) noexcept
Replace object pointer without any checks or reference management.
Definition: RefBase.h:101
bool isNull() const noexcept
Check for nullptr.
Definition: RefBase.h:70
bool operator==(const RefBase &other) const noexcept
Check if two refs are the same.
Definition: RefBase.h:55