All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
MortonKeyLRUCache.h
1 // Copyright eeGeo Ltd (2012-2014), All Rights Reserved
2 
3 #pragma once
4 
5 #include "Types.h"
6 #include "MortonKey.h"
7 
8 #include <list>
9 #include <vector>
10 #include <map>
11 
12 namespace Eegeo
13 {
14  namespace BuildingFootprints
15  {
17  {
18  public:
19  void Put(const Streaming::MortonKey& key);
20  void Shrink(int newSize);
21  int Size() const;
22  std::vector<Streaming::MortonKey> OrderedKeys() const;
23  private:
24  typedef std::list<Streaming::MortonKey> KeyList;
25  typedef std::map<Streaming::MortonKey, KeyList::iterator> KeysToListNodes;
26  KeyList m_keysMostRecentlyUsedFirst;
27  KeysToListNodes m_keysToListNodes;
28  };
29  }
30 }