18 using TimePoint = std::chrono::time_point<std::chrono::steady_clock>;
45 void Add(std::string
const& key, TimePoint expiration);
52 void Remove(std::string
const& key);
70 void Add(DataKind kind, std::string
const& key, TimePoint expiration);
78 void Remove(DataKind kind, std::string
const& key);
88 std::string
const& key,
89 TimePoint current_time)
const;
102 std::vector<std::pair<std::optional<DataKind>, std::string>>
Prune(
103 TimePoint current_time);
106 using TtlMap = std::unordered_map<std::string, TimePoint>;
117 std::array<TaggedData<TtlMap>,
118 static_cast<std::underlying_type_t<DataKind>
>(
119 DataKind::kKindCount)>;
120 void Set(DataKind kind, std::string
const& key, TimePoint expiration);
121 void Remove(DataKind kind, std::string
const& key);
122 std::optional<TimePoint> Get(DataKind kind,
123 std::string
const& key)
const;
126 [[nodiscard]]
typename DataType::iterator begin();
128 [[nodiscard]]
typename DataType::iterator end();