28#ifndef DOXYGEN_SHOULD_SKIP_THIS
33 class SingletonStorage;
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
A singleton that wraps a pointer provided by a storage.
Definition: Singleton.h:55
Singleton & operator=(const Singleton &)=delete
Deleted copy assignment.
Singleton & operator=(Singleton &&)=delete
Deleted move assignment.
Singleton(const Singleton &)=delete
Deleted copy constructor.
T & operator()()
Access the singleton.
Definition: Singleton.h:96
Singleton()
Default constructor.
Definition: Singleton.h:63
void reset() noexcept
Reset the singleton.
Definition: Singleton.h:106
bool isValid() const noexcept
Check if the singleton has been initialized.
Definition: Singleton.h:115
Singleton(Singleton &&)=delete
Deleted move constructor.
A storage for a singleton.
Definition: Singleton.h:148
SingletonStorage(Singleton< T > &ref, Args &&... args)
Construct a storage for a singleton.
Definition: Singleton.h:158
The namespace for gf classes.