NSMBW-Decomp
A decompilation of New Super Mario Bros. Wii
Loading...
Searching...
No Matches
snd_TaskManager.h
1#ifndef NW4R_SND_TASK_MANAGER_H
2#define NW4R_SND_TASK_MANAGER_H
3
4/*******************************************************************************
5 * headers
6 */
7
8#include "nw4r/snd/snd_Task.h"
9
10#include <revolution/OS/OSThread.h> // OSThreadQueue
11
12/*******************************************************************************
13 * classes and functions
14 */
15
16namespace nw4r { namespace snd { namespace detail
17{
18 // [R89JEL]:/bin/RVL/Debug/mainD.elf:.debug::0x2fd1de
19 class TaskManager
20 {
21 // enums
22 public:
23 // [R89JEL]:/bin/RVL/Debug/mainD.elf:.debug::0x2fd480
24 enum TaskPriority
25 {
26 PRIORITY_LOW,
27 PRIORITY_MIDDLE,
28 PRIORITY_HIGH,
29 };
30
31 // methods
32 public:
33 // instance accessors
34 static TaskManager &GetInstance();
35
36 // methods
37 void AppendTask(Task *task, TaskPriority priority);
38
39 Task *ExecuteTask();
40 void CancelTask(Task *task);
41 void CancelAllTask();
42
43 void WaitTask();
44 void CancelWaitTask();
45
46 private:
47 // cdtors
48 TaskManager();
49
50 // methods
51 Task *GetNextTask();
52 Task *GetNextTask(TaskPriority priority, bool doRemove);
53
54 Task *PopTask();
55
56 // static members
57 public:
58 static int const PRIORITY_NUM = 3;
59
60 // members
61 private:
62 Task::LinkList mTaskList[PRIORITY_NUM]; // size 0x24, offset 0x00
63 Task * volatile mCurrentTask; // size 0x04, offset 0x24
64 bool mCancelWaitTaskFlag; // size 0x01, offset 0x28 // TODO: volatile? (see WaitTask)
65 /* 3 bytes padding */
66 OSThreadQueue mAppendThreadQueue; // size 0x08, offset 0x2c
67 OSThreadQueue mDoneThreadQueue; // size 0x08, offset 0x34
68 }; // size 0x3c
69}}} // namespace nw4r::snd::detail
70
71#endif // NW4R_SND_TASK_MANAGER_H