24 #ifndef PXR_BASE_TF_REF_BASE_H
25 #define PXR_BASE_TF_REF_BASE_H
101 return std::abs(_refCount.load(std::memory_order_relaxed));
110 int curValue = _refCount.load(std::memory_order_relaxed);
111 while ((curValue > 0 && shouldCall) ||
112 (curValue < 0 && !shouldCall)) {
113 if (_refCount.compare_exchange_weak(curValue, -curValue)) {
138 static UniqueChangedListener _uniqueChangedListener;
163 #endif // PXR_BASE_TF_REF_BASE_H
bool IsUnique() const
Return true if only one TfRefPtr points to this object.
TfRefBase & operator=(TfRefBase const &)
friend TfRefPtr< T > TfCreateRefPtrFromProtectedWeakPtr(TfWeakPtr< T > const &)
virtual TF_API ~TfRefBase()
void(* UniqueChangedFuncPtr)(TfRefBase const *, bool)
TfRefBase(TfRefBase const &)
virtual TF_API ~TfSimpleRefBase()
UniqueChangedFuncPtr func
static TF_API void SetUniqueChangedListener(UniqueChangedListener listener)
size_t GetCurrentCount() const
Return the current reference count of this object.
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
#define PXR_NAMESPACE_CLOSE_SCOPE
IMATH_INTERNAL_NAMESPACE_HEADER_ENTER IMATH_HOSTDEVICE constexpr T abs(T a) IMATH_NOEXCEPT
void SetShouldInvokeUniqueChangedListener(bool shouldCall)