Twilight Princess
Decompilation of The Legend of Zelda: Twilight Princess
Loading...
Searching...
No Matches
JASGadget.h
Go to the documentation of this file.
1#ifndef JASGADGET_H
2#define JASGADGET_H
3
5#include "string.h"
6
11template<class T>
13public:
17
19 if (param_1) {
20 JUT_ASSERT(186, sInstance == 0);
21 sInstance = (T*)this;
22 }
23 }
24
26 if (sInstance == (T*)this) {
28 }
29 }
30
31 static T* getInstance() { return sInstance; }
32
33 static T* sInstance;
34};
35
40template<class T>
42public:
45 mSize = size;
46 memset(mTable, 0, size * 4);
47 }
48 T* get(u32 index) {
49 if (index >= mSize) {
50 return NULL;
51 }
52 return mTable[index];
53 }
54 T* get(u32 index) const {
55 if (index >= mSize) {
56 return NULL;
57 }
58 return mTable[index];
59 }
60 void set(u32 index, T* value) {
61 JUT_ASSERT(229, index < mSize);
62 mTable[index] = value;
63 }
64
65private:
66 /* 0x00 */ T** mTable;
67 /* 0x04 */ u32 mSize;
68};
69
74template<class T, size_t N>
75class JASPtrArray : public JASPtrTable<T> {
76public:
78
79private:
80 /* 0x08 */ T* mArray[N];
81};
82
83#endif /* JASGADGET_H */
T cLib_calcTimer(T *value)
Definition c_lib.h:74
Definition JASGadget.h:12
static T * sInstance
Definition JASGadget.h:33
static T * getInstance()
Definition JASGadget.h:31
JASGlobalInstance(bool param_1)
Definition JASGadget.h:18
~JASGlobalInstance()
Definition JASGadget.h:25
JASGlobalInstance(T *inst)
Definition JASGadget.h:14
Definition JASGadget.h:75
T * mArray[N]
Definition JASGadget.h:80
JASPtrArray()
Definition JASGadget.h:77
Definition JASGadget.h:41
u32 mSize
Definition JASGadget.h:67
T * get(u32 index) const
Definition JASGadget.h:54
T ** mTable
Definition JASGadget.h:66
JASPtrTable(T **param_0, u32 size)
Definition JASGadget.h:43
void set(u32 index, T *value)
Definition JASGadget.h:60
T * get(u32 index)
Definition JASGadget.h:48
SECTION_INIT void memset()
static const double T[]
Definition k_tan.c:106
unsigned long u32
Definition types.h:10