44 lines
723 B
C++
Executable File
44 lines
723 B
C++
Executable File
// TJP COPYRIGHT HEADER
|
|
|
|
/**
|
|
* legal header
|
|
*
|
|
* ============================================================================
|
|
* TJP 10/11/01 Got rid of the constructed singleton, it was essentially
|
|
* a pointer!
|
|
*
|
|
* @author Timothy Prepscius
|
|
* @created 3/../01
|
|
*/
|
|
|
|
#include "Singleton.hpp"
|
|
|
|
namespace timprepscius {
|
|
namespace core {
|
|
|
|
Singletons::Singletons_ &Singletons::singletons()
|
|
{
|
|
static Singletons_ *v = new Singletons_();
|
|
return *v;
|
|
}
|
|
|
|
void Singletons::clearAll ()
|
|
{
|
|
for (auto *singleton : singletons())
|
|
singleton->clear();
|
|
}
|
|
|
|
Singleton_::Singleton_ ()
|
|
{
|
|
Singletons::singletons().insert(this);
|
|
}
|
|
|
|
Singleton_::~Singleton_ ()
|
|
{
|
|
Singletons::singletons().erase(this);
|
|
}
|
|
|
|
} // namespace
|
|
} // namespace
|
|
|