mirror of
https://github.com/LNH-team/pico-launcher.git
synced 2026-06-08 12:07:37 +02:00
Initial commit
This commit is contained in:
28
arm9/source/services/process/ProcessManager.h
Normal file
28
arm9/source/services/process/ProcessManager.h
Normal file
@@ -0,0 +1,28 @@
|
||||
#pragma once
|
||||
#include <memory>
|
||||
#include "IProcess.h"
|
||||
#include "ProcessFactory.h"
|
||||
|
||||
class ProcessManager
|
||||
{
|
||||
std::unique_ptr<IProcess> (*_nextProcConstructFunc)();
|
||||
std::unique_ptr<IProcess> _curProcess;
|
||||
|
||||
public:
|
||||
constexpr ProcessManager()
|
||||
: _nextProcConstructFunc(nullptr) { }
|
||||
|
||||
void MainLoop();
|
||||
void SetupDefaultVBlankHandler();
|
||||
|
||||
template <class T>
|
||||
[[gnu::noinline]]
|
||||
void Goto()
|
||||
{
|
||||
_nextProcConstructFunc = ProcessFactory::Construct<T>;
|
||||
if (_curProcess)
|
||||
_curProcess->Exit();
|
||||
}
|
||||
|
||||
IProcess* GetRunningProcess() { return _curProcess.get(); }
|
||||
};
|
||||
Reference in New Issue
Block a user