mirror of
https://github.com/zeldaret/tp
synced 2026-06-09 20:50:45 -04:00
ac6b191dc1
* new system for handling vtables * commented out non-matching JKRDisposer::~JKDisposer() * removed artificial vtables and matched simple virtual-call functions * better text on nonmatching functions * reverted asmdiff.sh * attempt 2 * Spelling * banner and .gitignore for vtable artifacts * move virtual function to the correct class * remove unnecessary casts
59 lines
1.0 KiB
C++
59 lines
1.0 KiB
C++
#ifndef __JSULIST_H__
|
|
#define __JSULIST_H__
|
|
|
|
#include "dolphin/types.h"
|
|
|
|
class JSUPtrList;
|
|
class JSUPtrLink {
|
|
public:
|
|
JSUPtrLink(void* owner);
|
|
~JSUPtrLink();
|
|
|
|
public:
|
|
void* owner;
|
|
JSUPtrList* list;
|
|
JSUPtrLink* prev;
|
|
JSUPtrLink* next;
|
|
};
|
|
|
|
class JSUPtrList {
|
|
public:
|
|
JSUPtrList(bool should_initiate);
|
|
~JSUPtrList();
|
|
|
|
void initiate();
|
|
void setFirst(JSUPtrLink* first);
|
|
bool append(JSUPtrLink* ptr);
|
|
bool prepend(JSUPtrLink* ptr);
|
|
bool insert(JSUPtrLink* before, JSUPtrLink* ptr);
|
|
bool remove(JSUPtrLink* ptr);
|
|
JSUPtrLink* getNthLink(u32 i) const;
|
|
|
|
public:
|
|
JSUPtrLink* head;
|
|
JSUPtrLink* tail;
|
|
u32 length;
|
|
};
|
|
|
|
template <typename T>
|
|
class JSUList : JSUPtrList {
|
|
public:
|
|
JSUList() : JSUPtrList(true) {
|
|
}
|
|
~JSUList(){};
|
|
|
|
void append(T* value) {
|
|
list.append(&value->ptr_link);
|
|
}
|
|
|
|
void prepend(T* value) {
|
|
list.prepend(&value->ptr_link);
|
|
}
|
|
|
|
void remove(T* value) {
|
|
list.remove(&value->ptr_link);
|
|
}
|
|
};
|
|
|
|
#endif
|