Files
tp/include/JSystem/JAudio2/JASGadget.h
T

31 lines
515 B
C++
Raw Normal View History

2021-08-28 07:25:03 -07:00
#ifndef JASGADGET_H
#define JASGADGET_H
#include "dolphin/types.h"
template<class T>
2021-08-28 07:25:03 -07:00
class JASGlobalInstance {
public:
JASGlobalInstance(T* inst) {
sInstance = inst;
}
2021-08-28 07:25:03 -07:00
2023-06-09 11:55:15 +03:00
JASGlobalInstance(bool param_1) {
2023-07-12 10:59:33 +03:00
if (param_1) {
sInstance = (T*)this;
}
2023-06-09 11:55:15 +03:00
}
~JASGlobalInstance() {
2023-06-09 11:55:15 +03:00
if (sInstance == (T*)this) {
sInstance = NULL;
2022-12-30 16:19:57 -07:00
}
}
static T* getInstance() { return sInstance; }
2022-12-30 16:19:57 -07:00
static T* sInstance;
2021-08-28 07:25:03 -07:00
};
#endif /* JASGADGET_H */