| 1 | #pragma once |
| 2 | |
| 3 | #include <mc/seadCoreInfo.h> |
| 4 | #include <thread/seadThread.h> |
| 5 | |
| 6 | #include "Library/HostIO/HioNode.h" |
| 7 | |
| 8 | namespace sead { |
| 9 | class Event; |
| 10 | class DelegateThread; |
| 11 | } // namespace sead |
| 12 | |
| 13 | namespace al { |
| 14 | class ExecuteDirector; |
| 15 | |
| 16 | class ExecuteAsyncExecutor : public HioNode { |
| 17 | public: |
| 18 | ExecuteAsyncExecutor(const ExecuteDirector* director, const char* name, sead::CoreId coreId); |
| 19 | virtual ~ExecuteAsyncExecutor(); |
| 20 | |
| 21 | virtual void execute() = 0; |
| 22 | |
| 23 | void executeAsync(sead::Thread*, s64); |
| 24 | void executeAsync(); |
| 25 | void waitAsync(); |
| 26 | |
| 27 | private: |
| 28 | ExecuteDirector* mDirector = nullptr; |
| 29 | const char* mName = nullptr; |
| 30 | sead::Event* mEvent = nullptr; |
| 31 | sead::DelegateThread* mDelegateThread = nullptr; |
| 32 | }; |
| 33 | |
| 34 | static_assert(sizeof(ExecuteAsyncExecutor) == 0x28); |
| 35 | |
| 36 | class ExecuteAsyncExecutorUpdate : public ExecuteAsyncExecutor { |
| 37 | public: |
| 38 | ExecuteAsyncExecutorUpdate(const ExecuteDirector* director, const char* name, |
| 39 | sead::CoreId coreId) |
| 40 | : ExecuteAsyncExecutor(director, name, coreId) {} |
| 41 | |
| 42 | ~ExecuteAsyncExecutorUpdate() override; |
| 43 | void execute() override; |
| 44 | }; |
| 45 | |
| 46 | static_assert(sizeof(ExecuteAsyncExecutorUpdate) == 0x28); |
| 47 | |
| 48 | class ExecuteAsyncExecutorDraw : public ExecuteAsyncExecutor { |
| 49 | public: |
| 50 | ExecuteAsyncExecutorDraw(const ExecuteDirector* director, const char* name, sead::CoreId coreId) |
| 51 | : ExecuteAsyncExecutor(director, name, coreId) {} |
| 52 | |
| 53 | ~ExecuteAsyncExecutorDraw() override; |
| 54 | void execute() override; |
| 55 | }; |
| 56 | |
| 57 | static_assert(sizeof(ExecuteAsyncExecutorUpdate) == 0x28); |
| 58 | |
| 59 | } // namespace al |
| 60 | |