| 227 | #endif |
| 228 | |
| 229 | std::shared_ptr<CacheItem> Cache::fetchOne(const IKey &key) const |
| 230 | { |
| 231 | std::unique_lock<std::mutex> lk(pimpl->mtx); |
| 232 | |
| 233 | auto itrange = pimpl->items.equal_range(&key); |
| 234 | |
| 235 | for (auto it = itrange.first; it != itrange.second; ++it) |
| 236 | { |
| 237 | if (!it->second->isInUse()) |
| 238 | { |
| 239 | return it->second; |
| 240 | } |
| 241 | } |
| 242 | |
| 243 | return {}; |
| 244 | } |
| 245 | |
| 246 | void Cache::clear() |
| 247 | { |
no test coverage detected