2 #ifndef _YI_LRU_CACHE_H_ 3 #define _YI_LRU_CACHE_H_ 31 struct CYILRUCacheItem;
34 bool operator() (
const CYILRUCacheItem *lhs,
const CYILRUCacheItem *rhs)
const;
56 void Add(
const CYIUrl &url,
57 std::unique_ptr<const CYILRUData> pData,
58 uint32_t uMaxAgeInSeconds = 0);
63 bool Contains(
const CYIUrl &url)
const;
68 int32_t GetSize()
const;
73 std::vector<CYIUrl> GetUrls()
const;
84 bool HasExpired(
const CYIUrl &url)
const;
94 void Remove(
const CYIUrl &url);
110 void SetExpireTime(uint32_t uMaxAgeInSeconds,
const CYIUrl &url);
115 void LogCacheItems()
const;
122 void Remove(CYILRUCacheItem *pItem);
125 std::map<
CYIUrl , CYILRUCacheItem * > m_UrlCache;
134 #endif // _YI_LRU_CACHE_H_
#define YI_DISALLOW_COPY_AND_ASSIGN(TypeName)
Delete the copy constructor and assignment operator (and consequently the move constructor as well) ...
Definition: YiPredef.h:114
Definition: YiMutex.h:110
Contains information required to configure and perform a HTTP request.
Definition: YiHTTPRequest.h:34
Base class for data to be stored in the cache. Derive from this class to add custom data to the cache...
Definition: YiLRUCache.h:23
This class provides a Least Recently Used (LRU) cache implementation.
Definition: YiLRUCache.h:46
A class used to encapsulate an URL.
Definition: YiUrl.h:24
Utility class that requires a string as per the following format: http://en.wikipedia.org/wiki/ISO_8601 to construct an instance and provides some commmonly used parts like year, month, hour etc. in different data types and formats. All dates are in the local timezone unless otherwise specified.
Definition: YiDateTime.h:17
virtual ~CYILRUData()
Definition: YiLRUCache.h:25
Definition: YiLRUCache.h:32
CYIUrl m_url
Definition: YiLRUCache.h:28