NSMBW-Decomp
A decompilation of New Super Mario Bros. Wii
Loading...
Searching...
No Matches
c_list.hpp
1#pragma once
2#include <types.h>
3
7class cListNd_c {
8public:
10 cListNd_c() : mpPrev(nullptr), mpNext(nullptr) {}
11
12 cListNd_c *getPrev() const { return mpPrev; }
13 cListNd_c *getNext() const { return mpNext; }
14
15protected:
18
19 friend class cListMg_c;
20};
21
25class cListMg_c {
26public:
28 cListMg_c() : mpFirst(nullptr), mpLast(nullptr) {}
29
37 bool insertAfter(cListNd_c *node, cListNd_c *prevNode);
38
45 bool remove(cListNd_c *node);
46
53 bool append(cListNd_c *node);
54
61 bool prepend(cListNd_c *node);
62
63 cListNd_c *getFirst() const { return mpFirst; }
64 cListNd_c *getLast() const { return mpLast; }
65
66protected:
69};
A doubly-linked list container. See cListNd_c.
Definition c_list.hpp:25
cListMg_c()
Constructs a new list container.
Definition c_list.hpp:28
bool append(cListNd_c *node)
Adds a node to the end of the list.
Definition c_list.cpp:60
bool remove(cListNd_c *node)
Removes a node from the list.
Definition c_list.cpp:30
cListNd_c * mpFirst
The first node in the list.
Definition c_list.hpp:67
cListNd_c * mpLast
The last node in the list.
Definition c_list.hpp:68
bool prepend(cListNd_c *node)
Adds a node to the beginning of the list.
Definition c_list.cpp:80
bool insertAfter(cListNd_c *node, cListNd_c *prevNode)
Inserts a node after the given previous node.
Definition c_list.cpp:4
A doubly-linked list node. See cListMg_c.
Definition c_list.hpp:7
cListNd_c * mpNext
The next node.
Definition c_list.hpp:17
cListNd_c()
Constructs a new list node.
Definition c_list.hpp:10
cListNd_c * mpPrev
The previous node.
Definition c_list.hpp:16