#include <cxxtools/singleton.h>
Public Types | |
| typedef A | Allocator |
Static Public Member Functions | |
| static T & | instance () |
| Returns the instance of the singleton type. | |
Protected Member Functions | |
| Singleton () | |
| Contructor. | |
| ~Singleton () | |
| Destructor. | |
| T | Type of the singleton | |
| A | Allocator for type T |
The follwing example shows how to use the singleton as a base class:
| static T& instance | ( | ) | [static] |
When called for the first time, the singleton instance will be created with the specified alloctaor. All subsequent calls wikk return a reference to the previously created instance.