3 #ifndef DUNE_SINGLETON_HH
4 #define DUNE_SINGLETON_HH
56 static std::auto_ptr<T> instance_;
72 if(instance_.get() == 0)
73 instance_ = std::auto_ptr<T>(
new T());
79 typename std::auto_ptr<T> Singleton<T>::instance_;
Singleton & operator=(const Singleton &)
Private assignment operator.
Definition: singleton.hh:63
An adapter to turn a class into a singleton.
Definition: singleton.hh:53
Singleton()
Definition: singleton.hh:59
static T & instance()
Get the instance of the singleton.
Definition: singleton.hh:70
Singleton(const Singleton &)
Private copy constructor.
Definition: singleton.hh:61