9 SoRefPtr(
void) noexcept : ptr(NULL) { }
11 explicit SoRefPtr(T * p) : ptr(p)
13 if (this->ptr) this->ptr->ref();
16 SoRefPtr(
const SoRefPtr & other) : ptr(other.ptr)
18 if (this->ptr) this->ptr->ref();
21 SoRefPtr(SoRefPtr && other) noexcept : ptr(other.ptr)
28 if (this->ptr) this->ptr->unref();
31 SoRefPtr & operator=(SoRefPtr other)
noexcept
37 void reset(T * p = NULL)
43 T * get(
void)
const noexcept {
return this->ptr; }
44 T & operator*(
void)
const {
return *this->ptr; }
45 T * operator->(
void)
const noexcept {
return this->ptr; }
46 explicit operator bool(
void)
const noexcept {
return this->ptr != NULL; }
48 void swap(SoRefPtr & other)
noexcept
51 swap(this->ptr, other.ptr);