LRUCache.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. //
  2. // LRUCache.h
  3. //
  4. // $Id: //poco/1.4/Foundation/include/Poco/LRUCache.h#1 $
  5. //
  6. // Library: Foundation
  7. // Package: Cache
  8. // Module: LRUCache
  9. //
  10. // Definition of the LRUCache class.
  11. //
  12. // Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
  13. // and Contributors.
  14. //
  15. // SPDX-License-Identifier: BSL-1.0
  16. //
  17. #ifndef Foundation_LRUCache_INCLUDED
  18. #define Foundation_LRUCache_INCLUDED
  19. #include "Poco/AbstractCache.h"
  20. #include "Poco/LRUStrategy.h"
  21. namespace Poco {
  22. template <
  23. class TKey,
  24. class TValue,
  25. class TMutex = FastMutex,
  26. class TEventMutex = FastMutex
  27. >
  28. class LRUCache: public AbstractCache<TKey, TValue, LRUStrategy<TKey, TValue>, TMutex, TEventMutex>
  29. /// An LRUCache implements Least Recently Used caching. The default size for a cache is 1024 entries.
  30. {
  31. public:
  32. LRUCache(long size = 1024):
  33. AbstractCache<TKey, TValue, LRUStrategy<TKey, TValue>, TMutex, TEventMutex>(LRUStrategy<TKey, TValue>(size))
  34. {
  35. }
  36. ~LRUCache()
  37. {
  38. }
  39. private:
  40. LRUCache(const LRUCache& aCache);
  41. LRUCache& operator = (const LRUCache& aCache);
  42. };
  43. } // namespace Poco
  44. #endif // Foundation_LRUCache_INCLUDED