Cytopia  0.3
A city building simulation game
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Singleton< T > Class Template Reference

Abstract Singleton implementation. More...

#include <Singleton.hxx>

+ Inheritance diagram for Singleton< T >:
+ Collaboration diagram for Singleton< T >:

Static Public Member Functions

static T & instance (void)
 Get an instance of the singleton. More...
 

Protected Member Functions

 Singleton () noexcept=default
 
 ~Singleton () noexcept=default
 

Detailed Description

template<typename T>
class Singleton< T >

Abstract Singleton implementation.

Definition at line 8 of file Singleton.hxx.

Constructor & Destructor Documentation

◆ Singleton()

template<typename T >
Singleton< T >::Singleton ( )
protecteddefaultnoexcept

◆ ~Singleton()

template<typename T >
Singleton< T >::~Singleton ( )
protecteddefaultnoexcept

Member Function Documentation

◆ instance()

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

Get an instance of the singleton.

Definition at line 15 of file Singleton.hxx.

16  {
17  static T singleton;
18  return singleton;
19  }

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