LDK::Singleton< T, StoragePolicy > Class Template Reference
[Patterns]

A policy based generic singleton. More...

#include <LDK/Singletons.h>

Inheritance diagram for LDK::Singleton< T, StoragePolicy >:

Inheritance graph
[legend]

Public Types

typedef StoragePolicy< T > SP
typedef SP::Type Type
typedef SP::PointerType PointerType
typedef SP::ReferenceType ReferenceType

Static Public Member Functions

static void initialise ()
static ReferenceType instance ()

Protected Member Functions

 Singleton ()
 Singleton (const Singleton &)
 ~Singleton ()
void operator= (const Singleton &)

Detailed Description

template<class T, template< class > class StoragePolicy = DEFAULT_SINGLETON_STORAGE>
class LDK::Singleton< T, StoragePolicy >

Must be explicity initialised (in the main thread only, with the initialise static method) before use, and will be automatically destroyed in the reverse order to initialisation.

The instance a singleton encapsulates is obtained by a call to the static instance method, which returns a reference to the instance. References are used rather than pointers to prevent delete being called on a singleton managed instance.

Definition at line 231 of file Singletons.h.


The documentation for this class was generated from the following file:
Generated on Fri Aug 17 18:32:27 2007 for LDK by  doxygen 1.5.1