2021-05-11 15:55:21 +00:00
|
|
|
|
2021-05-11 16:21:03 +00:00
|
|
|
#include "singleton.hpp"
|
2021-05-11 15:55:21 +00:00
|
|
|
|
|
|
|
Singleton::~Singleton()
|
|
|
|
{
|
|
|
|
// Delete any allocated data, close any opened files, etc..
|
|
|
|
}
|
|
|
|
|
|
|
|
Singleton &Singleton::getInstance()
|
|
|
|
{
|
|
|
|
// Construct a new singleton if it doesnt exist, return it
|
|
|
|
// + If a static Singleton exists already, just return it
|
|
|
|
static Singleton l;
|
|
|
|
return l;
|
|
|
|
}
|