summaryrefslogtreecommitdiffstats
path: root/src/include/util
diff options
context:
space:
mode:
authorPatrick Williams <iawillia@us.ibm.com>2010-05-18 15:55:03 -0500
committerPatrick Williams <iawillia@us.ibm.com>2010-05-18 15:55:03 -0500
commitcf138201c24fdc83ee7835b65cce67e7d7a85e70 (patch)
tree16650f82ac519ff60bc9100b4e90868463bd987d /src/include/util
parent9ea98f274e18a3407ce109a331553e1c910274d9 (diff)
downloadtalos-hostboot-cf138201c24fdc83ee7835b65cce67e7d7a85e70.tar.gz
talos-hostboot-cf138201c24fdc83ee7835b65cce67e7d7a85e70.zip
Create simple console.
Diffstat (limited to 'src/include/util')
-rw-r--r--src/include/util/singleton.H18
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
OpenPOWER on IntegriCloud