Rosetta
|
SingletonBase is meant to serve as a base class for singleton classes in Rosetta handling the initialization of the singleton in a thread-safe way. More...
#include <SingletonBase.hh>
Public Member Functions | |
SingletonBase () | |
public constructor (the derived class must have a private constructor, of course). More... | |
Static Public Member Functions | |
static T * | get_instance () |
Safely instantiate a singleton class in a (possibly) multithreaded context. More... | |
Private Member Functions | |
SingletonBase (SingletonBase< T > const &)=delete | |
Private, unimplemented copy constructor – uncopyable. More... | |
SingletonBase< T > const & | operator= (SingletonBase< T > const &rhs)=delete |
Private, unimplemented assignment operator – uncopyable. More... | |
SingletonBase is meant to serve as a base class for singleton classes in Rosetta handling the initialization of the singleton in a thread-safe way.
The derived class must a) implement a private default constructor that will completely initialize the singleton and b) declare the SingletonBase class to be a friend, so that it can invoke this function.
|
inline |
public constructor (the derived class must have a private constructor, of course).
|
privatedelete |
Private, unimplemented copy constructor – uncopyable.
|
inlinestatic |
Safely instantiate a singleton class in a (possibly) multithreaded context.
|
privatedelete |
Private, unimplemented assignment operator – uncopyable.