first comit

This commit is contained in:
drygrass
2025-11-18 23:41:04 +08:00
commit 89351183c3
13 changed files with 2376 additions and 0 deletions

22
KICachePolicy.h Normal file
View File

@@ -0,0 +1,22 @@
#pragma once
namespace KamaCache
{
template <typename Key, typename Value>
class KICachePolicy
{
public:
virtual ~KICachePolicy() {};
// 添加缓存接口
virtual void put(Key key, Value value) = 0;
// key是传入参数 访问到的值以传出参数的形式返回 | 访问成功返回true
virtual bool get(Key key, Value& value) = 0;
// 如果缓存中能找到key则直接返回value
virtual Value get(Key key) = 0;
};
} // namespace KamaCache