24#ifndef PXR_BASE_TF_REF_COUNT_H
25#define PXR_BASE_TF_REF_COUNT_H
33#include "pxr/base/tf/api.h"
36PXR_NAMESPACE_OPEN_SCOPE
95 bool _DecrementAndTestIfZero()
const {
96 return (--_counter == 0);
100 int _FetchAndAdd(
int amount)
const {
101 return _counter.fetch_add(amount);
105 mutable std::atomic<int> _counter;
106 template <
typename T>
friend class TfRefPtr;
107 friend struct Tf_RefPtr_UniqueChangedCounter;
108 friend struct Tf_RefPtr_Counter;
111PXR_NAMESPACE_CLOSE_SCOPE
int Get() const
Returns counter's value.
const TfRefCount & operator=(const TfRefCount &) const
Assignment to a reference counter has no effect.
TfRefCount()
Initialize counter to one.
TfRefCount(const TfRefCount &)
Initialize counter to one.
Reference-counted smart pointer utility class.