oos::singleton< T > Class Template Reference

Provides only one instance of a type. More...

#include <singleton.hpp>

Public Types

typedef T value_type
 

Static Public Member Functions

static value_typeinstance ()
 Access the instance of the class. More...
 

Detailed Description

template<typename T>
class oos::singleton< T >

Provides only one instance of a type.

Template Parameters
TThe type of the singleton.

This class implements the singleton pattern. It ensures that only one instance of a class exists.

Note
The derived class must add a friend declaration for the concrete singleton type.

Member Typedef Documentation

template<typename T>
typedef T oos::singleton< T >::value_type

Shortcut for the singletons type

Member Function Documentation

template<typename T>
static value_type& oos::singleton< T >::instance ( )
inlinestatic

Access the instance of the class.

The static instance method provides the access to the one instance of the concrete class.

Returns
The one instance of the class.

The documentation for this class was generated from the following file:
  • tools/singleton.hpp