diff options
Diffstat (limited to 'src/singleton.h')
| -rw-r--r-- | src/singleton.h | 13 |
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> | |||
| 30 | class Singleton | 30 | class Singleton |
| 31 | { | 31 | { |
| 32 | protected: | 32 | protected: |
| 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 | ||
| 35 | private: | 40 | private: |
| 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 | ||
| 38 | public: | 46 | public: |
| 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; |
