22#include <boost/function.hpp>
54template<
typename Root,
typename Target,
58 static_assert(std::is_same_v<typename Target_ptr::element_type, std::add_const_t<Target>>,
59 "The `element_type` of `Target_ptr` must be `const Target`.");
98 template<
typename... S_d_value_set>
134template<
typename Root,
typename Target,
typename Target_ptr>
137 m_get_root_func(std::move(get_root_func_moved)),
138 m_root_to_target_func(std::move(root_to_target_func_moved))
142template<
typename Root,
typename Target,
typename Target_ptr>
143template<
typename... S_d_value_set>
146 size_t d_value_set_idx) :
147 m_get_root_func([&config_manager, d_value_set_idx]()
149 return config_manager.template dynamic_values<Root>(d_value_set_idx);
151 m_root_to_target_func(std::move(root_to_target_func_moved))
155template<
typename Root,
typename Target,
typename Target_ptr>
158 return m_get_root_func();
161template<
typename Root,
typename Target,
typename Target_ptr>
164 auto root = root_dynamic_cfg();
167 return Target_ptr(root, &(m_root_to_target_func(*root)));
Manages a config setup, intended for a single daemon process, by maintaining 1 or more set(s) of stat...
Class which facilitates managing access to a dynamic configuration.
const Root_to_target_func m_root_to_target_func
Translates a root configuration object to a contained target configuration object.
Target_ptr dynamic_cfg() const
Obtain the target configuration.
Root::Const_ptr root_dynamic_cfg() const
Obtain the root configuration.
Target_ptr Target_ptr_type
Type alias for Target_ptr.
const Get_root_func m_get_root_func
Called to obtain the root configuration.
Dynamic_cfg_context(Get_root_func &&get_root_func_moved, Root_to_target_func &&root_to_target_func_moved)
Constructor.
Flow module that facilitates configuring modules, such as applications and APIs, via statically and/o...