24 #ifndef PXR_BASE_TF_SINGLETON_H
25 #define PXR_BASE_TF_SINGLETON_H
112 PXR_NAMESPACE_OPEN_SCOPE
141 ARCH_PRAGMA_UNDEFINED_VAR_TEMPLATE
142 return ARCH_LIKELY(_instance) ? *_instance : _CreateInstance();
151 return _instance ?
true :
false;
175 "GetInstance() has completed");
176 _instance = &instance;
192 static T& _CreateInstance();
193 static void _DestroyInstance();
196 ARCH_PRAGMA_NEEDS_EXPORT_INTERFACE
197 static std::mutex* _mutex;
201 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.
#define TF_FATAL_ERROR(fmt, args)
Issue a fatal error and end the program.
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.
Stripped down version of diagnostic.h that doesn't define std::string.