template<class T, template< class > class TCreationPolicy = SCPCreateUsingNew, template< class > class TLifetimePolicy = SLPDefaultLifetime, template< class > class TThreadingModel = STMSingleThreaded>
class icl_core::Singleton< T, TCreationPolicy, TLifetimePolicy, TThreadingModel >
A generic, policy-based singleton.
- Parameters
-
T | The class for which to maintain a singleton instance. |
TCreationPolicy | A policy for creating the instance, to allow for different allocators. |
- See also
- SingletonCreationPolicies.h
- Parameters
-
TLifetimePolicy | A policy for managing the instance's lifetime, to control whether, when and how to destroy the instance. |
- See also
- SingletonLifetimePolicies.h
- Parameters
-
TThreadingModel | A policy for managing thread safety. The standard model provided in icl_core is for single-threaded use only. Thread-safe implementations can be found in icl_core_logging and icl_core_thread. |
- See also
- SingletonThreadingModels.h
Definition at line 55 of file Singleton.h.
template<class T , template< class > class TCreationPolicy = SCPCreateUsingNew, template< class > class TLifetimePolicy = SLPDefaultLifetime, template< class > class TThreadingModel = STMSingleThreaded>
bool icl_core::Singleton< T, TCreationPolicy, TLifetimePolicy, TThreadingModel >::m_destroyed = false |
|
staticprivate |
Indicates whether the instance has been destroyed.
Definition at line 76 of file Singleton.h.
template<class T , template< class > class TCreationPolicy = SCPCreateUsingNew, template< class > class TLifetimePolicy = SLPDefaultLifetime, template< class > class TThreadingModel = STMSingleThreaded>
TThreadingModel< T >::Lock icl_core::Singleton< T, TCreationPolicy, TLifetimePolicy, TThreadingModel >::m_lock |
|
staticprivate |
The lock for synchronizing instantiation. Must be default-constructable.
Definition at line 78 of file Singleton.h.