7 #ifndef PXR_BASE_TF_REF_BASE_H
8 #define PXR_BASE_TF_REF_BASE_H
84 return std::abs(_refCount.load(std::memory_order_relaxed));
93 int curValue = _refCount.load(std::memory_order_relaxed);
94 while ((curValue > 0 && shouldCall) ||
95 (curValue < 0 && !shouldCall)) {
96 if (_refCount.compare_exchange_weak(curValue, -curValue)) {
121 static UniqueChangedListener _uniqueChangedListener;
146 #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)