MDSTk Libraries  1.1.0
Medical Data Segmentation Toolkit
Public Types | Static Public Member Functions
mds::base::CSingletonHolder< T > Class Template Reference

Provides singleton amenities for a type T. More...

#include <mdsSingleton.h>

Inheritance diagram for mds::base::CSingletonHolder< T >:
Inheritance graph
[legend]

List of all members.

Public Types

enum  { TEMPLATE_PARAMETER_IS_NOT_SINGLETON = T::CLASS_SINGLETON }
 Check that T is singleton. More...
enum  { LONGEVITY = T::LONGEVITY }
 Singleton longevity. More...
typedef CLibraryLockableClass
< CSingletonHolder< T >
>::CLock 
tLock
 Lock type.
typedef T tPointee
 Pointee type.
typedef T * tPointer
 Pointer type.

Static Public Member Functions

static T & getInstance ()
 Returns reference to the singleton instance.
static void lock ()
 Locks the object.
static void unlock ()
 Locks the object.

Detailed Description

template<typename T>
class mds::base::CSingletonHolder< T >

Provides singleton amenities for a type T.

To protect that type from spurious instantiations, you have to protect it yourself.


Member Typedef Documentation

Lock type.

template<typename T >
typedef T mds::base::CSingletonHolder< T >::tPointee

Pointee type.

template<typename T >
typedef T* mds::base::CSingletonHolder< T >::tPointer

Pointer type.


Member Enumeration Documentation

template<typename T >
anonymous enum

Check that T is singleton.

You will see name of this enum somewhere in compiler error message if the type T is not singleton.

Enumerator:
TEMPLATE_PARAMETER_IS_NOT_SINGLETON 
template<typename T >
anonymous enum

Singleton longevity.

Enumerator:
LONGEVITY 

Member Function Documentation

template<typename T >
T & CSingletonHolder::getInstance ( ) [static]

Returns reference to the singleton instance.

static void mds::base::CLockableClass< CSingletonHolder< T > >::lock ( ) [static, inherited]

Locks the object.

static void mds::base::CLockableClass< CSingletonHolder< T > >::unlock ( ) [static, inherited]

Locks the object.


The documentation for this class was generated from the following files: