singleton_template.hpp File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

class  SingletonTemplate< classType >
 

Macros

#define STATIC_INSTANCE   1
 
#define STATIC_POINTER_INSTANCE   2
 
#define STATIC_PRIVATE_POINTER_INSTANCE   3
 
#define SINGLETON_INIT_METHOD   STATIC_PRIVATE_POINTER_INSTANCE
 

Macro Definition Documentation

#define SINGLETON_INIT_METHOD   STATIC_PRIVATE_POINTER_INSTANCE
#define STATIC_INSTANCE   1

There are 3 kinds of Singleton Instances to choose from:

  • STATIC_INSTANCE Static instance is created inside the getInstance() which returns this static instance's address
  • STATIC_POINTER_INSTANCE Static pointer is created which is initialized upon declaring it, and getInstance() returns this pointer.
  • STATIC_PRIVATE_POINTER_INSTANCE Private Pointer is initialized to NULL as a member, and then if it is NULL, the class instance is created.
#define STATIC_POINTER_INSTANCE   2
#define STATIC_PRIVATE_POINTER_INSTANCE   3