|
dune-common
2.3.1
|
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. More... | |
Protected Member Functions | |
| Singleton () | |
| Singleton (const Singleton &) | |
| Private copy constructor. More... | |
| Singleton & | operator= (const Singleton &) |
| Private assignment operator. More... | |
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.
1.8.7