2023-05-29 23:35:44 -07:00
|
|
|
#pragma once
|
|
|
|
|
2023-06-26 15:46:03 -07:00
|
|
|
#include <glacier/container/vector.h>
|
2023-06-21 15:07:40 -07:00
|
|
|
#include <glacier/memory/ref_ptr.h>
|
|
|
|
|
2023-06-06 20:18:53 -07:00
|
|
|
#include "object/process.h"
|
2023-05-29 23:35:44 -07:00
|
|
|
|
|
|
|
class ProcessManager {
|
|
|
|
public:
|
|
|
|
// Initializes the ProcessManager
|
|
|
|
// and stores it in the global variable.
|
|
|
|
static void Init();
|
|
|
|
|
2023-06-21 15:07:40 -07:00
|
|
|
void InsertProcess(const glcr::RefPtr<Process>& proc);
|
2023-05-29 23:35:44 -07:00
|
|
|
Process& FromId(uint64_t id);
|
|
|
|
|
|
|
|
void DumpProcessStates();
|
|
|
|
|
|
|
|
private:
|
|
|
|
// TODO: This should be a hashmap.
|
2023-06-26 15:46:03 -07:00
|
|
|
glcr::Vector<glcr::RefPtr<Process>> proc_list_;
|
2023-05-29 23:35:44 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
extern ProcessManager* gProcMan;
|