XACC
Static Public Member Functions | Protected Member Functions | Static Protected Attributes | List of all members
xacc::Singleton< T > Class Template Reference

#include <Singleton.hpp>

Static Public Member Functions

static T * instance ()
 
static void destroy ()
 

Protected Member Functions

 Singleton ()
 
virtual ~Singleton ()
 

Static Protected Attributes

static T * instance_ = nullptr
 

Detailed Description

template<class T>
class xacc::Singleton< T >

Singleton provides a templated implementation of the Singleton Design Pattern. This class takes a template parameter and provides behviour around that template that models a singleton - ie there is only one instance available during runtime.

Constructor & Destructor Documentation

template<class T>
xacc::Singleton< T >::Singleton ( )
inlineexplicitprotected

constructor

template<class T>
virtual xacc::Singleton< T >::~Singleton ( )
inlineprotectedvirtual

destructor

Member Function Documentation

template<class T>
static void xacc::Singleton< T >::destroy ( )
inlinestatic

Destroy the single instance of T

template<class T>
static T* xacc::Singleton< T >::instance ( )
inlinestatic

Return the single instance of T

Returns
instance The singleton instance

Member Data Documentation

template<class T>
T * xacc::Singleton< T >::instance_ = nullptr
staticprotected

Reference to the single T instance


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