3#ifndef DUNE_SINGLETON_HH
4#define DUNE_SINGLETON_HH
73 static std::unique_ptr<T> instance_;
74 if(instance_.get() == 0)
75 instance_ = std::unique_ptr<T>(
new T());
Definition of macros controlling symbol visibility at the ABI level.
#define DUNE_EXPORT
Export a symbol as part of the public ABI.
Definition visibility.hh:18
Dune namespace.
Definition alignment.hh:11
An adapter to turn a class into a singleton.
Definition singleton.hh:56
Singleton()
Definition singleton.hh:59
Singleton(const Singleton &)
Private copy constructor.
Definition singleton.hh:61
static DUNE_EXPORT T & instance()
Get the instance of the singleton.
Definition singleton.hh:70
Singleton & operator=(const Singleton &)
Private assignment operator.
Definition singleton.hh:63