21 #ifndef GF_SINGLETON_H 22 #define GF_SINGLETON_H 28 #ifndef DOXYGEN_SHOULD_SKIP_THIS 116 return m_single !=
nullptr;
157 template<
typename ... Args>
159 : m_storage(
std::forward<Args>(args)...) {
160 assert(ref.m_single ==
nullptr);
161 ref.m_single = &m_storage;
168 #ifndef DOXYGEN_SHOULD_SKIP_THIS 173 #endif // GF_SINGLETON_H
void reset() noexcept
Reset the singleton.
Definition: Singleton.h:106
The namespace for gf classes.
Definition: Action.h:35
T & operator()()
Access the singleton.
Definition: Singleton.h:96
Singleton()
Default constructor.
Definition: Singleton.h:63
bool isValid() const noexcept
Check if the singleton has been initialized.
Definition: Singleton.h:115
SingletonStorage(Singleton< T > &ref, Args &&... args)
Construct a storage for a singleton.
Definition: Singleton.h:158
A storage for a singleton.
Definition: Singleton.h:33
A singleton that wraps a pointer provided by a storage.
Definition: Singleton.h:55