![]() |
Scarab
3.2.2
Project 8 C++ Utility Library
|
Base class that turns a class into a singleton. More...
#include <singleton.hh>
Static Public Member Functions | |
static x_type * | get_instance () |
static void | kill_instance () |
template<class... x_args> | |
static x_type * | create_instance (x_args... args) |
Protected Member Functions | |
singleton () | |
~singleton () | |
Static Protected Attributes | |
static std::mutex | f_mutex |
Static Private Member Functions | |
static void | construct_instance () |
static void | delete_instance () |
Static Private Attributes | |
static x_type * | f_instance = nullptr |
static destroyer< x_type > | f_destroyer |
Friends | |
class | destroyer< x_type > |
Base class that turns a class into a singleton.
To use:
allow_singleton_access( your_class )
macro to your class definition to allow the base classes to access your classThe mutex f_mutex provides thread safety for creation and destruction of an instance of the singleton. It's available to the derived class for thread-safe access to the object in general.
Definition at line 43 of file singleton.hh.
|
protected |
Definition at line 137 of file singleton.hh.
|
protected |
Definition at line 141 of file singleton.hh.
|
staticprivate |
Definition at line 116 of file singleton.hh.
|
static |
Definition at line 103 of file singleton.hh.
|
staticprivate |
Definition at line 126 of file singleton.hh.
|
static |
Definition at line 80 of file singleton.hh.
|
static |
Definition at line 91 of file singleton.hh.
|
friend |
Definition at line 66 of file singleton.hh.
|
staticprivate |
Definition at line 58 of file singleton.hh.
|
staticprivate |
Definition at line 57 of file singleton.hh.
|
staticprotected |
Definition at line 61 of file singleton.hh.