Turned Scheduler into more generic heap

This commit is contained in:
2021-04-06 14:44:45 -05:00
parent 51b6c13b16
commit 603a1a9dcc
4 changed files with 116 additions and 105 deletions

38
src/heap.hpp Normal file
View File

@@ -0,0 +1,38 @@
#ifndef SCHEDULER_H
#define SCHEDULER_H
#include <stddef.h>
#include "process.hpp"
namespace kernelns
{
template<class T>
class Heap
{
public:
Heap();
Heap(T** array, size_t maxSize);
T* extractMin();
void insert(T* n);
void remove(T* n);
private:
void heapify(size_t index);
T** m_array;
size_t m_size, m_limit;
};
};
#endif