/src/PROJ/include/proj/internal/lru_cache.hpp
Line | Count | Source (jump to first uncovered line) |
1 | | /* |
2 | | * LRUCache11 - a templated C++11 based LRU cache class that allows |
3 | | * specification of |
4 | | * key, value and optionally the map container type (defaults to |
5 | | * std::unordered_map) |
6 | | * By using the std::map and a linked list of keys it allows O(1) insert, delete |
7 | | * and |
8 | | * refresh operations. |
9 | | * |
10 | | * This is a header-only library and all you need is the LRUCache11.hpp file |
11 | | * |
12 | | * Github: https://github.com/mohaps/lrucache11 |
13 | | * |
14 | | * This is a follow-up to the LRUCache project - |
15 | | * https://github.com/mohaps/lrucache |
16 | | * |
17 | | * Copyright (c) 2012-22 SAURAV MOHAPATRA <mohaps@gmail.com> |
18 | | * |
19 | | * Permission to use, copy, modify, and distribute this software for any |
20 | | * purpose with or without fee is hereby granted, provided that the above |
21 | | * copyright notice and this permission notice appear in all copies. |
22 | | * |
23 | | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES |
24 | | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF |
25 | | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR |
26 | | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES |
27 | | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN |
28 | | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
29 | | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
30 | | */ |
31 | | |
32 | | /*! @cond Doxygen_Suppress */ |
33 | | |
34 | | #pragma once |
35 | | #include <algorithm> |
36 | | #include <cstdint> |
37 | | #include <list> |
38 | | #include <mutex> |
39 | | #include <stdexcept> |
40 | | #include <thread> |
41 | | #include <unordered_map> |
42 | | |
43 | | NS_PROJ_START |
44 | | namespace lru11 { |
45 | | /* |
46 | | * a noop lockable concept that can be used in place of std::mutex |
47 | | */ |
48 | | class NullLock { |
49 | | public: |
50 | | // cppcheck-suppress functionStatic |
51 | 2.06M | void lock() {} |
52 | | // cppcheck-suppress functionStatic |
53 | 2.06M | void unlock() {} |
54 | | // cppcheck-suppress functionStatic |
55 | 0 | bool try_lock() { return true; } |
56 | | }; |
57 | | |
58 | | /** |
59 | | * error raised when a key not in cache is passed to get() |
60 | | */ |
61 | | class KeyNotFound : public std::invalid_argument { |
62 | | public: |
63 | 0 | KeyNotFound() : std::invalid_argument("key_not_found") {} |
64 | | ~KeyNotFound() override; |
65 | | }; |
66 | | |
67 | | #ifndef LRU11_DO_NOT_DEFINE_OUT_OF_CLASS_METHODS |
68 | 0 | KeyNotFound::~KeyNotFound() = default; |
69 | | #endif |
70 | | |
71 | | template <typename K, typename V> struct KeyValuePair { |
72 | | public: |
73 | | K key; |
74 | | V value; |
75 | | |
76 | 186k | KeyValuePair(const K &keyIn, const V &v) : key(keyIn), value(v) {} Unexecuted instantiation: osgeo::proj::lru11::KeyValuePair<osgeo::proj::NetworkChunkCache::Key, std::__1::shared_ptr<std::__1::vector<unsigned char, std::__1::allocator<unsigned char> > > >::KeyValuePair(osgeo::proj::NetworkChunkCache::Key const&, std::__1::shared_ptr<std::__1::vector<unsigned char, std::__1::allocator<unsigned char> > > const&) Unexecuted instantiation: osgeo::proj::lru11::KeyValuePair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, osgeo::proj::FileProperties>::KeyValuePair(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, osgeo::proj::FileProperties const&) osgeo::proj::lru11::KeyValuePair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::shared_ptr<osgeo::proj::io::SQLiteHandle> >::KeyValuePair(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::shared_ptr<osgeo::proj::io::SQLiteHandle> const&) Line | Count | Source | 76 | 9.89k | KeyValuePair(const K &keyIn, const V &v) : key(keyIn), value(v) {} |
osgeo::proj::lru11::KeyValuePair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::shared_ptr<osgeo::proj::util::BaseObject> >::KeyValuePair(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::shared_ptr<osgeo::proj::util::BaseObject> const&) Line | Count | Source | 76 | 112k | KeyValuePair(const K &keyIn, const V &v) : key(keyIn), value(v) {} |
osgeo::proj::lru11::KeyValuePair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::vector<dropbox::oxygen::nn<std::__1::shared_ptr<osgeo::proj::operation::CoordinateOperation> >, std::__1::allocator<dropbox::oxygen::nn<std::__1::shared_ptr<osgeo::proj::operation::CoordinateOperation> > > > >::KeyValuePair(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::vector<dropbox::oxygen::nn<std::__1::shared_ptr<osgeo::proj::operation::CoordinateOperation> >, std::__1::allocator<dropbox::oxygen::nn<std::__1::shared_ptr<osgeo::proj::operation::CoordinateOperation> > > > const&) Line | Count | Source | 76 | 29.0k | KeyValuePair(const K &keyIn, const V &v) : key(keyIn), value(v) {} |
osgeo::proj::lru11::KeyValuePair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, osgeo::proj::io::DatabaseContext::Private::GridInfoCache>::KeyValuePair(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, osgeo::proj::io::DatabaseContext::Private::GridInfoCache const&) Line | Count | Source | 76 | 30.6k | KeyValuePair(const K &keyIn, const V &v) : key(keyIn), value(v) {} |
osgeo::proj::lru11::KeyValuePair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::list<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > >::KeyValuePair(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::list<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&) Line | Count | Source | 76 | 2.39k | KeyValuePair(const K &keyIn, const V &v) : key(keyIn), value(v) {} |
osgeo::proj::lru11::KeyValuePair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::KeyValuePair(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) Line | Count | Source | 76 | 2.18k | KeyValuePair(const K &keyIn, const V &v) : key(keyIn), value(v) {} |
Unexecuted instantiation: osgeo::proj::lru11::KeyValuePair<unsigned long, std::__1::vector<float, std::__1::allocator<float> > >::KeyValuePair(unsigned long const&, std::__1::vector<float, std::__1::allocator<float> > const&) Unexecuted instantiation: osgeo::proj::lru11::KeyValuePair<unsigned long, std::__1::vector<unsigned char, std::__1::allocator<unsigned char> > >::KeyValuePair(unsigned long const&, std::__1::vector<unsigned char, std::__1::allocator<unsigned char> > const&) |
77 | | }; |
78 | | |
79 | | /** |
80 | | * The LRU Cache class templated by |
81 | | * Key - key type |
82 | | * Value - value type |
83 | | * MapType - an associative container like std::unordered_map |
84 | | * LockType - a lock type derived from the Lock class (default: |
85 | | *NullLock = no synchronization) |
86 | | * |
87 | | * The default NullLock based template is not thread-safe, however passing |
88 | | *Lock=std::mutex will make it |
89 | | * thread-safe |
90 | | */ |
91 | | template <class Key, class Value, class Lock = NullLock, |
92 | | class Map = std::unordered_map< |
93 | | Key, typename std::list<KeyValuePair<Key, Value>>::iterator>> |
94 | | class Cache { |
95 | | public: |
96 | | typedef KeyValuePair<Key, Value> node_type; |
97 | | typedef std::list<KeyValuePair<Key, Value>> list_type; |
98 | | typedef Map map_type; |
99 | | typedef Lock lock_type; |
100 | | using Guard = std::lock_guard<lock_type>; |
101 | | /** |
102 | | * the max size is the hard limit of keys and (maxSize + elasticity) is the |
103 | | * soft limit |
104 | | * the cache is allowed to grow till maxSize + elasticity and is pruned back |
105 | | * to maxSize keys |
106 | | * set maxSize = 0 for an unbounded cache (but in that case, you're better |
107 | | * off using a std::unordered_map directly anyway! :) |
108 | | */ |
109 | | explicit Cache(size_t maxSize = 64, size_t elasticity = 10) |
110 | 118k | : maxSize_(maxSize), elasticity_(elasticity) {} osgeo::proj::lru11::Cache<osgeo::proj::NetworkChunkCache::Key, std::__1::shared_ptr<std::__1::vector<unsigned char, std::__1::allocator<unsigned char> > >, std::__1::mutex, std::__1::unordered_map<osgeo::proj::NetworkChunkCache::Key, std::__1::__list_iterator<osgeo::proj::lru11::KeyValuePair<osgeo::proj::NetworkChunkCache::Key, std::__1::shared_ptr<std::__1::vector<unsigned char, std::__1::allocator<unsigned char> > > >, void*>, osgeo::proj::NetworkChunkCache::KeyHasher, std::__1::equal_to<osgeo::proj::NetworkChunkCache::Key>, std::__1::allocator<std::__1::pair<osgeo::proj::NetworkChunkCache::Key const, std::__1::__list_iterator<osgeo::proj::lru11::KeyValuePair<osgeo::proj::NetworkChunkCache::Key, std::__1::shared_ptr<std::__1::vector<unsigned char, std::__1::allocator<unsigned char> > > >, void*> > > > >::Cache(unsigned long, unsigned long) Line | Count | Source | 110 | 2 | : maxSize_(maxSize), elasticity_(elasticity) {} |
osgeo::proj::lru11::Cache<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, osgeo::proj::FileProperties, std::__1::mutex, std::__1::unordered_map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::__list_iterator<osgeo::proj::lru11::KeyValuePair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, osgeo::proj::FileProperties>, void*>, std::__1::hash<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::equal_to<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, std::__1::__list_iterator<osgeo::proj::lru11::KeyValuePair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, osgeo::proj::FileProperties>, void*> > > > >::Cache(unsigned long, unsigned long) Line | Count | Source | 110 | 2 | : maxSize_(maxSize), elasticity_(elasticity) {} |
osgeo::proj::lru11::Cache<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::shared_ptr<osgeo::proj::io::SQLiteHandle>, osgeo::proj::lru11::NullLock, std::__1::unordered_map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::__list_iterator<osgeo::proj::lru11::KeyValuePair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::shared_ptr<osgeo::proj::io::SQLiteHandle> >, void*>, std::__1::hash<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::equal_to<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, std::__1::__list_iterator<osgeo::proj::lru11::KeyValuePair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::shared_ptr<osgeo::proj::io::SQLiteHandle> >, void*> > > > >::Cache(unsigned long, unsigned long) Line | Count | Source | 110 | 1 | : maxSize_(maxSize), elasticity_(elasticity) {} |
osgeo::proj::lru11::Cache<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::shared_ptr<osgeo::proj::util::BaseObject>, osgeo::proj::lru11::NullLock, std::__1::unordered_map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::__list_iterator<osgeo::proj::lru11::KeyValuePair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::shared_ptr<osgeo::proj::util::BaseObject> >, void*>, std::__1::hash<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::equal_to<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, std::__1::__list_iterator<osgeo::proj::lru11::KeyValuePair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::shared_ptr<osgeo::proj::util::BaseObject> >, void*> > > > >::Cache(unsigned long, unsigned long) Line | Count | Source | 110 | 79.1k | : maxSize_(maxSize), elasticity_(elasticity) {} |
osgeo::proj::lru11::Cache<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::vector<dropbox::oxygen::nn<std::__1::shared_ptr<osgeo::proj::operation::CoordinateOperation> >, std::__1::allocator<dropbox::oxygen::nn<std::__1::shared_ptr<osgeo::proj::operation::CoordinateOperation> > > >, osgeo::proj::lru11::NullLock, std::__1::unordered_map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::__list_iterator<osgeo::proj::lru11::KeyValuePair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::vector<dropbox::oxygen::nn<std::__1::shared_ptr<osgeo::proj::operation::CoordinateOperation> >, std::__1::allocator<dropbox::oxygen::nn<std::__1::shared_ptr<osgeo::proj::operation::CoordinateOperation> > > > >, void*>, std::__1::hash<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::equal_to<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, std::__1::__list_iterator<osgeo::proj::lru11::KeyValuePair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::vector<dropbox::oxygen::nn<std::__1::shared_ptr<osgeo::proj::operation::CoordinateOperation> >, std::__1::allocator<dropbox::oxygen::nn<std::__1::shared_ptr<osgeo::proj::operation::CoordinateOperation> > > > >, void*> > > > >::Cache(unsigned long, unsigned long) Line | Count | Source | 110 | 9.89k | : maxSize_(maxSize), elasticity_(elasticity) {} |
osgeo::proj::lru11::Cache<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, osgeo::proj::io::DatabaseContext::Private::GridInfoCache, osgeo::proj::lru11::NullLock, std::__1::unordered_map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::__list_iterator<osgeo::proj::lru11::KeyValuePair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, osgeo::proj::io::DatabaseContext::Private::GridInfoCache>, void*>, std::__1::hash<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::equal_to<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, std::__1::__list_iterator<osgeo::proj::lru11::KeyValuePair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, osgeo::proj::io::DatabaseContext::Private::GridInfoCache>, void*> > > > >::Cache(unsigned long, unsigned long) Line | Count | Source | 110 | 9.89k | : maxSize_(maxSize), elasticity_(elasticity) {} |
osgeo::proj::lru11::Cache<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::list<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >, osgeo::proj::lru11::NullLock, std::__1::unordered_map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::__list_iterator<osgeo::proj::lru11::KeyValuePair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::list<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > >, void*>, std::__1::hash<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::equal_to<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, std::__1::__list_iterator<osgeo::proj::lru11::KeyValuePair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::list<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > >, void*> > > > >::Cache(unsigned long, unsigned long) Line | Count | Source | 110 | 9.89k | : maxSize_(maxSize), elasticity_(elasticity) {} |
osgeo::proj::lru11::Cache<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, osgeo::proj::lru11::NullLock, std::__1::unordered_map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::__list_iterator<osgeo::proj::lru11::KeyValuePair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, void*>, std::__1::hash<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::equal_to<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, std::__1::__list_iterator<osgeo::proj::lru11::KeyValuePair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, void*> > > > >::Cache(unsigned long, unsigned long) Line | Count | Source | 110 | 9.89k | : maxSize_(maxSize), elasticity_(elasticity) {} |
Unexecuted instantiation: osgeo::proj::lru11::Cache<unsigned long, std::__1::vector<unsigned char, std::__1::allocator<unsigned char> >, osgeo::proj::lru11::NullLock, std::__1::unordered_map<unsigned long, std::__1::__list_iterator<osgeo::proj::lru11::KeyValuePair<unsigned long, std::__1::vector<unsigned char, std::__1::allocator<unsigned char> > >, void*>, std::__1::hash<unsigned long>, std::__1::equal_to<unsigned long>, std::__1::allocator<std::__1::pair<unsigned long const, std::__1::__list_iterator<osgeo::proj::lru11::KeyValuePair<unsigned long, std::__1::vector<unsigned char, std::__1::allocator<unsigned char> > >, void*> > > > >::Cache(unsigned long, unsigned long) Unexecuted instantiation: osgeo::proj::lru11::Cache<unsigned long, std::__1::vector<float, std::__1::allocator<float> >, osgeo::proj::lru11::NullLock, std::__1::unordered_map<unsigned long, std::__1::__list_iterator<osgeo::proj::lru11::KeyValuePair<unsigned long, std::__1::vector<float, std::__1::allocator<float> > >, void*>, std::__1::hash<unsigned long>, std::__1::equal_to<unsigned long>, std::__1::allocator<std::__1::pair<unsigned long const, std::__1::__list_iterator<osgeo::proj::lru11::KeyValuePair<unsigned long, std::__1::vector<float, std::__1::allocator<float> > >, void*> > > > >::Cache(unsigned long, unsigned long) |
111 | 118k | virtual ~Cache() = default; Unexecuted instantiation: osgeo::proj::lru11::Cache<osgeo::proj::NetworkChunkCache::Key, std::__1::shared_ptr<std::__1::vector<unsigned char, std::__1::allocator<unsigned char> > >, std::__1::mutex, std::__1::unordered_map<osgeo::proj::NetworkChunkCache::Key, std::__1::__list_iterator<osgeo::proj::lru11::KeyValuePair<osgeo::proj::NetworkChunkCache::Key, std::__1::shared_ptr<std::__1::vector<unsigned char, std::__1::allocator<unsigned char> > > >, void*>, osgeo::proj::NetworkChunkCache::KeyHasher, std::__1::equal_to<osgeo::proj::NetworkChunkCache::Key>, std::__1::allocator<std::__1::pair<osgeo::proj::NetworkChunkCache::Key const, std::__1::__list_iterator<osgeo::proj::lru11::KeyValuePair<osgeo::proj::NetworkChunkCache::Key, std::__1::shared_ptr<std::__1::vector<unsigned char, std::__1::allocator<unsigned char> > > >, void*> > > > >::~Cache() Unexecuted instantiation: osgeo::proj::lru11::Cache<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, osgeo::proj::FileProperties, std::__1::mutex, std::__1::unordered_map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::__list_iterator<osgeo::proj::lru11::KeyValuePair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, osgeo::proj::FileProperties>, void*>, std::__1::hash<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::equal_to<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, std::__1::__list_iterator<osgeo::proj::lru11::KeyValuePair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, osgeo::proj::FileProperties>, void*> > > > >::~Cache() osgeo::proj::lru11::Cache<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::shared_ptr<osgeo::proj::io::SQLiteHandle>, osgeo::proj::lru11::NullLock, std::__1::unordered_map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::__list_iterator<osgeo::proj::lru11::KeyValuePair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::shared_ptr<osgeo::proj::io::SQLiteHandle> >, void*>, std::__1::hash<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::equal_to<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, std::__1::__list_iterator<osgeo::proj::lru11::KeyValuePair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::shared_ptr<osgeo::proj::io::SQLiteHandle> >, void*> > > > >::~Cache() Line | Count | Source | 111 | 1 | virtual ~Cache() = default; |
osgeo::proj::lru11::Cache<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::list<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >, osgeo::proj::lru11::NullLock, std::__1::unordered_map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::__list_iterator<osgeo::proj::lru11::KeyValuePair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::list<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > >, void*>, std::__1::hash<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::equal_to<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, std::__1::__list_iterator<osgeo::proj::lru11::KeyValuePair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::list<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > >, void*> > > > >::~Cache() Line | Count | Source | 111 | 9.89k | virtual ~Cache() = default; |
osgeo::proj::lru11::Cache<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, osgeo::proj::io::DatabaseContext::Private::GridInfoCache, osgeo::proj::lru11::NullLock, std::__1::unordered_map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::__list_iterator<osgeo::proj::lru11::KeyValuePair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, osgeo::proj::io::DatabaseContext::Private::GridInfoCache>, void*>, std::__1::hash<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::equal_to<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, std::__1::__list_iterator<osgeo::proj::lru11::KeyValuePair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, osgeo::proj::io::DatabaseContext::Private::GridInfoCache>, void*> > > > >::~Cache() Line | Count | Source | 111 | 9.89k | virtual ~Cache() = default; |
osgeo::proj::lru11::Cache<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::vector<dropbox::oxygen::nn<std::__1::shared_ptr<osgeo::proj::operation::CoordinateOperation> >, std::__1::allocator<dropbox::oxygen::nn<std::__1::shared_ptr<osgeo::proj::operation::CoordinateOperation> > > >, osgeo::proj::lru11::NullLock, std::__1::unordered_map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::__list_iterator<osgeo::proj::lru11::KeyValuePair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::vector<dropbox::oxygen::nn<std::__1::shared_ptr<osgeo::proj::operation::CoordinateOperation> >, std::__1::allocator<dropbox::oxygen::nn<std::__1::shared_ptr<osgeo::proj::operation::CoordinateOperation> > > > >, void*>, std::__1::hash<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::equal_to<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, std::__1::__list_iterator<osgeo::proj::lru11::KeyValuePair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::vector<dropbox::oxygen::nn<std::__1::shared_ptr<osgeo::proj::operation::CoordinateOperation> >, std::__1::allocator<dropbox::oxygen::nn<std::__1::shared_ptr<osgeo::proj::operation::CoordinateOperation> > > > >, void*> > > > >::~Cache() Line | Count | Source | 111 | 9.89k | virtual ~Cache() = default; |
osgeo::proj::lru11::Cache<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::shared_ptr<osgeo::proj::util::BaseObject>, osgeo::proj::lru11::NullLock, std::__1::unordered_map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::__list_iterator<osgeo::proj::lru11::KeyValuePair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::shared_ptr<osgeo::proj::util::BaseObject> >, void*>, std::__1::hash<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::equal_to<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, std::__1::__list_iterator<osgeo::proj::lru11::KeyValuePair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::shared_ptr<osgeo::proj::util::BaseObject> >, void*> > > > >::~Cache() Line | Count | Source | 111 | 79.1k | virtual ~Cache() = default; |
osgeo::proj::lru11::Cache<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, osgeo::proj::lru11::NullLock, std::__1::unordered_map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::__list_iterator<osgeo::proj::lru11::KeyValuePair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, void*>, std::__1::hash<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::equal_to<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, std::__1::__list_iterator<osgeo::proj::lru11::KeyValuePair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, void*> > > > >::~Cache() Line | Count | Source | 111 | 9.89k | virtual ~Cache() = default; |
Unexecuted instantiation: osgeo::proj::lru11::Cache<unsigned long, std::__1::vector<unsigned char, std::__1::allocator<unsigned char> >, osgeo::proj::lru11::NullLock, std::__1::unordered_map<unsigned long, std::__1::__list_iterator<osgeo::proj::lru11::KeyValuePair<unsigned long, std::__1::vector<unsigned char, std::__1::allocator<unsigned char> > >, void*>, std::__1::hash<unsigned long>, std::__1::equal_to<unsigned long>, std::__1::allocator<std::__1::pair<unsigned long const, std::__1::__list_iterator<osgeo::proj::lru11::KeyValuePair<unsigned long, std::__1::vector<unsigned char, std::__1::allocator<unsigned char> > >, void*> > > > >::~Cache() Unexecuted instantiation: osgeo::proj::lru11::Cache<unsigned long, std::__1::vector<float, std::__1::allocator<float> >, osgeo::proj::lru11::NullLock, std::__1::unordered_map<unsigned long, std::__1::__list_iterator<osgeo::proj::lru11::KeyValuePair<unsigned long, std::__1::vector<float, std::__1::allocator<float> > >, void*>, std::__1::hash<unsigned long>, std::__1::equal_to<unsigned long>, std::__1::allocator<std::__1::pair<unsigned long const, std::__1::__list_iterator<osgeo::proj::lru11::KeyValuePair<unsigned long, std::__1::vector<float, std::__1::allocator<float> > >, void*> > > > >::~Cache() |
112 | | size_t size() const { |
113 | | Guard g(lock_); |
114 | | return cache_.size(); |
115 | | } |
116 | | bool empty() const { |
117 | | Guard g(lock_); |
118 | | return cache_.empty(); |
119 | | } |
120 | 33.9k | void clear() { |
121 | 33.9k | Guard g(lock_); |
122 | 33.9k | cache_.clear(); |
123 | 33.9k | keys_.clear(); |
124 | 33.9k | } osgeo::proj::lru11::Cache<osgeo::proj::NetworkChunkCache::Key, std::__1::shared_ptr<std::__1::vector<unsigned char, std::__1::allocator<unsigned char> > >, std::__1::mutex, std::__1::unordered_map<osgeo::proj::NetworkChunkCache::Key, std::__1::__list_iterator<osgeo::proj::lru11::KeyValuePair<osgeo::proj::NetworkChunkCache::Key, std::__1::shared_ptr<std::__1::vector<unsigned char, std::__1::allocator<unsigned char> > > >, void*>, osgeo::proj::NetworkChunkCache::KeyHasher, std::__1::equal_to<osgeo::proj::NetworkChunkCache::Key>, std::__1::allocator<std::__1::pair<osgeo::proj::NetworkChunkCache::Key const, std::__1::__list_iterator<osgeo::proj::lru11::KeyValuePair<osgeo::proj::NetworkChunkCache::Key, std::__1::shared_ptr<std::__1::vector<unsigned char, std::__1::allocator<unsigned char> > > >, void*> > > > >::clear() Line | Count | Source | 120 | 11.3k | void clear() { | 121 | 11.3k | Guard g(lock_); | 122 | 11.3k | cache_.clear(); | 123 | 11.3k | keys_.clear(); | 124 | 11.3k | } |
osgeo::proj::lru11::Cache<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, osgeo::proj::FileProperties, std::__1::mutex, std::__1::unordered_map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::__list_iterator<osgeo::proj::lru11::KeyValuePair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, osgeo::proj::FileProperties>, void*>, std::__1::hash<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::equal_to<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, std::__1::__list_iterator<osgeo::proj::lru11::KeyValuePair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, osgeo::proj::FileProperties>, void*> > > > >::clear() Line | Count | Source | 120 | 11.3k | void clear() { | 121 | 11.3k | Guard g(lock_); | 122 | 11.3k | cache_.clear(); | 123 | 11.3k | keys_.clear(); | 124 | 11.3k | } |
osgeo::proj::lru11::Cache<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::shared_ptr<osgeo::proj::io::SQLiteHandle>, osgeo::proj::lru11::NullLock, std::__1::unordered_map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::__list_iterator<osgeo::proj::lru11::KeyValuePair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::shared_ptr<osgeo::proj::io::SQLiteHandle> >, void*>, std::__1::hash<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::equal_to<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, std::__1::__list_iterator<osgeo::proj::lru11::KeyValuePair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::shared_ptr<osgeo::proj::io::SQLiteHandle> >, void*> > > > >::clear() Line | Count | Source | 120 | 11.3k | void clear() { | 121 | 11.3k | Guard g(lock_); | 122 | 11.3k | cache_.clear(); | 123 | 11.3k | keys_.clear(); | 124 | 11.3k | } |
Unexecuted instantiation: osgeo::proj::lru11::Cache<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::shared_ptr<osgeo::proj::util::BaseObject>, osgeo::proj::lru11::NullLock, std::__1::unordered_map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::__list_iterator<osgeo::proj::lru11::KeyValuePair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::shared_ptr<osgeo::proj::util::BaseObject> >, void*>, std::__1::hash<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::equal_to<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, std::__1::__list_iterator<osgeo::proj::lru11::KeyValuePair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::shared_ptr<osgeo::proj::util::BaseObject> >, void*> > > > >::clear() Unexecuted instantiation: osgeo::proj::lru11::Cache<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::vector<dropbox::oxygen::nn<std::__1::shared_ptr<osgeo::proj::operation::CoordinateOperation> >, std::__1::allocator<dropbox::oxygen::nn<std::__1::shared_ptr<osgeo::proj::operation::CoordinateOperation> > > >, osgeo::proj::lru11::NullLock, std::__1::unordered_map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::__list_iterator<osgeo::proj::lru11::KeyValuePair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::vector<dropbox::oxygen::nn<std::__1::shared_ptr<osgeo::proj::operation::CoordinateOperation> >, std::__1::allocator<dropbox::oxygen::nn<std::__1::shared_ptr<osgeo::proj::operation::CoordinateOperation> > > > >, void*>, std::__1::hash<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::equal_to<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, std::__1::__list_iterator<osgeo::proj::lru11::KeyValuePair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::vector<dropbox::oxygen::nn<std::__1::shared_ptr<osgeo::proj::operation::CoordinateOperation> >, std::__1::allocator<dropbox::oxygen::nn<std::__1::shared_ptr<osgeo::proj::operation::CoordinateOperation> > > > >, void*> > > > >::clear() Unexecuted instantiation: osgeo::proj::lru11::Cache<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, osgeo::proj::io::DatabaseContext::Private::GridInfoCache, osgeo::proj::lru11::NullLock, std::__1::unordered_map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::__list_iterator<osgeo::proj::lru11::KeyValuePair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, osgeo::proj::io::DatabaseContext::Private::GridInfoCache>, void*>, std::__1::hash<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::equal_to<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, std::__1::__list_iterator<osgeo::proj::lru11::KeyValuePair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, osgeo::proj::io::DatabaseContext::Private::GridInfoCache>, void*> > > > >::clear() Unexecuted instantiation: osgeo::proj::lru11::Cache<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::list<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >, osgeo::proj::lru11::NullLock, std::__1::unordered_map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::__list_iterator<osgeo::proj::lru11::KeyValuePair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::list<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > >, void*>, std::__1::hash<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::equal_to<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, std::__1::__list_iterator<osgeo::proj::lru11::KeyValuePair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::list<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > >, void*> > > > >::clear() Unexecuted instantiation: osgeo::proj::lru11::Cache<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, osgeo::proj::lru11::NullLock, std::__1::unordered_map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::__list_iterator<osgeo::proj::lru11::KeyValuePair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, void*>, std::__1::hash<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::equal_to<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, std::__1::__list_iterator<osgeo::proj::lru11::KeyValuePair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, void*> > > > >::clear() |
125 | 186k | void insert(const Key &key, const Value &v) { |
126 | 186k | Guard g(lock_); |
127 | 186k | const auto iter = cache_.find(key); |
128 | 186k | if (iter != cache_.end()) { |
129 | 0 | iter->second->value = v; |
130 | 0 | keys_.splice(keys_.begin(), keys_, iter->second); |
131 | 0 | return; |
132 | 0 | } |
133 | | |
134 | 186k | keys_.emplace_front(key, v); |
135 | 186k | cache_[key] = keys_.begin(); |
136 | 186k | prune(); |
137 | 186k | } Unexecuted instantiation: osgeo::proj::lru11::Cache<osgeo::proj::NetworkChunkCache::Key, std::__1::shared_ptr<std::__1::vector<unsigned char, std::__1::allocator<unsigned char> > >, std::__1::mutex, std::__1::unordered_map<osgeo::proj::NetworkChunkCache::Key, std::__1::__list_iterator<osgeo::proj::lru11::KeyValuePair<osgeo::proj::NetworkChunkCache::Key, std::__1::shared_ptr<std::__1::vector<unsigned char, std::__1::allocator<unsigned char> > > >, void*>, osgeo::proj::NetworkChunkCache::KeyHasher, std::__1::equal_to<osgeo::proj::NetworkChunkCache::Key>, std::__1::allocator<std::__1::pair<osgeo::proj::NetworkChunkCache::Key const, std::__1::__list_iterator<osgeo::proj::lru11::KeyValuePair<osgeo::proj::NetworkChunkCache::Key, std::__1::shared_ptr<std::__1::vector<unsigned char, std::__1::allocator<unsigned char> > > >, void*> > > > >::insert(osgeo::proj::NetworkChunkCache::Key const&, std::__1::shared_ptr<std::__1::vector<unsigned char, std::__1::allocator<unsigned char> > > const&) Unexecuted instantiation: osgeo::proj::lru11::Cache<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, osgeo::proj::FileProperties, std::__1::mutex, std::__1::unordered_map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::__list_iterator<osgeo::proj::lru11::KeyValuePair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, osgeo::proj::FileProperties>, void*>, std::__1::hash<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::equal_to<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, std::__1::__list_iterator<osgeo::proj::lru11::KeyValuePair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, osgeo::proj::FileProperties>, void*> > > > >::insert(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, osgeo::proj::FileProperties const&) osgeo::proj::lru11::Cache<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::shared_ptr<osgeo::proj::io::SQLiteHandle>, osgeo::proj::lru11::NullLock, std::__1::unordered_map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::__list_iterator<osgeo::proj::lru11::KeyValuePair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::shared_ptr<osgeo::proj::io::SQLiteHandle> >, void*>, std::__1::hash<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::equal_to<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, std::__1::__list_iterator<osgeo::proj::lru11::KeyValuePair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::shared_ptr<osgeo::proj::io::SQLiteHandle> >, void*> > > > >::insert(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::shared_ptr<osgeo::proj::io::SQLiteHandle> const&) Line | Count | Source | 125 | 9.89k | void insert(const Key &key, const Value &v) { | 126 | 9.89k | Guard g(lock_); | 127 | 9.89k | const auto iter = cache_.find(key); | 128 | 9.89k | if (iter != cache_.end()) { | 129 | 0 | iter->second->value = v; | 130 | 0 | keys_.splice(keys_.begin(), keys_, iter->second); | 131 | 0 | return; | 132 | 0 | } | 133 | | | 134 | 9.89k | keys_.emplace_front(key, v); | 135 | 9.89k | cache_[key] = keys_.begin(); | 136 | 9.89k | prune(); | 137 | 9.89k | } |
osgeo::proj::lru11::Cache<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::shared_ptr<osgeo::proj::util::BaseObject>, osgeo::proj::lru11::NullLock, std::__1::unordered_map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::__list_iterator<osgeo::proj::lru11::KeyValuePair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::shared_ptr<osgeo::proj::util::BaseObject> >, void*>, std::__1::hash<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::equal_to<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, std::__1::__list_iterator<osgeo::proj::lru11::KeyValuePair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::shared_ptr<osgeo::proj::util::BaseObject> >, void*> > > > >::insert(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::shared_ptr<osgeo::proj::util::BaseObject> const&) Line | Count | Source | 125 | 112k | void insert(const Key &key, const Value &v) { | 126 | 112k | Guard g(lock_); | 127 | 112k | const auto iter = cache_.find(key); | 128 | 112k | if (iter != cache_.end()) { | 129 | 0 | iter->second->value = v; | 130 | 0 | keys_.splice(keys_.begin(), keys_, iter->second); | 131 | 0 | return; | 132 | 0 | } | 133 | | | 134 | 112k | keys_.emplace_front(key, v); | 135 | 112k | cache_[key] = keys_.begin(); | 136 | 112k | prune(); | 137 | 112k | } |
osgeo::proj::lru11::Cache<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::vector<dropbox::oxygen::nn<std::__1::shared_ptr<osgeo::proj::operation::CoordinateOperation> >, std::__1::allocator<dropbox::oxygen::nn<std::__1::shared_ptr<osgeo::proj::operation::CoordinateOperation> > > >, osgeo::proj::lru11::NullLock, std::__1::unordered_map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::__list_iterator<osgeo::proj::lru11::KeyValuePair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::vector<dropbox::oxygen::nn<std::__1::shared_ptr<osgeo::proj::operation::CoordinateOperation> >, std::__1::allocator<dropbox::oxygen::nn<std::__1::shared_ptr<osgeo::proj::operation::CoordinateOperation> > > > >, void*>, std::__1::hash<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::equal_to<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, std::__1::__list_iterator<osgeo::proj::lru11::KeyValuePair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::vector<dropbox::oxygen::nn<std::__1::shared_ptr<osgeo::proj::operation::CoordinateOperation> >, std::__1::allocator<dropbox::oxygen::nn<std::__1::shared_ptr<osgeo::proj::operation::CoordinateOperation> > > > >, void*> > > > >::insert(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::vector<dropbox::oxygen::nn<std::__1::shared_ptr<osgeo::proj::operation::CoordinateOperation> >, std::__1::allocator<dropbox::oxygen::nn<std::__1::shared_ptr<osgeo::proj::operation::CoordinateOperation> > > > const&) Line | Count | Source | 125 | 29.0k | void insert(const Key &key, const Value &v) { | 126 | 29.0k | Guard g(lock_); | 127 | 29.0k | const auto iter = cache_.find(key); | 128 | 29.0k | if (iter != cache_.end()) { | 129 | 0 | iter->second->value = v; | 130 | 0 | keys_.splice(keys_.begin(), keys_, iter->second); | 131 | 0 | return; | 132 | 0 | } | 133 | | | 134 | 29.0k | keys_.emplace_front(key, v); | 135 | 29.0k | cache_[key] = keys_.begin(); | 136 | 29.0k | prune(); | 137 | 29.0k | } |
osgeo::proj::lru11::Cache<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, osgeo::proj::io::DatabaseContext::Private::GridInfoCache, osgeo::proj::lru11::NullLock, std::__1::unordered_map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::__list_iterator<osgeo::proj::lru11::KeyValuePair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, osgeo::proj::io::DatabaseContext::Private::GridInfoCache>, void*>, std::__1::hash<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::equal_to<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, std::__1::__list_iterator<osgeo::proj::lru11::KeyValuePair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, osgeo::proj::io::DatabaseContext::Private::GridInfoCache>, void*> > > > >::insert(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, osgeo::proj::io::DatabaseContext::Private::GridInfoCache const&) Line | Count | Source | 125 | 30.6k | void insert(const Key &key, const Value &v) { | 126 | 30.6k | Guard g(lock_); | 127 | 30.6k | const auto iter = cache_.find(key); | 128 | 30.6k | if (iter != cache_.end()) { | 129 | 0 | iter->second->value = v; | 130 | 0 | keys_.splice(keys_.begin(), keys_, iter->second); | 131 | 0 | return; | 132 | 0 | } | 133 | | | 134 | 30.6k | keys_.emplace_front(key, v); | 135 | 30.6k | cache_[key] = keys_.begin(); | 136 | 30.6k | prune(); | 137 | 30.6k | } |
osgeo::proj::lru11::Cache<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::list<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >, osgeo::proj::lru11::NullLock, std::__1::unordered_map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::__list_iterator<osgeo::proj::lru11::KeyValuePair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::list<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > >, void*>, std::__1::hash<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::equal_to<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, std::__1::__list_iterator<osgeo::proj::lru11::KeyValuePair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::list<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > >, void*> > > > >::insert(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::list<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&) Line | Count | Source | 125 | 2.39k | void insert(const Key &key, const Value &v) { | 126 | 2.39k | Guard g(lock_); | 127 | 2.39k | const auto iter = cache_.find(key); | 128 | 2.39k | if (iter != cache_.end()) { | 129 | 0 | iter->second->value = v; | 130 | 0 | keys_.splice(keys_.begin(), keys_, iter->second); | 131 | 0 | return; | 132 | 0 | } | 133 | | | 134 | 2.39k | keys_.emplace_front(key, v); | 135 | 2.39k | cache_[key] = keys_.begin(); | 136 | 2.39k | prune(); | 137 | 2.39k | } |
osgeo::proj::lru11::Cache<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, osgeo::proj::lru11::NullLock, std::__1::unordered_map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::__list_iterator<osgeo::proj::lru11::KeyValuePair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, void*>, std::__1::hash<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::equal_to<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, std::__1::__list_iterator<osgeo::proj::lru11::KeyValuePair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, void*> > > > >::insert(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) Line | Count | Source | 125 | 2.18k | void insert(const Key &key, const Value &v) { | 126 | 2.18k | Guard g(lock_); | 127 | 2.18k | const auto iter = cache_.find(key); | 128 | 2.18k | if (iter != cache_.end()) { | 129 | 0 | iter->second->value = v; | 130 | 0 | keys_.splice(keys_.begin(), keys_, iter->second); | 131 | 0 | return; | 132 | 0 | } | 133 | | | 134 | 2.18k | keys_.emplace_front(key, v); | 135 | 2.18k | cache_[key] = keys_.begin(); | 136 | 2.18k | prune(); | 137 | 2.18k | } |
Unexecuted instantiation: osgeo::proj::lru11::Cache<unsigned long, std::__1::vector<float, std::__1::allocator<float> >, osgeo::proj::lru11::NullLock, std::__1::unordered_map<unsigned long, std::__1::__list_iterator<osgeo::proj::lru11::KeyValuePair<unsigned long, std::__1::vector<float, std::__1::allocator<float> > >, void*>, std::__1::hash<unsigned long>, std::__1::equal_to<unsigned long>, std::__1::allocator<std::__1::pair<unsigned long const, std::__1::__list_iterator<osgeo::proj::lru11::KeyValuePair<unsigned long, std::__1::vector<float, std::__1::allocator<float> > >, void*> > > > >::insert(unsigned long const&, std::__1::vector<float, std::__1::allocator<float> > const&) Unexecuted instantiation: osgeo::proj::lru11::Cache<unsigned long, std::__1::vector<unsigned char, std::__1::allocator<unsigned char> >, osgeo::proj::lru11::NullLock, std::__1::unordered_map<unsigned long, std::__1::__list_iterator<osgeo::proj::lru11::KeyValuePair<unsigned long, std::__1::vector<unsigned char, std::__1::allocator<unsigned char> > >, void*>, std::__1::hash<unsigned long>, std::__1::equal_to<unsigned long>, std::__1::allocator<std::__1::pair<unsigned long const, std::__1::__list_iterator<osgeo::proj::lru11::KeyValuePair<unsigned long, std::__1::vector<unsigned char, std::__1::allocator<unsigned char> > >, void*> > > > >::insert(unsigned long const&, std::__1::vector<unsigned char, std::__1::allocator<unsigned char> > const&) |
138 | 1.86M | bool tryGet(const Key &kIn, Value &vOut) { |
139 | 1.86M | Guard g(lock_); |
140 | 1.86M | const auto iter = cache_.find(kIn); |
141 | 1.86M | if (iter == cache_.end()) { |
142 | 227k | return false; |
143 | 227k | } |
144 | 1.63M | keys_.splice(keys_.begin(), keys_, iter->second); |
145 | 1.63M | vOut = iter->second->value; |
146 | 1.63M | return true; |
147 | 1.86M | } Unexecuted instantiation: osgeo::proj::lru11::Cache<osgeo::proj::NetworkChunkCache::Key, std::__1::shared_ptr<std::__1::vector<unsigned char, std::__1::allocator<unsigned char> > >, std::__1::mutex, std::__1::unordered_map<osgeo::proj::NetworkChunkCache::Key, std::__1::__list_iterator<osgeo::proj::lru11::KeyValuePair<osgeo::proj::NetworkChunkCache::Key, std::__1::shared_ptr<std::__1::vector<unsigned char, std::__1::allocator<unsigned char> > > >, void*>, osgeo::proj::NetworkChunkCache::KeyHasher, std::__1::equal_to<osgeo::proj::NetworkChunkCache::Key>, std::__1::allocator<std::__1::pair<osgeo::proj::NetworkChunkCache::Key const, std::__1::__list_iterator<osgeo::proj::lru11::KeyValuePair<osgeo::proj::NetworkChunkCache::Key, std::__1::shared_ptr<std::__1::vector<unsigned char, std::__1::allocator<unsigned char> > > >, void*> > > > >::tryGet(osgeo::proj::NetworkChunkCache::Key const&, std::__1::shared_ptr<std::__1::vector<unsigned char, std::__1::allocator<unsigned char> > >&) Unexecuted instantiation: osgeo::proj::lru11::Cache<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, osgeo::proj::FileProperties, std::__1::mutex, std::__1::unordered_map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::__list_iterator<osgeo::proj::lru11::KeyValuePair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, osgeo::proj::FileProperties>, void*>, std::__1::hash<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::equal_to<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, std::__1::__list_iterator<osgeo::proj::lru11::KeyValuePair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, osgeo::proj::FileProperties>, void*> > > > >::tryGet(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, osgeo::proj::FileProperties&) osgeo::proj::lru11::Cache<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::shared_ptr<osgeo::proj::io::SQLiteHandle>, osgeo::proj::lru11::NullLock, std::__1::unordered_map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::__list_iterator<osgeo::proj::lru11::KeyValuePair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::shared_ptr<osgeo::proj::io::SQLiteHandle> >, void*>, std::__1::hash<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::equal_to<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, std::__1::__list_iterator<osgeo::proj::lru11::KeyValuePair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::shared_ptr<osgeo::proj::io::SQLiteHandle> >, void*> > > > >::tryGet(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::shared_ptr<osgeo::proj::io::SQLiteHandle>&) Line | Count | Source | 138 | 9.89k | bool tryGet(const Key &kIn, Value &vOut) { | 139 | 9.89k | Guard g(lock_); | 140 | 9.89k | const auto iter = cache_.find(kIn); | 141 | 9.89k | if (iter == cache_.end()) { | 142 | 9.89k | return false; | 143 | 9.89k | } | 144 | 6 | keys_.splice(keys_.begin(), keys_, iter->second); | 145 | 6 | vOut = iter->second->value; | 146 | 6 | return true; | 147 | 9.89k | } |
osgeo::proj::lru11::Cache<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::shared_ptr<osgeo::proj::util::BaseObject>, osgeo::proj::lru11::NullLock, std::__1::unordered_map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::__list_iterator<osgeo::proj::lru11::KeyValuePair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::shared_ptr<osgeo::proj::util::BaseObject> >, void*>, std::__1::hash<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::equal_to<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, std::__1::__list_iterator<osgeo::proj::lru11::KeyValuePair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::shared_ptr<osgeo::proj::util::BaseObject> >, void*> > > > >::tryGet(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::shared_ptr<osgeo::proj::util::BaseObject>&) Line | Count | Source | 138 | 1.48M | bool tryGet(const Key &kIn, Value &vOut) { | 139 | 1.48M | Guard g(lock_); | 140 | 1.48M | const auto iter = cache_.find(kIn); | 141 | 1.48M | if (iter == cache_.end()) { | 142 | 153k | return false; | 143 | 153k | } | 144 | 1.32M | keys_.splice(keys_.begin(), keys_, iter->second); | 145 | 1.32M | vOut = iter->second->value; | 146 | 1.32M | return true; | 147 | 1.48M | } |
osgeo::proj::lru11::Cache<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::vector<dropbox::oxygen::nn<std::__1::shared_ptr<osgeo::proj::operation::CoordinateOperation> >, std::__1::allocator<dropbox::oxygen::nn<std::__1::shared_ptr<osgeo::proj::operation::CoordinateOperation> > > >, osgeo::proj::lru11::NullLock, std::__1::unordered_map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::__list_iterator<osgeo::proj::lru11::KeyValuePair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::vector<dropbox::oxygen::nn<std::__1::shared_ptr<osgeo::proj::operation::CoordinateOperation> >, std::__1::allocator<dropbox::oxygen::nn<std::__1::shared_ptr<osgeo::proj::operation::CoordinateOperation> > > > >, void*>, std::__1::hash<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::equal_to<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, std::__1::__list_iterator<osgeo::proj::lru11::KeyValuePair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::vector<dropbox::oxygen::nn<std::__1::shared_ptr<osgeo::proj::operation::CoordinateOperation> >, std::__1::allocator<dropbox::oxygen::nn<std::__1::shared_ptr<osgeo::proj::operation::CoordinateOperation> > > > >, void*> > > > >::tryGet(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::vector<dropbox::oxygen::nn<std::__1::shared_ptr<osgeo::proj::operation::CoordinateOperation> >, std::__1::allocator<dropbox::oxygen::nn<std::__1::shared_ptr<osgeo::proj::operation::CoordinateOperation> > > >&) Line | Count | Source | 138 | 116k | bool tryGet(const Key &kIn, Value &vOut) { | 139 | 116k | Guard g(lock_); | 140 | 116k | const auto iter = cache_.find(kIn); | 141 | 116k | if (iter == cache_.end()) { | 142 | 29.0k | return false; | 143 | 29.0k | } | 144 | 87.3k | keys_.splice(keys_.begin(), keys_, iter->second); | 145 | 87.3k | vOut = iter->second->value; | 146 | 87.3k | return true; | 147 | 116k | } |
osgeo::proj::lru11::Cache<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, osgeo::proj::io::DatabaseContext::Private::GridInfoCache, osgeo::proj::lru11::NullLock, std::__1::unordered_map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::__list_iterator<osgeo::proj::lru11::KeyValuePair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, osgeo::proj::io::DatabaseContext::Private::GridInfoCache>, void*>, std::__1::hash<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::equal_to<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, std::__1::__list_iterator<osgeo::proj::lru11::KeyValuePair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, osgeo::proj::io::DatabaseContext::Private::GridInfoCache>, void*> > > > >::tryGet(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, osgeo::proj::io::DatabaseContext::Private::GridInfoCache&) Line | Count | Source | 138 | 127k | bool tryGet(const Key &kIn, Value &vOut) { | 139 | 127k | Guard g(lock_); | 140 | 127k | const auto iter = cache_.find(kIn); | 141 | 127k | if (iter == cache_.end()) { | 142 | 30.6k | return false; | 143 | 30.6k | } | 144 | 97.0k | keys_.splice(keys_.begin(), keys_, iter->second); | 145 | 97.0k | vOut = iter->second->value; | 146 | 97.0k | return true; | 147 | 127k | } |
osgeo::proj::lru11::Cache<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::list<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >, osgeo::proj::lru11::NullLock, std::__1::unordered_map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::__list_iterator<osgeo::proj::lru11::KeyValuePair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::list<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > >, void*>, std::__1::hash<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::equal_to<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, std::__1::__list_iterator<osgeo::proj::lru11::KeyValuePair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::list<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > >, void*> > > > >::tryGet(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::list<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >&) Line | Count | Source | 138 | 64.8k | bool tryGet(const Key &kIn, Value &vOut) { | 139 | 64.8k | Guard g(lock_); | 140 | 64.8k | const auto iter = cache_.find(kIn); | 141 | 64.8k | if (iter == cache_.end()) { | 142 | 2.39k | return false; | 143 | 2.39k | } | 144 | 62.4k | keys_.splice(keys_.begin(), keys_, iter->second); | 145 | 62.4k | vOut = iter->second->value; | 146 | 62.4k | return true; | 147 | 64.8k | } |
osgeo::proj::lru11::Cache<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, osgeo::proj::lru11::NullLock, std::__1::unordered_map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::__list_iterator<osgeo::proj::lru11::KeyValuePair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, void*>, std::__1::hash<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::equal_to<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, std::__1::__list_iterator<osgeo::proj::lru11::KeyValuePair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, void*> > > > >::tryGet(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&) Line | Count | Source | 138 | 64.5k | bool tryGet(const Key &kIn, Value &vOut) { | 139 | 64.5k | Guard g(lock_); | 140 | 64.5k | const auto iter = cache_.find(kIn); | 141 | 64.5k | if (iter == cache_.end()) { | 142 | 2.18k | return false; | 143 | 2.18k | } | 144 | 62.3k | keys_.splice(keys_.begin(), keys_, iter->second); | 145 | 62.3k | vOut = iter->second->value; | 146 | 62.3k | return true; | 147 | 64.5k | } |
|
148 | | /** |
149 | | * The const reference returned here is only |
150 | | * guaranteed to be valid till the next insert/delete |
151 | | */ |
152 | | const Value &get(const Key &key) { |
153 | | Guard g(lock_); |
154 | | const auto iter = cache_.find(key); |
155 | | if (iter == cache_.end()) { |
156 | | throw KeyNotFound(); |
157 | | } |
158 | | keys_.splice(keys_.begin(), keys_, iter->second); |
159 | | return iter->second->value; |
160 | | } |
161 | | |
162 | | /** |
163 | | * The const reference returned here is only |
164 | | * guaranteed to be valid till the next insert/delete |
165 | | */ |
166 | 0 | const Value *getPtr(const Key &key) { |
167 | 0 | Guard g(lock_); |
168 | 0 | const auto iter = cache_.find(key); |
169 | 0 | if (iter == cache_.end()) { |
170 | 0 | return nullptr; |
171 | 0 | } |
172 | 0 | keys_.splice(keys_.begin(), keys_, iter->second); |
173 | 0 | return &(iter->second->value); |
174 | 0 | } Unexecuted instantiation: osgeo::proj::lru11::Cache<unsigned long, std::__1::vector<float, std::__1::allocator<float> >, osgeo::proj::lru11::NullLock, std::__1::unordered_map<unsigned long, std::__1::__list_iterator<osgeo::proj::lru11::KeyValuePair<unsigned long, std::__1::vector<float, std::__1::allocator<float> > >, void*>, std::__1::hash<unsigned long>, std::__1::equal_to<unsigned long>, std::__1::allocator<std::__1::pair<unsigned long const, std::__1::__list_iterator<osgeo::proj::lru11::KeyValuePair<unsigned long, std::__1::vector<float, std::__1::allocator<float> > >, void*> > > > >::getPtr(unsigned long const&) Unexecuted instantiation: osgeo::proj::lru11::Cache<unsigned long, std::__1::vector<unsigned char, std::__1::allocator<unsigned char> >, osgeo::proj::lru11::NullLock, std::__1::unordered_map<unsigned long, std::__1::__list_iterator<osgeo::proj::lru11::KeyValuePair<unsigned long, std::__1::vector<unsigned char, std::__1::allocator<unsigned char> > >, void*>, std::__1::hash<unsigned long>, std::__1::equal_to<unsigned long>, std::__1::allocator<std::__1::pair<unsigned long const, std::__1::__list_iterator<osgeo::proj::lru11::KeyValuePair<unsigned long, std::__1::vector<unsigned char, std::__1::allocator<unsigned char> > >, void*> > > > >::getPtr(unsigned long const&) |
175 | | |
176 | | /** |
177 | | * returns a copy of the stored object (if found) |
178 | | */ |
179 | | Value getCopy(const Key &key) { return get(key); } |
180 | 0 | bool remove(const Key &key) { |
181 | 0 | Guard g(lock_); |
182 | 0 | auto iter = cache_.find(key); |
183 | 0 | if (iter == cache_.end()) { |
184 | 0 | return false; |
185 | 0 | } |
186 | 0 | keys_.erase(iter->second); |
187 | 0 | cache_.erase(iter); |
188 | 0 | return true; |
189 | 0 | } |
190 | | bool contains(const Key &key) { |
191 | | Guard g(lock_); |
192 | | return cache_.find(key) != cache_.end(); |
193 | | } |
194 | | |
195 | | size_t getMaxSize() const { return maxSize_; } |
196 | | size_t getElasticity() const { return elasticity_; } |
197 | | size_t getMaxAllowedSize() const { return maxSize_ + elasticity_; } |
198 | 0 | template <typename F> void cwalk(F &f) const { |
199 | 0 | Guard g(lock_); |
200 | 0 | std::for_each(keys_.begin(), keys_.end(), f); |
201 | 0 | } |
202 | | |
203 | | protected: |
204 | 186k | size_t prune() { |
205 | 186k | size_t maxAllowed = maxSize_ + elasticity_; |
206 | 186k | if (maxSize_ == 0 || |
207 | 186k | cache_.size() <= maxAllowed) { /* ERO: changed < to <= */ |
208 | 186k | return 0; |
209 | 186k | } |
210 | 254 | size_t count = 0; |
211 | 3.04k | while (cache_.size() > maxSize_) { |
212 | 2.79k | cache_.erase(keys_.back().key); |
213 | 2.79k | keys_.pop_back(); |
214 | 2.79k | ++count; |
215 | 2.79k | } |
216 | 254 | return count; |
217 | 186k | } Unexecuted instantiation: osgeo::proj::lru11::Cache<osgeo::proj::NetworkChunkCache::Key, std::__1::shared_ptr<std::__1::vector<unsigned char, std::__1::allocator<unsigned char> > >, std::__1::mutex, std::__1::unordered_map<osgeo::proj::NetworkChunkCache::Key, std::__1::__list_iterator<osgeo::proj::lru11::KeyValuePair<osgeo::proj::NetworkChunkCache::Key, std::__1::shared_ptr<std::__1::vector<unsigned char, std::__1::allocator<unsigned char> > > >, void*>, osgeo::proj::NetworkChunkCache::KeyHasher, std::__1::equal_to<osgeo::proj::NetworkChunkCache::Key>, std::__1::allocator<std::__1::pair<osgeo::proj::NetworkChunkCache::Key const, std::__1::__list_iterator<osgeo::proj::lru11::KeyValuePair<osgeo::proj::NetworkChunkCache::Key, std::__1::shared_ptr<std::__1::vector<unsigned char, std::__1::allocator<unsigned char> > > >, void*> > > > >::prune() Unexecuted instantiation: osgeo::proj::lru11::Cache<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, osgeo::proj::FileProperties, std::__1::mutex, std::__1::unordered_map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::__list_iterator<osgeo::proj::lru11::KeyValuePair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, osgeo::proj::FileProperties>, void*>, std::__1::hash<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::equal_to<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, std::__1::__list_iterator<osgeo::proj::lru11::KeyValuePair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, osgeo::proj::FileProperties>, void*> > > > >::prune() osgeo::proj::lru11::Cache<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::shared_ptr<osgeo::proj::io::SQLiteHandle>, osgeo::proj::lru11::NullLock, std::__1::unordered_map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::__list_iterator<osgeo::proj::lru11::KeyValuePair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::shared_ptr<osgeo::proj::io::SQLiteHandle> >, void*>, std::__1::hash<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::equal_to<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, std::__1::__list_iterator<osgeo::proj::lru11::KeyValuePair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::shared_ptr<osgeo::proj::io::SQLiteHandle> >, void*> > > > >::prune() Line | Count | Source | 204 | 9.89k | size_t prune() { | 205 | 9.89k | size_t maxAllowed = maxSize_ + elasticity_; | 206 | 9.89k | if (maxSize_ == 0 || | 207 | 9.89k | cache_.size() <= maxAllowed) { /* ERO: changed < to <= */ | 208 | 9.89k | return 0; | 209 | 9.89k | } | 210 | 0 | size_t count = 0; | 211 | 0 | while (cache_.size() > maxSize_) { | 212 | 0 | cache_.erase(keys_.back().key); | 213 | 0 | keys_.pop_back(); | 214 | 0 | ++count; | 215 | 0 | } | 216 | 0 | return count; | 217 | 9.89k | } |
osgeo::proj::lru11::Cache<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::shared_ptr<osgeo::proj::util::BaseObject>, osgeo::proj::lru11::NullLock, std::__1::unordered_map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::__list_iterator<osgeo::proj::lru11::KeyValuePair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::shared_ptr<osgeo::proj::util::BaseObject> >, void*>, std::__1::hash<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::equal_to<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, std::__1::__list_iterator<osgeo::proj::lru11::KeyValuePair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::shared_ptr<osgeo::proj::util::BaseObject> >, void*> > > > >::prune() Line | Count | Source | 204 | 112k | size_t prune() { | 205 | 112k | size_t maxAllowed = maxSize_ + elasticity_; | 206 | 112k | if (maxSize_ == 0 || | 207 | 112k | cache_.size() <= maxAllowed) { /* ERO: changed < to <= */ | 208 | 112k | return 0; | 209 | 112k | } | 210 | 0 | size_t count = 0; | 211 | 0 | while (cache_.size() > maxSize_) { | 212 | 0 | cache_.erase(keys_.back().key); | 213 | 0 | keys_.pop_back(); | 214 | 0 | ++count; | 215 | 0 | } | 216 | 0 | return count; | 217 | 112k | } |
osgeo::proj::lru11::Cache<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::vector<dropbox::oxygen::nn<std::__1::shared_ptr<osgeo::proj::operation::CoordinateOperation> >, std::__1::allocator<dropbox::oxygen::nn<std::__1::shared_ptr<osgeo::proj::operation::CoordinateOperation> > > >, osgeo::proj::lru11::NullLock, std::__1::unordered_map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::__list_iterator<osgeo::proj::lru11::KeyValuePair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::vector<dropbox::oxygen::nn<std::__1::shared_ptr<osgeo::proj::operation::CoordinateOperation> >, std::__1::allocator<dropbox::oxygen::nn<std::__1::shared_ptr<osgeo::proj::operation::CoordinateOperation> > > > >, void*>, std::__1::hash<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::equal_to<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, std::__1::__list_iterator<osgeo::proj::lru11::KeyValuePair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::vector<dropbox::oxygen::nn<std::__1::shared_ptr<osgeo::proj::operation::CoordinateOperation> >, std::__1::allocator<dropbox::oxygen::nn<std::__1::shared_ptr<osgeo::proj::operation::CoordinateOperation> > > > >, void*> > > > >::prune() Line | Count | Source | 204 | 29.0k | size_t prune() { | 205 | 29.0k | size_t maxAllowed = maxSize_ + elasticity_; | 206 | 29.0k | if (maxSize_ == 0 || | 207 | 29.0k | cache_.size() <= maxAllowed) { /* ERO: changed < to <= */ | 208 | 28.8k | return 0; | 209 | 28.8k | } | 210 | 199 | size_t count = 0; | 211 | 2.38k | while (cache_.size() > maxSize_) { | 212 | 2.18k | cache_.erase(keys_.back().key); | 213 | 2.18k | keys_.pop_back(); | 214 | 2.18k | ++count; | 215 | 2.18k | } | 216 | 199 | return count; | 217 | 29.0k | } |
osgeo::proj::lru11::Cache<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, osgeo::proj::io::DatabaseContext::Private::GridInfoCache, osgeo::proj::lru11::NullLock, std::__1::unordered_map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::__list_iterator<osgeo::proj::lru11::KeyValuePair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, osgeo::proj::io::DatabaseContext::Private::GridInfoCache>, void*>, std::__1::hash<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::equal_to<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, std::__1::__list_iterator<osgeo::proj::lru11::KeyValuePair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, osgeo::proj::io::DatabaseContext::Private::GridInfoCache>, void*> > > > >::prune() Line | Count | Source | 204 | 30.6k | size_t prune() { | 205 | 30.6k | size_t maxAllowed = maxSize_ + elasticity_; | 206 | 30.6k | if (maxSize_ == 0 || | 207 | 30.6k | cache_.size() <= maxAllowed) { /* ERO: changed < to <= */ | 208 | 30.5k | return 0; | 209 | 30.5k | } | 210 | 55 | size_t count = 0; | 211 | 660 | while (cache_.size() > maxSize_) { | 212 | 605 | cache_.erase(keys_.back().key); | 213 | 605 | keys_.pop_back(); | 214 | 605 | ++count; | 215 | 605 | } | 216 | 55 | return count; | 217 | 30.6k | } |
osgeo::proj::lru11::Cache<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::list<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >, osgeo::proj::lru11::NullLock, std::__1::unordered_map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::__list_iterator<osgeo::proj::lru11::KeyValuePair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::list<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > >, void*>, std::__1::hash<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::equal_to<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, std::__1::__list_iterator<osgeo::proj::lru11::KeyValuePair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::list<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > >, void*> > > > >::prune() Line | Count | Source | 204 | 2.39k | size_t prune() { | 205 | 2.39k | size_t maxAllowed = maxSize_ + elasticity_; | 206 | 2.39k | if (maxSize_ == 0 || | 207 | 2.39k | cache_.size() <= maxAllowed) { /* ERO: changed < to <= */ | 208 | 2.39k | return 0; | 209 | 2.39k | } | 210 | 0 | size_t count = 0; | 211 | 0 | while (cache_.size() > maxSize_) { | 212 | 0 | cache_.erase(keys_.back().key); | 213 | 0 | keys_.pop_back(); | 214 | 0 | ++count; | 215 | 0 | } | 216 | 0 | return count; | 217 | 2.39k | } |
osgeo::proj::lru11::Cache<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, osgeo::proj::lru11::NullLock, std::__1::unordered_map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::__list_iterator<osgeo::proj::lru11::KeyValuePair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, void*>, std::__1::hash<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::equal_to<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, std::__1::__list_iterator<osgeo::proj::lru11::KeyValuePair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, void*> > > > >::prune() Line | Count | Source | 204 | 2.18k | size_t prune() { | 205 | 2.18k | size_t maxAllowed = maxSize_ + elasticity_; | 206 | 2.18k | if (maxSize_ == 0 || | 207 | 2.18k | cache_.size() <= maxAllowed) { /* ERO: changed < to <= */ | 208 | 2.18k | return 0; | 209 | 2.18k | } | 210 | 0 | size_t count = 0; | 211 | 0 | while (cache_.size() > maxSize_) { | 212 | 0 | cache_.erase(keys_.back().key); | 213 | 0 | keys_.pop_back(); | 214 | 0 | ++count; | 215 | 0 | } | 216 | 0 | return count; | 217 | 2.18k | } |
Unexecuted instantiation: osgeo::proj::lru11::Cache<unsigned long, std::__1::vector<float, std::__1::allocator<float> >, osgeo::proj::lru11::NullLock, std::__1::unordered_map<unsigned long, std::__1::__list_iterator<osgeo::proj::lru11::KeyValuePair<unsigned long, std::__1::vector<float, std::__1::allocator<float> > >, void*>, std::__1::hash<unsigned long>, std::__1::equal_to<unsigned long>, std::__1::allocator<std::__1::pair<unsigned long const, std::__1::__list_iterator<osgeo::proj::lru11::KeyValuePair<unsigned long, std::__1::vector<float, std::__1::allocator<float> > >, void*> > > > >::prune() Unexecuted instantiation: osgeo::proj::lru11::Cache<unsigned long, std::__1::vector<unsigned char, std::__1::allocator<unsigned char> >, osgeo::proj::lru11::NullLock, std::__1::unordered_map<unsigned long, std::__1::__list_iterator<osgeo::proj::lru11::KeyValuePair<unsigned long, std::__1::vector<unsigned char, std::__1::allocator<unsigned char> > >, void*>, std::__1::hash<unsigned long>, std::__1::equal_to<unsigned long>, std::__1::allocator<std::__1::pair<unsigned long const, std::__1::__list_iterator<osgeo::proj::lru11::KeyValuePair<unsigned long, std::__1::vector<unsigned char, std::__1::allocator<unsigned char> > >, void*> > > > >::prune() |
218 | | |
219 | | private: |
220 | | // Disallow copying. |
221 | | Cache(const Cache &) = delete; |
222 | | Cache &operator=(const Cache &) = delete; |
223 | | |
224 | | mutable Lock lock_{}; |
225 | | Map cache_{}; |
226 | | list_type keys_{}; |
227 | | size_t maxSize_; |
228 | | size_t elasticity_; |
229 | | }; |
230 | | |
231 | | } // namespace lru11 |
232 | | NS_PROJ_END |
233 | | |
234 | | /*! @endcond */ |