diff options
author | Patrick Williams <iawillia@us.ibm.com> | 2010-05-18 15:55:03 -0500 |
---|---|---|
committer | Patrick Williams <iawillia@us.ibm.com> | 2010-05-18 15:55:03 -0500 |
commit | cf138201c24fdc83ee7835b65cce67e7d7a85e70 (patch) | |
tree | 16650f82ac519ff60bc9100b4e90868463bd987d /src/include/util/singleton.H | |
parent | 9ea98f274e18a3407ce109a331553e1c910274d9 (diff) | |
download | talos-hostboot-cf138201c24fdc83ee7835b65cce67e7d7a85e70.tar.gz talos-hostboot-cf138201c24fdc83ee7835b65cce67e7d7a85e70.zip |
Create simple console.
Diffstat (limited to 'src/include/util/singleton.H')
-rw-r--r-- | src/include/util/singleton.H | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/include/util/singleton.H b/src/include/util/singleton.H new file mode 100644 index 000000000..f448303df --- /dev/null +++ b/src/include/util/singleton.H @@ -0,0 +1,18 @@ +#ifndef __UTIL_SINGLETON_H +#define __UTIL_SINGLETON_H + +template <typename _T> +class Singleton : private _T +{ + public: + static _T& instance() + { + static Singleton<_T> instance; + return instance; + }; + + private: + Singleton() : _T() {}; +}; + +#endif |