changeset 3453:8c663bbe5363

LeastRecentlyUsedIndex::GetAllKeys
author Alain Mazy <alain@mazy.be>
date Wed, 03 Jul 2019 10:18:05 +0200
parents c08bb6ac3b7f
children 0e3c26e4b8ec
files Core/Cache/LeastRecentlyUsedIndex.h
diffstat 1 files changed, 12 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/Core/Cache/LeastRecentlyUsedIndex.h	Wed Jun 19 12:31:59 2019 +0200
+++ b/Core/Cache/LeastRecentlyUsedIndex.h	Wed Jul 03 10:18:05 2019 +0200
@@ -35,6 +35,7 @@
 
 #include <list>
 #include <map>
+#include <vector>
 #include <boost/noncopyable.hpp>
 #include <cassert>
 
@@ -151,6 +152,17 @@
     const T& GetOldest() const;
     
     const Payload& GetOldestPayload() const;
+
+    void GetAllKeys(std::vector<T>& keys) const
+    {
+      keys.clear();
+      keys.reserve(GetSize());
+      for (typename Index::const_iterator it = index_.begin(); it != index_.end(); it++)
+      {
+        keys.push_back(it->first);
+      }
+    }
+
   };