A reimplementation of Mario Kart Wii's physics engine in C++
Loading...
Searching...
No Matches
List.hh
1#pragma once
2
3#include "abstract/memory/Memory.hh"
4
5namespace Abstract::Memory {
6
8struct MEMLink {
9 void *m_prevObject;
10 void *m_nextObject;
11};
12
14struct MEMList {
15 MEMList();
16 MEMList(u16 offset);
17
18 bool operator==(const MEMList &rhs) const = default;
19
20 void append(void *object);
21 void remove(void *object);
22 [[nodiscard]] void *getFirst();
23 [[nodiscard]] void *getNext(void *object);
24
25 void *m_headObject;
26 void *m_tailObject;
27 u16 m_numObjects;
28 u16 m_offset;
29
30private:
31 void setFirstObject(void *object);
32 [[nodiscard]] MEMLink *getLink(void *object);
33};
34
35} // namespace Abstract::Memory
Intrusive doubly-linked list. Links are placed within the corresponding object.
Definition List.hh:14