23 using std::shared_ptr;
119 OIIO_DASSERT(0 &&
"release() when you aren't the sole owner");
148 T*
get()
const noexcept {
return m_ptr; }
151 operator bool() const noexcept {
return m_ptr != NULL; }
192 bool _decref()
const {
return (--m_refcnt) == 0; }
234 #define OIIO_REFCNT_HAS_RELEASE 1
~intrusive_ptr()
Destructor.
T * operator->() const
Dereference.
GLboolean GLboolean GLboolean GLboolean a
intrusive_ptr(const intrusive_ptr &r)
Construct from another intrusive_ptr.
void reset() noexcept
Reset to null reference.
void swap(intrusive_ptr &r) noexcept
Swap intrusive pointers.
friend bool operator==(const intrusive_ptr &a, const T *b)
intrusive_ptr(intrusive_ptr &&r) noexcept
Move construct from another intrusive_ptr.
void intrusive_ptr_release(T *x)
intrusive_ptr() noexcept
Default ctr.
T * get() const noexcept
Get raw pointer.
GLboolean GLboolean GLboolean b
Wrappers and utilities for atomics.
void reset(T *r)
Reset to point to a pointer.
T & operator*() const
Dereference.
void intrusive_ptr_add_ref(T *x)
intrusive_ptr & operator=(const intrusive_ptr &r)
Assign from intrusive_ptr.
friend bool operator==(const T *b, const intrusive_ptr &a)
intrusive_ptr & operator=(intrusive_ptr &&r) noexcept
Move assignment from intrusive_ptr.
#define OIIO_NAMESPACE_END
const RefCnt & operator=(const RefCnt &) const
#define OIIO_NAMESPACE_BEGIN
A simple intrusive pointer, modeled after std::shared_ptr.