![]() |
Gamedev Framework (gf) 1.2.0
A C++17 framework for 2D games
|
A storage for a singleton. More...
#include <gf/Singleton.h>
Public Member Functions | |
template<typename ... Args> | |
SingletonStorage (Singleton< T > &ref, Args &&... args) | |
Construct a storage for a singleton. More... | |
A storage for a singleton.
This class is a wrapper around an object of class T
that should be unique in the system. It works in cooperation with a global variable of type gf::Singleton<T>. The global variable is for the access of the object while this class is for the storage of the object. The global variable is initialized at the storage construction.
|
inline |
Construct a storage for a singleton.
ref | a reference to a singleton (a global variable) |
args | arguments for the constructor of class T |