Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mohaps/lrucache11
A header only C++11 LRU Cache template class that allows you to define key, value and optionally the Map type. uses a double linked list and a std::unordered_map style container to provide fast insert, delete and update No dependencies other than the C++ standard library. This is a C++11 remake of my earlier LRUCache project (https://github.com/mohaps/lrucache) The goal was to create a fast LRUCache header only library and to avoid any dependencies like boost.
https://github.com/mohaps/lrucache11
Last synced: 16 days ago
JSON representation
A header only C++11 LRU Cache template class that allows you to define key, value and optionally the Map type. uses a double linked list and a std::unordered_map style container to provide fast insert, delete and update No dependencies other than the C++ standard library. This is a C++11 remake of my earlier LRUCache project (https://github.com/mohaps/lrucache) The goal was to create a fast LRUCache header only library and to avoid any dependencies like boost.
- Host: GitHub
- URL: https://github.com/mohaps/lrucache11
- Owner: mohaps
- Created: 2016-08-30T12:49:09.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2024-07-24T11:39:01.000Z (4 months ago)
- Last Synced: 2024-07-31T09:09:30.520Z (4 months ago)
- Language: C++
- Homepage: https://github.com/mohaps/lrucache11
- Size: 26.4 KB
- Stars: 289
- Watchers: 15
- Forks: 63
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-algorithms - lrucache11 - A header only C++11 LRU Cache template class that allows you to define key, value and optionally the Map type (Awesome Algorithms / Cache)
README
LRUCache11
==========A header only C++11 LRU Cache template class that allows you to define key, value and optionally the Map type. uses a double linked list and a ```std::unordered_map``` style container to provide fast insert, delete and update
No dependencies other than the C++ standard library. This is a C++11 remake of my earlier LRUCache project (https://github.com/mohaps/lrucache)
The goal was to create a fast LRUCache header only library and to avoid any dependencies like boost.
Enjoy and drop me a line.
Usage Example
---------------
```cpp
#include "LRUCache11.hpp"
namespace lru
{
void test()
{
lru11::Cache cache(3,0);
cache.insert("hello", "world");
cache.insert("foo", "bar");
std::cout<<"checking refresh : "<
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
```Comments/Crits
---------------Please contact author at [email protected]
Links
--------
* Wikipedia Entry on LRU Caching : http://en.wikipedia.org/wiki/Cache_algorithms#Least_Recently_Used
* Earlier version of the library : https://github.com/mohaps/lrucache