Files
Webcam/include/platform/memory/singleton.h
2026-06-22 11:49:35 +02:00

29 lines
503 B
C++

/* -----------------------------------------------------------------------------
GSFramework
Copyright 2001-2013 Emmanuel Julien. All Rights Reserved.
----------------------------------------------------------------------------- */
#ifndef __SINGLETON__
#define __SINGLETON__
namespace GS {
template <class T> class Singleton
{
static T *i;
public:
static T &Get() { return *i; }
static void Set(T *s) { i = s; }
static void Free() { delete i; i = nullptr; }
};
}
#endif // __SINGLETON__