aboutsummaryrefslogtreecommitdiff
path: root/src/mnemonics/singleton.h
diff options
context:
space:
mode:
authorOran Juice <oranjuices@hotmail.com>2014-10-02 18:15:18 +0530
committerOran Juice <oranjuices@hotmail.com>2014-10-02 21:43:28 +0530
commit4517bac7f3493bd369a05d5a1587765ef72a73da (patch)
tree9472daaa6e238ee2ef22b1894bdb09bfaffef66b /src/mnemonics/singleton.h
parentSeparated word lists to header files (diff)
downloadmonero-4517bac7f3493bd369a05d5a1587765ef72a73da.tar.xz
Restructured language sources to be singletons
Diffstat (limited to 'src/mnemonics/singleton.h')
-rw-r--r--src/mnemonics/singleton.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/mnemonics/singleton.h b/src/mnemonics/singleton.h
new file mode 100644
index 000000000..0cefba923
--- /dev/null
+++ b/src/mnemonics/singleton.h
@@ -0,0 +1,16 @@
+namespace Language
+{
+ template <class T>
+ class Singleton
+ {
+ Singleton() {}
+ Singleton(Singleton &s) {}
+ Singleton& operator=(const Singleton&) {}
+ public:
+ static T* instance()
+ {
+ static T* obj = new T;
+ return obj;
+ }
+ };
+}