Geophysical Inversion and Modelling Library  v1.5.2-5-g042d7f36
GIMLI::Singleton< Classname > Class Template Reference

Static Public Member Functions

static Classname * pInstance ()
 
static Classname & instance ()
 

Protected Member Functions

 Singleton ()
 
 Singleton (const Singleton &)
 

Detailed Description

template<typename Classname>
class GIMLI::Singleton< Classname >

Template class for singleton instances

Constructor & Destructor Documentation

◆ Singleton()

template<typename Classname >
GIMLI::Singleton< Classname >::Singleton ( )
inlineprotected

Protected so it can only be called from derived classes

Member Function Documentation

◆ instance()

template<typename Classname >
static Classname& GIMLI::Singleton< Classname >::instance ( )
inlinestatic

This call create one instance of the class and return a reference to it.

◆ pInstance()

template<typename Classname >
static Classname* GIMLI::Singleton< Classname >::pInstance ( )
inlinestatic

This call create one instance of the class and return a pointer to it.