From da3d7a913c0b10b4aa776b97def10a3727e07bd5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Nusser?= Date: Sun, 11 Apr 2021 20:23:04 +0200 Subject: Add clear member function to EventsDS. --- src/memory_heap.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/memory_heap.h') diff --git a/src/memory_heap.h b/src/memory_heap.h index 3f0105a..658598c 100644 --- a/src/memory_heap.h +++ b/src/memory_heap.h @@ -61,6 +61,7 @@ public: T& get(Index index); const T& get(Index index) const; void remove(Index index); + void clear(); private: std::vector memory; @@ -119,3 +120,10 @@ void MemoryHeap::remove(Index index) { free_indices.push_back(index); } + +template +void MemoryHeap::clear() +{ + memory.clear(); + free_indices.clear(); +} -- cgit v1.2.3