Distributed Cache
Public Member Functions | Private Attributes | List of all members
LRUCachePolicy Class Reference

#include <LRU_cache_policy.h>

Inheritance diagram for LRUCachePolicy:
Inheritance graph
Collaboration diagram for LRUCachePolicy:
Collaboration graph

Public Member Functions

bool hasEntry (std::string container, int key)
 
int getEntry (std::string container, int key)
 
void insert (std::string container, int key, int value)
 
void erase (std::string container, int key)
 
void allocateSize (int size)
 
void reset ()
 
int getSize ()
 
 LRUCachePolicy (int size=0)
 
- Public Member Functions inherited from CachePolicyInterface
virtual ~CachePolicyInterface ()
 

Private Attributes

std::map< key_pair_t, int > keyValueMap
 
std::map< key_pair_t, std::list< key_pair_t >::iterator > keyIteratorMap
 
std::list< key_pair_t > LRU_Queue
 
int size
 

Constructor & Destructor Documentation

◆ LRUCachePolicy()

LRUCachePolicy::LRUCachePolicy ( int  size = 0)
inline

Member Function Documentation

◆ allocateSize()

void LRUCachePolicy::allocateSize ( int  size)
virtual

Implements CachePolicyInterface.

Here is the caller graph for this function:

◆ erase()

void LRUCachePolicy::erase ( std::string  container,
int  key 
)
virtual

Implements CachePolicyInterface.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getEntry()

int LRUCachePolicy::getEntry ( std::string  container,
int  key 
)
virtual

Implements CachePolicyInterface.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getSize()

int LRUCachePolicy::getSize ( )
inlinevirtual

Implements CachePolicyInterface.

Here is the caller graph for this function:

◆ hasEntry()

bool LRUCachePolicy::hasEntry ( std::string  container,
int  key 
)
virtual

Implements CachePolicyInterface.

Here is the caller graph for this function:

◆ insert()

void LRUCachePolicy::insert ( std::string  container,
int  key,
int  value 
)
virtual

Implements CachePolicyInterface.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ reset()

void LRUCachePolicy::reset ( )
virtual

Implements CachePolicyInterface.

Here is the caller graph for this function:

Member Data Documentation

◆ keyIteratorMap

std::map<key_pair_t, std::list<key_pair_t>::iterator> LRUCachePolicy::keyIteratorMap
private

◆ keyValueMap

std::map<key_pair_t, int> LRUCachePolicy::keyValueMap
private

◆ LRU_Queue

std::list<key_pair_t> LRUCachePolicy::LRU_Queue
private

◆ size

int LRUCachePolicy::size
private

The documentation for this class was generated from the following files: