79class SecdistConfig
final {
83 std::chrono::milliseconds update_period{std::chrono::milliseconds::zero()};
87 explicit SecdistConfig(
const Settings& settings);
90 static std::size_t Register(std::function<std::any(
const formats::
json::Value&)>&& factory) {
91 return Register(std::move(factory));
95 const T& Get()
const {
96 return detail::SecdistModule<T>::Get(*
this);
102 static std::size_t Register(std::function<std::any(
const formats::
json::Value&)>&& factory);
103 const std::any& Get(
const std::type_index& type, std::size_t index)
const;
105 template <
typename T>
106 friend class detail::SecdistModule;
108 std::vector<std::any> configs_;
117 explicit Secdist(SecdistConfig::
Settings settings);
131 template <
typename Class>
134 std::string_view name,
135 void (Class::*func)(
const storages::
secdist::SecdistConfig& secdist)
138 bool IsPeriodicUpdateEnabled()
const;
141 using EventSource =
concurrent::AsyncEventSource<
const SecdistConfig&>;
144 DoUpdateAndListen(
concurrent::FunctionId id, std::string_view name, EventSource::Function&& func);
147 utils::FastPimpl<Impl, 1280, 16> impl_;