75class SecdistConfig
final {
79 std::chrono::milliseconds update_period{std::chrono::milliseconds::zero()};
83 explicit SecdistConfig(
const Settings& settings);
86 static std::size_t Register(std::function<std::any(
const formats::json::
Value&)>&& factory) {
87 return Register(std::move(factory));
91 const T& Get()
const {
92 return detail::SecdistModule<T>::Get(*
this);
96 void Init(
const formats::json::
Value& doc);
98 static std::size_t Register(std::function<std::any(
const formats::json::
Value&)>&& factory);
99 const std::any& Get(
const std::type_index& type, std::size_t index)
const;
101 template <
typename T>
102 friend class detail::SecdistModule;
104 std::vector<std::any> configs_;
113 explicit Secdist(SecdistConfig::
Settings settings);
127 template <
typename Class>
130 std::string_view name,
131 void (Class::*func)(
const storages::
secdist::SecdistConfig& secdist)
134 bool IsPeriodicUpdateEnabled()
const;
137 using EventSource =
concurrent::AsyncEventSource<
const SecdistConfig&>;
139 concurrent::AsyncEventSubscriberScope DoUpdateAndListen(
141 std::string_view name,
142 EventSource::Function&& func
146 utils::FastPimpl<Impl, 1280, 16> impl_;