23#include <boost/function.hpp>
55template<
typename Root,
typename Target,
59 static_assert(std::is_same_v<typename Target_ptr::element_type, std::add_const_t<Target>>,
60 "The `element_type` of `Target_ptr` must be `const Target`.");
99 template<
typename... S_d_value_set>
135template<
typename Root,
typename Target,
typename Target_ptr>
138 m_get_root_func(std::move(get_root_func_moved)),
139 m_root_to_target_func(std::move(root_to_target_func_moved))
143template<
typename Root,
typename Target,
typename Target_ptr>
144template<
typename... S_d_value_set>
147 size_t d_value_set_idx) :
148 m_get_root_func([&config_manager, d_value_set_idx]()
149 {
return config_manager.template dynamic_values<Root>(d_value_set_idx); }),
150 m_root_to_target_func(std::move(root_to_target_func_moved))
154template<
typename Root,
typename Target,
typename Target_ptr>
157 return m_get_root_func();
160template<
typename Root,
typename Target,
typename Target_ptr>
163 auto root = root_dynamic_cfg();
166 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...