summaryrefslogtreecommitdiff
path: root/src/memory_heap.h
diff options
context:
space:
mode:
authorAndré Nusser <anusser@mpi-inf.mpg.de>2021-04-11 20:23:04 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2021-07-04 11:45:53 +0200
commitda3d7a913c0b10b4aa776b97def10a3727e07bd5 (patch)
treebd4dac758c6f15d0ee41c35d811ffeea18545df1 /src/memory_heap.h
parentfe1986214251bcd110837b81ed2159d75c58f8e2 (diff)
Add clear member function to EventsDS.
Diffstat (limited to 'src/memory_heap.h')
-rw-r--r--src/memory_heap.h8
1 files changed, 8 insertions, 0 deletions
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<T> memory;
@@ -119,3 +120,10 @@ void MemoryHeap<T>::remove(Index index)
{
free_indices.push_back(index);
}
+
+template <typename T>
+void MemoryHeap<T>::clear()
+{
+ memory.clear();
+ free_indices.clear();
+}