void onAdd(const void*, const KeyValueArgs <TKey, TValue>& args)
{
_keys.push_front(args.key());
std::pair<IndexIterator, bool> stat = _keyIndex.insert(std::make_pair(args.key(), _keys.begin()));
if (!stat.second)
{
stat.first->second = _keys.begin();
}
}
누군가이 코드의 작동 방식을 설명해 주시겠습니까? 그것은 POCO LRUCacheStrategy에서 왔으며 LRUCache 구현을위한 맵을 사용합니다.Poco의 LRUCacheStrategy - 어떻게 작동합니까?
캐시 된 개체를 디스크에 저장하려면 캐시를 변경하고 싶습니다. 닫는 즉시 파일 스트림을 전략에 추가 할 수 있습니까?
도움 주셔서 감사합니다.
걸릴 _ 데이터는 키와 값이 포함 된지도입니까? –
_data는 부모 클래스의 보호 된 멤버 인 [AbstractCache :: _ data] (https://github.com/pocoproject/poco/blob/develop/Foundation/include/Poco/AbstractCache.h#L369)입니다. – Alex