13USERVER_NAMESPACE_BEGIN
21 void InvalidateComponents();
26 using Callback = std::function<void()>;
27 using InvalidatorList = std::list<Callback>;
28 using InvalidatorHandle = InvalidatorList::iterator;
30 InvalidatorHandle RegisterComponentInvalidator(Callback&& callback);
32 void UnregisterComponentInvalidator(InvalidatorHandle handle)
noexcept;
35 InvalidatorList invalidators_;
43 void (T::*invalidate_method)())
45 [&component, invalidate_method] {
46 (component.*invalidate_method)();
49 std::is_base_of_v<components::LoggableComponentBase, T>,
50 "ComponentInvalidatorHolder can only be used with components");
63 std::function<
void()>&& callback);
66 ComponentControl::InvalidatorHandle invalidator_handle_;