Lugdunum  0.1.0
GrowingHeap.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include <lug/System/Export.hpp>
5 
6 namespace lug {
7 namespace System {
8 namespace Memory {
9 namespace Area {
10 
11 template <size_t PageSize = 4096, size_t MaxPageCount = 1>
12 class GrowingHeap : public IArea {
13 public:
14  GrowingHeap();
15  GrowingHeap(const GrowingHeap&) = delete;
16  GrowingHeap(GrowingHeap&&) = delete;
17 
18  GrowingHeap& operator=(const GrowingHeap&) = delete;
19  GrowingHeap& operator=(GrowingHeap&&) = delete;
20 
21  ~GrowingHeap();
22 
23  Page* requestNextPage() override;
24 
25 private:
26  void* _data[MaxPageCount];
27 
28  size_t _current{0};
29  Page _pages[MaxPageCount];
30 };
31 
33 
34 } // Area
35 } // Memory
36 } // System
37 } // lug
GrowingHeap & operator=(const GrowingHeap &)=delete