mirror of
https://github.com/zeldaret/tp
synced 2026-06-01 09:47:52 -04:00
24 lines
420 B
C++
24 lines
420 B
C++
#ifndef JASGADGET_H
|
|
#define JASGADGET_H
|
|
|
|
#include "dolphin/types.h"
|
|
|
|
template <class T>
|
|
class JASGlobalInstance {
|
|
public:
|
|
T* getInstance() { return sInstance; }
|
|
|
|
JASGlobalInstance(bool param) {
|
|
if (param) {
|
|
ASSERT(sInstance == 0);
|
|
if (this!=NULL) {
|
|
sInstance = this - sizeof(T);
|
|
}
|
|
}
|
|
}
|
|
|
|
static T* sInstance;
|
|
};
|
|
|
|
#endif /* JASGADGET_H */
|