Bicameral Engine
GPU-resident engine for a magic-research open-world game
Loading...
Searching...
No Matches
bicameral::Singleton< T > Class Template Referencefinal

#include <singleton.h>

Static Public Member Functions

static T & GetInstance ()

Static Private Member Functions

static void Create ()
static void Destroy ()

Static Private Attributes

static std::mutex s_mutex
static std::atomic< T * > s_instance = nullptr

Detailed Description

template<typename T>
class bicameral::Singleton< T >

Definition at line 51 of file singleton.h.

Member Function Documentation

◆ Create()

template<typename T>
void bicameral::Singleton< T >::Create ( )
inlinestaticprivate

Definition at line 66 of file singleton.h.

References bicameral::SingletonFinalizer::AddFinalizer(), Destroy(), and s_instance.

Referenced by GetInstance().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Destroy()

template<typename T>
void bicameral::Singleton< T >::Destroy ( )
inlinestaticprivate

Definition at line 71 of file singleton.h.

References s_instance, and s_mutex.

Referenced by Create().

Here is the caller graph for this function:

◆ GetInstance()

template<typename T>
T & bicameral::Singleton< T >::GetInstance ( )
inlinestatic

Definition at line 53 of file singleton.h.

References Create(), s_instance, and s_mutex.

Referenced by bicameral::GetLogger().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ s_instance

template<typename T>
std::atomic<T*> bicameral::Singleton< T >::s_instance = nullptr
inlinestaticprivate

Definition at line 77 of file singleton.h.

Referenced by Create(), Destroy(), and GetInstance().

◆ s_mutex

template<typename T>
std::mutex bicameral::Singleton< T >::s_mutex
inlinestaticprivate

Definition at line 76 of file singleton.h.

Referenced by Destroy(), and GetInstance().


The documentation for this class was generated from the following file: