retdec
|
Implementation of the Singleton design pattern. More...
#include <singleton.h>
Public Member Functions | |
Singleton ()=delete | |
Singleton (const Singleton &)=delete | |
~Singleton ()=delete | |
Singleton & | operator= (const Singleton &)=delete |
Static Public Member Functions | |
static T & | getInstance () |
Returns the instance of the object being held. More... | |
Implementation of the Singleton design pattern.
This template is especially suited to be used to make object factories singletons. For example, the following code snippet shows how to define a singleton factory:
T | Class with only a single instance. It needs to have a public constructor. |
|
delete |
|
delete |
|
delete |
|
inlinestatic |
Returns the instance of the object being held.
This function always returns a reference to the same object. The object is created upon the first call of this function.
|
delete |