nnl::Singleton< T > Class Template Reference

Singleton design pattern impl. More...

#include <singleton.hh>

Inheritance diagram for nnl::Singleton< T >:

nnl::Netman List of all members.

Public Member Functions

 Singleton ()
 Constructor.
virtual ~Singleton ()
 Destructor.

Static Public Member Functions

static T * InstanceP (void)
 Get instance.
static T & Instance (void)
 Get instance.
static T & Instance (const char *file, unsigned line)
 Get instance.

Static Private Attributes

static T * mpInstance = 0
 instance ptr

Detailed Description

template<typename T>
class nnl::Singleton< T >

Singleton design pattern impl.


Member Function Documentation

template<typename T>
static T& nnl::Singleton< T >::Instance ( const char *  file,
unsigned  line 
) [inline, static]

Get instance.

Does not create one. In case instance is null, the exception text contains file and line.

Parameters:
file file name where this op is called
line line number where this op is called
Returns:
valid instance
Exceptions:
std::runtime_error in case instance is null

template<typename T>
static T& nnl::Singleton< T >::Instance ( void   )  [inline, static]

Get instance.

Does not create one.

Returns:
valid instance
Exceptions:
std::runtime_error in case instance is null

template<typename T>
static T* nnl::Singleton< T >::InstanceP ( void   )  [inline, static]

Get instance.

Does not create one.


The documentation for this class was generated from the following file:
Generated on Tue Jun 19 10:31:48 2012 for nnl by  doxygen 1.4.7