39 m_LFU.insert(std::map<int, double>::value_type(value, 1.));
49 std::map<int, double>::iterator itLFU =
m_LFU.begin();
50 std::map<int, double>::iterator itMin =
m_LFU.end();
52 double minValue = std::numeric_limits<double>::max();
54 while(itLFU !=
m_LFU.end())
56 if(itLFU->second < minValue)
58 minValue = itLFU->second;
64 if(itMin !=
m_LFU.end())
73 std::map<int, double>::iterator itLFU =
m_LFU.begin();
75 while(itLFU !=
m_LFU.end())
77 if(itLFU->first == value)
virtual void update(int value)
Function used to inform that an index must be updated.
virtual void toRemove(int &value)
Function used to check what index has to be removed from the cache.
std::map< int, double > m_LFU
virtual void accessed(int value)
Function used to inform that an index was accessed.
virtual ~LFUCachePolicy()
Virtual destructor.
virtual void added(int value)
Function used to add a new index to be controlled.
This class is used to implement the LFU cache policy.
LFUCachePolicy()
Default constructor.