Twilight Princess
Decompilation of The Legend of Zelda: Twilight Princess
Loading...
Searching...
No Matches
vector.h
Go to the documentation of this file.
1#ifndef VECTOR_H
2#define VECTOR_H
3
4
5extern u8 data_804511E0;
6extern u8 lit_569[];
7
8namespace JGadget {
9
10namespace vector {
11
13
14typedef u32 (*ExtendFunc)(u32, u32, u32);
15
16} // namespace vector
17
18template <typename T>
19struct TAllocator {
20 static TAllocator get() {}
21 inline TAllocator() { _0 = lit_569[0]; }
22 /* 0x0 */ u8 _0;
23 /* 0x4 */ u32 _4;
24 /* 0x8 */ u32 _8;
25 /* 0xc */ u32 _c;
26};
27
28template <typename T, template <class> class Allocator>
29struct TVector {
31 _0 = NULL;
32 pBegin_ = _0;
33 _c = NULL;
35 }
36
37 inline u32 size() const {
38 if (pBegin_ == NULL) {
39 return 0;
40 }
41
42 return ((int)pEnd_ - (int)pBegin_) / 4;
43 }
44
45 void **const begin() const { return pBegin_; }
46 void **const end() const { return pEnd_; }
47 void** begin() { return pBegin_; }
48 void** end() { return pEnd_; }
49 // void erase(void** arg1, void** arg2) {}
50
51 void** _0;
52 void** pBegin_;
53 void** pEnd_;
55 vector::ExtendFunc extend;
56};
57
58struct TVector_pointer_void : TVector<void*, TAllocator> {
60 /* 802DCCFC */ ~TVector_pointer_void();
61 /* 802DCDC4 */ void erase(void**, void**);
62 void insert(void**, void* const&);
63
64 void clear() { erase(begin(), end()); }
65 void push_back(const void*& ref) { insert(end(), (void* const&)ref); }
66};
67
68template <typename T>
72
73 const T* begin() const { return (const T*)TVector_pointer_void::begin(); }
75
76 const T* end() const { return (const T*)TVector_pointer_void::end(); }
77 T* end() { return (T*)TVector_pointer_void::end(); }
78
79 void push_back(const T& ref) {
80 static_cast<TVector_pointer_void*>(this)->push_back((const void*&)ref);
81 }
82};
83
84} // namespace JGadget
85
86#endif /* VECTOR_H */
T cLib_calcTimer(T *value)
Definition c_lib.h:74
static u8 lit_569[1+7]
Definition functionvalue.cpp:312
static const double T[]
Definition k_tan.c:106
u32 extend_default(u32 arg1, u32 arg2, u32 arg3)
Definition std-vector.cpp:14
Definition std-vector.cpp:20
u8 _0
Definition vector.h:22
TAllocator()
Definition vector.h:21
u32 _8
Definition vector.h:24
u32 _c
Definition vector.h:25
u32 _4
Definition vector.h:23
static TAllocator get()
Definition vector.h:20
Definition std-vector.cpp:187
void erase(void **, void **)
void insert(void **, void *const &)
void ** erase(void **, void **)
Definition std-vector.cpp:253
void clear()
Definition vector.h:64
void push_back(const void *&ref)
Definition vector.h:65
TVector_pointer_void(JGadget::TAllocator< void * > const &)
Definition vector.h:69
T * begin()
Definition vector.h:74
const T * begin() const
Definition vector.h:73
T * end()
Definition vector.h:77
~TVector_pointer()
Definition vector.h:71
const T * end() const
Definition vector.h:76
void push_back(const T &ref)
Definition vector.h:79
TVector_pointer(const TAllocator< void * > &allocator)
Definition vector.h:70
Definition std-vector.cpp:43
void ** _0
Definition vector.h:51
void ** end()
Definition vector.h:48
void * * begin()
Definition std-vector.cpp:125
u32 _c
Definition vector.h:54
TVector(Allocator< T > alloc)
Definition vector.h:30
void * * end()
Definition std-vector.cpp:129
void **const begin() const
Definition vector.h:45
void ** pBegin_
Definition vector.h:52
T * pEnd_
Definition std-vector.cpp:176
u32 size() const
Definition vector.h:37
void ** pEnd_
Definition vector.h:53
vector::ExtendFunc extend
Definition vector.h:55
T * pBegin_
Definition std-vector.cpp:175
void **const end() const
Definition vector.h:46
void ** begin()
Definition vector.h:47
Definition std-vector.cpp:15
unsigned long u32
Definition types.h:10
unsigned char u8
Definition types.h:8
u8 lit_569[]
u8 data_804511E0