1
#pragma once
2

            
3
// Copyright 2016 Google Inc.
4
// Copyright Envoy Project Authors
5
// SPDX-License-Identifier: Apache-2.0
6

            
7
#pragma once
8

            
9
#include <functional>
10

            
11
#include "absl/container/flat_hash_map.h" // for hash<>
12

            
13
namespace Envoy {
14
namespace SimpleLruCache {
15

            
16
namespace internal {
17
template <typename T> struct SimpleLRUHash : public std::hash<T> {};
18
} // namespace internal
19

            
20
template <typename Key, typename Value, typename H = internal::SimpleLRUHash<Key>,
21
          typename EQ = std::equal_to<Key>>
22
class SimpleLRUCache;
23

            
24
// Deleter is a functor that defines how to delete a Value*. That is, it
25
// contains a public method:
26
//  operator() (Value* value)
27
// See example in the associated unittest.
28
template <typename Key, typename Value, typename Deleter, typename H = internal::SimpleLRUHash<Key>,
29
          typename EQ = std::equal_to<Key>>
30
class SimpleLRUCacheWithDeleter;
31

            
32
} // namespace SimpleLruCache
33
} // namespace Envoy