|
Radium Engine
1.5.20
|
Loading...
Searching...
No Matches
3#include <Core/RaCore.hpp>
21#define RA_SINGLETON_INTERFACE( TYPE ) \
23 TYPE( const TYPE& ) = delete; \
24 void operator=( const TYPE& ) = delete; \
26 void operator()( TYPE* p ) const { \
30 static std::unique_ptr<TYPE, Deleter> s_instance; \
33 template <typename... Args> \
34 inline static TYPE* createInstance( const Args&... args ) { \
35 s_instance = std::unique_ptr<TYPE, Deleter>( new TYPE( args... ), Deleter() ); \
36 return getInstance(); \
38 inline static TYPE* getInstance() { \
39 return s_instance.get(); \
41 inline static void destroyInstance() { \
42 s_instance.reset( nullptr ); \
48#define RA_SINGLETON_IMPLEMENTATION( TYPE ) \
49 std::unique_ptr<TYPE, TYPE::Deleter> TYPE::s_instance = nullptr; \