PACS System 0.1.0
PACS DICOM system library
Loading...
Searching...
No Matches
simple_lru_cache.h File Reference

Thread-safe LRU (Least Recently Used) cache for query results. More...

#include <atomic>
#include <chrono>
#include <cstdint>
#include <functional>
#include <list>
#include <memory>
#include <mutex>
#include <optional>
#include <shared_mutex>
#include <string>
#include <unordered_map>
Include dependency graph for simple_lru_cache.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  kcenon::pacs::services::cache::cache_config
 Configuration options for the LRU cache. More...
 
struct  kcenon::pacs::services::cache::cache_stats
 Statistics for cache performance monitoring. More...
 
class  kcenon::pacs::services::cache::simple_lru_cache< Key, Value, Hash, KeyEqual >
 Thread-safe LRU cache with TTL support. More...
 
struct  kcenon::pacs::services::cache::simple_lru_cache< Key, Value, Hash, KeyEqual >::cache_entry
 

Namespaces

namespace  kcenon
 
namespace  kcenon::pacs
 
namespace  kcenon::pacs::services
 
namespace  kcenon::pacs::services::cache
 

Typedefs

template<typename Value >
using kcenon::pacs::services::cache::string_lru_cache = simple_lru_cache<std::string, Value>
 String-keyed LRU cache for query results.
 

Detailed Description

Thread-safe LRU (Least Recently Used) cache for query results.

This file provides a template-based LRU cache implementation designed for caching DICOM query results. It supports configurable maximum size, TTL (Time-To-Live), and integrates with the PACS monitoring system for metrics.

The cache uses a combination of a doubly-linked list (for LRU ordering) and a hash map (for O(1) lookups) to achieve efficient cache operations.

See also
Issue #209 - [Quick Win] feat(services): Implement simple LRU query cache
Issue #189 - Implement LRU cache for query results
Author
kcenon
Since
1.0.0

Definition in file simple_lru_cache.h.