dart
Static Public Member Functions | Protected Member Functions | List of all members
dart::common::Singleton< T > Class Template Reference

Singleton template class. More...

#include <Singleton.hpp>

Inheritance diagram for dart::common::Singleton< T >:
Inheritance graph
[legend]

Static Public Member Functions

template<typename... Args>
static T & getSingleton (Args... _args)
 Returns reference of the singleton.
 
template<typename... Args>
static T * getSingletonPtr (Args... _args)
 Returns pointer of the singleton.
 

Protected Member Functions

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

Detailed Description

template<typename T>
class dart::common::Singleton< T >

Singleton template class.

Note
This singleton is not thread safe. For use of thread safe singleton, use static initialization as:

// Singletone class Engine class Engine : public Singleton<Engine> {};

// Call before main() and use theT only instead of calling getSingleton() static T& theT = T::getSingleton();


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