MCPcopy Create free account
hub / github.com/CVCUDA/CV-CUDA / fetchOne

Method fetchOne

python/mod_cvcuda/nvcv/Cache.cpp:229–244  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

227#endif
228
229std::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
246void Cache::clear()
247{

Callers 1

Calls 1

isInUseMethod · 0.80

Tested by

no test coverage detected