Rosetta  2020.37
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Static Public Member Functions | Private Member Functions | List of all members
utility::SingletonBase< T > Class Template Reference

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>

Inheritance diagram for utility::SingletonBase< T >:
Inheritance graph
[legend]

Public Member Functions

 SingletonBase ()
 public constructor (the derived class must have a private constructor, of course). More...
 

Static Public Member Functions

static Tget_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...
 

Detailed Description

template<class T>
class utility::SingletonBase< T >

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.

Constructor & Destructor Documentation

template<class T>
utility::SingletonBase< T >::SingletonBase ( )
inline

public constructor (the derived class must have a private constructor, of course).

template<class T>
utility::SingletonBase< T >::SingletonBase ( SingletonBase< T > const &  )
privatedelete

Private, unimplemented copy constructor – uncopyable.

Member Function Documentation

template<class T>
static T* utility::SingletonBase< T >::get_instance ( )
inlinestatic

Safely instantiate a singleton class in a (possibly) multithreaded context.

Referenced by basic::resource_manager::ResourceManager::create_resource(), and basic::resource_manager::ResourceManager::schema_for_resource_definition_file().

template<class T>
SingletonBase< T > const& utility::SingletonBase< T >::operator= ( SingletonBase< T > const &  rhs)
privatedelete

Private, unimplemented assignment operator – uncopyable.


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