|
Covalent Bond
0.0.1-alpha
'covalent bond' is a data middle office. As a 2022-2023 Fall SWE final project.
|
Go to the documentation of this file.
13 #include "../../pch.hpp"
19 #define find_list for (auto i = m_cacheList.begin(); i != m_cacheList.end(); i++)
61 void push(std::string key, V value) {
86 V*
get(
const std::string& key) {
94 V* not_exit =
nullptr;
149 std::cout <<
"The" << n <<
"th element" << bs <<
" : " <<
m_cacheMap[bs] << std::endl;
cbLRUCache(int32_t max_size)
Construct a new cb Least Recently Use Cache object.
void __loop_map()
loop in cachae list and map
void insertTop(const std::string &key)
transit the node choosen to the top of list
V * get(const std::string &key)
Get the value of corresponding key of input, if key doesn't exist, it will return null pointer.
#define find_list
Macro define of loop in cache list.
std::list< node > m_cacheList
void push(std::string key, V value)
Push key and value into cache. If key has been existed, the corresponding value will be update.
void update(const std::string &key)
move the node has been used recently to the top of cache list
void eraseTail()
delete the last element of list
We used LRU alogrithm to implement our cache.
~cbLRUCache()
Destroy the cb Least Recently Use Cache object.
std::map< std::string, V > m_cacheMap