smgl 0.11.0
Structured Metadata Engine and Graph Objects Library
Loading...
Searching...
No Matches
Static Public Member Functions | Static Private Attributes | List of all members
smgl::policy::PhoenixLifetime< T > Class Template Reference

Lifetime policy which reconstructs a destroyed singleton if reaccessed. More...

#include <smgl/Singleton.hpp>

Static Public Member Functions

static void ScheduleDestruction (AtExitFunc destructionFn)
 
static void OnDeadReference ()
 

Static Private Attributes

static bool destroyed_ = false
 

Detailed Description

template<typename T>
class smgl::policy::PhoenixLifetime< T >

Lifetime policy which reconstructs a destroyed singleton if reaccessed.

Note that this constructs a new object and does not restore the previous state of the singleton.

Definition at line 65 of file Singleton.hpp.

Member Function Documentation

◆ OnDeadReference()

template<typename T >
static void smgl::policy::PhoenixLifetime< T >::OnDeadReference ( )
inlinestatic

Sets destroyed state to true

Definition at line 77 of file Singleton.hpp.

◆ ScheduleDestruction()

template<typename T >
static void smgl::policy::PhoenixLifetime< T >::ScheduleDestruction ( AtExitFunc  destructionFn)
inlinestatic

Schedule destruction using std::atexit if not destroyed already

Definition at line 69 of file Singleton.hpp.

Member Data Documentation

◆ destroyed_

template<typename T >
bool smgl::policy::PhoenixLifetime< T >::destroyed_ = false
staticprivate

Whether singleton has been destroyed

Definition at line 81 of file Singleton.hpp.


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