MCPcopy Create free account
hub / github.com/catboost/catboost / TLWCache

Class TLWCache

library/cpp/cache/cache.h:764–783  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

762// doesn't support promotion
763template <typename TKey, typename TValue, typename TWeight, typename TWeighter, typename TDeleter = TNoopDelete, typename TAllocator = std::allocator<typename TLWList<TKey, TValue, TWeight, TWeighter>::TItem>>
764class TLWCache: public TCache<TKey, TValue, TLWList<TKey, TValue, TWeight, TWeighter>, TDeleter, TAllocator> {
765 typedef TCache<TKey, TValue, TLWList<TKey, TValue, TWeight, TWeighter>, TDeleter, TAllocator> TBase;
766 using TListType = TLWList<TKey, TValue, TWeight, TWeighter>;
767
768public:
769 typedef typename TBase::TIterator TIterator;
770
771 TLWCache(size_t maxSize, bool multiValue = false)
772 : TBase(TListType(maxSize), multiValue)
773 {
774 }
775
776 TValue& GetLightest() {
777 return TBase::List.GetLightest()->Value;
778 }
779
780 TIterator FindLightest() {
781 return TBase::Empty() ? TBase::End() : this->FindByItem(TBase::List.GetLightest());
782 }
783};

Callers

nothing calls this directly

Calls 1

GetLightestMethod · 0.80

Tested by

no test coverage detected