matador::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.
 

Detailed Description

template<typename T>
class matador::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

◆ value_type

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

Shortcut for the singletons type

Member Function Documentation

◆ instance()

template<typename T >
static value_type & matador::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:
  • matador/utils/singleton.hpp