Go to the documentation of this file.
17 #ifndef IGNITION_COMMON_SINGLETONT_HH_
18 #define IGNITION_COMMON_SINGLETONT_HH_
20 #include <gz/common/config.hh>
34 return &GetInstance();
44 private:
static T &GetInstance()
47 return static_cast<T &
>(t);
51 private:
static T &myself;
56 T &SingletonT<T>::myself = SingletonT<T>::GetInstance();
Forward declarations for the common classes.
virtual ~SingletonT()
Destructor.
Definition: gz/common/SingletonT.hh:41
static T * Instance()
Get an instance of the singleton.
Definition: gz/common/SingletonT.hh:32
Singleton template class.
Definition: gz/common/SingletonT.hh:29
SingletonT()
Constructor.
Definition: gz/common/SingletonT.hh:38