dune-common
2.2.0
|
An adapter to turn a class into a singleton. More...
#include <dune/common/singleton.hh>
Static Public Member Functions | |
static T & | instance () |
Get the instance of the singleton. |
Protected Member Functions | |
Singleton () | |
Singleton (const Singleton &) | |
Private copy constructor. | |
Singleton & | operator= (const Singleton &) |
Private assignment operator. |
An adapter to turn a class into a singleton.
The class represented by the template parameter T must have a parameterless constructor.
Class T can be publicly derived from Singleton<T>:
Or one can construct a Singleton of an existing class. Say Foo1 is a class with parameterless constructor then
Creates a singleton of that class and accesses its instance.
|
inlineprotected |
|
inlineprotected |
Private copy constructor.
|
inlinestatic |
Get the instance of the singleton.
|
inlineprotected |
Private assignment operator.