7#ifndef PXR_BASE_TF_SINGLETON_H
8#define PXR_BASE_TF_SINGLETON_H
95PXR_NAMESPACE_OPEN_SCOPE
97struct Tf_SingletonInitState;
127 ARCH_PRAGMA_UNDEFINED_VAR_TEMPLATE
128 T *p = _instance.load();
130 p = _CreateOrWaitForInstance(_instance);
145 ARCH_PRAGMA_UNDEFINED_VAR_TEMPLATE
146 return static_cast<bool>(_instance.load());
186 static T *_CreateOrWaitForInstance(std::atomic<T *> &instance);
188 static std::atomic<T *> _instance;
189 static std::atomic<Tf_SingletonInitState *> _initState;
192PXR_NAMESPACE_CLOSE_SCOPE
Manage a single instance of an object (see.
static void DeleteInstance()
Destroy the sole instance object of type T, if it exists.
static void SetInstanceConstructed(T &instance)
Indicate that the sole instance object has already been created.
static bool CurrentlyExists()
Return whether or not the single object of type T is currently in existence.
static T & GetInstance()
Return a reference to an object of type T, creating it if necessary.
Pragmas for controlling compiler-specific behaviors.