Singleton< T, InstanceArg > Class Template Reference

#include <Singleton.h>

Collaboration diagram for Singleton< T, InstanceArg >:

Collaboration graph
[legend]
List of all members.

Static Public Member Functions

static T * getInstance ()
static T * getInstance (InstanceArg *Arg)

Static Private Attributes

static T * m_pInstance = 0

Detailed Description

template<typename T, typename InstanceArg>
class Singleton< T, InstanceArg >

Definition at line 1 of file Singleton.h.


Member Function Documentation

template<typename T, typename InstanceArg>
static T* Singleton< T, InstanceArg >::getInstance ( InstanceArg *  Arg  )  [inline, static]

Definition at line 11 of file Singleton.h.

00011                                             {
00012       if(Singleton<T,InstanceArg>::m_pInstance == 0) {
00013         Singleton<T,InstanceArg>::m_pInstance = new T(Arg);
00014         return Singleton<T,InstanceArg>::m_pInstance;
00015       }
00016       else 
00017         return Singleton<T,InstanceArg>::m_pInstance;
00018     }

template<typename T, typename InstanceArg>
static T* Singleton< T, InstanceArg >::getInstance (  )  [inline, static]

Definition at line 3 of file Singleton.h.

00003                             {
00004       if(Singleton<T,InstanceArg>::m_pInstance == 0) { 
00005         Singleton<T,InstanceArg>::m_pInstance = new T();
00006         return Singleton<T,InstanceArg>::m_pInstance;
00007       }
00008       else 
00009         return Singleton<T,InstanceArg>::m_pInstance;
00010     }


Member Data Documentation

template<typename T, typename InstanceArg>
T * Singleton< T, InstanceArg >::m_pInstance = 0 [static, private]

Definition at line 21 of file Singleton.h.


The documentation for this class was generated from the following file:
(c) 2006-2007 John P. Feltz
Generated on Wed Jul 25 16:08:02 2007 for Common Media Input Layer by doxygen 1.4.7

SourceForge.net Logo