Files
KamaCache/KICachePolicy.h
2025-11-18 23:41:04 +08:00

22 lines
486 B
C++
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#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