41 m_LFU.insert(std::map<int, double>::value_type(value, 1.));
51 std::map<int, double>::iterator itLFU = m_LFU.begin();
52 std::map<int, double>::iterator itMin = m_LFU.end();
54 double minValue = std::numeric_limits<double>::max();
56 while(itLFU != m_LFU.end())
58 if(itLFU->second < minValue)
60 minValue = itLFU->second;
66 if(itMin != m_LFU.end())
75 std::map<int, double>::iterator itLFU = m_LFU.begin();
77 while(itLFU != m_LFU.end())
79 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.
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.