24 #ifndef PXR_BASE_TF_SINGLETON_H 25 #define PXR_BASE_TF_SINGLETON_H 110 PXR_NAMESPACE_OPEN_SCOPE
140 ARCH_PRAGMA_UNDEFINED_VAR_TEMPLATE
141 T *p = _instance.load();
143 p = _CreateInstance(_instance);
158 ARCH_PRAGMA_UNDEFINED_VAR_TEMPLATE
159 return static_cast<bool>(_instance.load());
194 static T *_CreateInstance(std::atomic<T *> &instance);
196 static std::atomic<T *> _instance;
199 PXR_NAMESPACE_CLOSE_SCOPE
Pragmas for controlling compiler-specific behaviors.
Manage a single instance of an object (see.
static void SetInstanceConstructed(T &instance)
Indicate that the sole instance object has already been created.
static T & GetInstance()
Return a reference to an object of type T, creating it if necessary.
static bool CurrentlyExists()
Return whether or not the single object of type T is currently in existence.
static void DeleteInstance()
Destroy the sole instance object of type T, if it exists.