World Ocean Simulation System (WOSS) library
woss::Singleton< T > Class Template Reference

Singleton design pattern template. More...

#include <singleton-definitions.h>

Inheritance diagram for woss::Singleton< T >:
Inheritance graph
Collaboration diagram for woss::Singleton< T >:
Collaboration graph

Public Member Functions

 ~Singleton ()=default
 Singleton ()=delete
 Singleton (const Singleton &copy)=delete
 Singleton (Singleton &&tmp)=delete
Singletonoperator= (const Singleton &copy)=delete
Singletonoperator= (Singleton &&tmp)=delete

Static Public Member Functions

static T & instance ()
static T * instance_ptr ()

Detailed Description

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

Singleton design pattern template.

A thread-safe singleton template pattern, useful to decouple classes from singleton implementation

Constructor & Destructor Documentation

◆ ~Singleton()

template<typename T>
woss::Singleton< T >::~Singleton ( )
default

◆ Singleton() [1/3]

template<typename T>
woss::Singleton< T >::Singleton ( )
delete

Disallowed default constructor

◆ Singleton() [2/3]

template<typename T>
woss::Singleton< T >::Singleton ( const Singleton< T > & copy)
delete

Disallowed copy constructor

◆ Singleton() [3/3]

template<typename T>
woss::Singleton< T >::Singleton ( Singleton< T > && tmp)
delete

Disallowed move constructor

Member Function Documentation

◆ instance()

template<typename T>
T & woss::Singleton< T >::instance ( )
inlinestatic

Returns the singleton instance

Returns
a reference to the_instance

◆ instance_ptr()

template<typename T>
T * woss::Singleton< T >::instance_ptr ( )
inlinestatic

◆ operator=() [1/2]

template<typename T>
Singleton & woss::Singleton< T >::operator= ( const Singleton< T > & copy)
delete

Disallowed assignment operator

◆ operator=() [2/2]

template<typename T>
Singleton & woss::Singleton< T >::operator= ( Singleton< T > && tmp)
delete

Disallowed move assignment operator


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