aboutsummaryrefslogtreecommitdiff
path: root/src/singleton.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/singleton.h')
-rw-r--r--src/singleton.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/singleton.h b/src/singleton.h
index c69e6f1..47adbd5 100644
--- a/src/singleton.h
+++ b/src/singleton.h
@@ -30,12 +30,25 @@ template <class T>
30class Singleton 30class Singleton
31{ 31{
32protected: 32protected:
33 /**
34 * Private constructor. This constructor is empty but has a body so that
35 * you can make your own override of it. Be sure that you're override is
36 * also protected.
37 */
33 Singleton() {}; 38 Singleton() {};
34 39
35private: 40private:
41 /**
42 * Copy constructor, defined so that you could write your own as well.
43 */
36 Singleton( const Singleton& ); 44 Singleton( const Singleton& );
37 45
38public: 46public:
47 /**
48 * Get a handle to the contained instance of the contained class. It is
49 * a reference.
50 *@returns A reference to the contained object.
51 */
39 static T &getInstance() 52 static T &getInstance()
40 { 53 {
41 static T i; 54 static T i;