list_model.h: retire 'update_list_model_from_xml'

This transition vehicle to the modern interface has now been replaced by
the new 'List_model::update_from_xml' method.

Issue #4317
This commit is contained in:
Norman Feske 2023-10-28 12:22:54 +02:00 committed by Christian Helmuth
parent b9b2a7de34
commit 0f686a774d
25 changed files with 44 additions and 59 deletions

View File

@ -214,19 +214,4 @@ void Genode::List_model<ELEM>::update_from_xml(Xml_node const &node,
_elements = updated_list;
}
namespace Genode {
template <typename CREATE_FN, typename DESTROY_FN, typename UPDATE_FN,
typename NODE = decltype(CREATE_FN())>
static inline void update_list_model_from_xml(List_model<NODE> &model,
Xml_node const &node,
CREATE_FN const &create_fn,
DESTROY_FN const &destroy_fn,
UPDATE_FN const &update_fn)
{
model.update_from_xml(node, create_fn, destroy_fn, update_fn);
}
}
#endif /* _INCLUDE__UTIL__LIST_MODEL_H_ */

View File

@ -46,7 +46,7 @@ void Config_model::update(genode_wg_config_callbacks &callbacks,
callbacks.add_device(_config->listen_port, private_key);
}
update_list_model_from_xml(_peers, node,
_peers.update_from_xml(node,
/* create */
[&] (Xml_node const &node) -> Peer &

View File

@ -54,7 +54,7 @@ class Depot_deploy::Children
void apply_config(Xml_node config)
{
update_list_model_from_xml(_children, config,
_children.update_from_xml(config,
[&] (Xml_node const &node) -> Child & {
return *new (_alloc)

View File

@ -45,7 +45,7 @@ class Depot_deploy::Children
{
bool progress = false;
update_list_model_from_xml(_children, config,
_children.update_from_xml(config,
/* create */
[&] (Xml_node const &node) -> Child & {

View File

@ -163,7 +163,7 @@ struct Depot_download_manager::Main
{
_installation.update();
update_list_model_from_xml(_jobs, _installation.xml(),
_jobs.update_from_xml(_installation.xml(),
/* create */
[&] (Xml_node const &node) -> Job & {
@ -211,7 +211,7 @@ struct Depot_download_manager::Main
bool visible_progress = false;
update_list_model_from_xml(_fetchurl_downloads, _fetchurl_progress.xml(),
_fetchurl_downloads.update_from_xml(_fetchurl_progress.xml(),
/* create */
[&] (Xml_node const &node) -> Download & {

View File

@ -469,7 +469,7 @@ struct Menu_view::Depgraph_widget : Widget
{
Allocator &alloc = _factory.alloc;
update_list_model_from_xml(_children, node,
_children.update_from_xml(node,
/* create */
[&] (Xml_node const &node) -> Widget &

View File

@ -49,7 +49,7 @@ struct Menu_view::Label_widget : Widget, Cursor::Glyph_position
void _update_children(Xml_node const &node)
{
update_list_model_from_xml(_cursors, node,
_cursors.update_from_xml(node,
/* create */
[&] (Xml_node const &node) -> Cursor & {
@ -64,7 +64,7 @@ struct Menu_view::Label_widget : Widget, Cursor::Glyph_position
cursor.update(node); }
);
update_list_model_from_xml(_selections, node,
_selections.update_from_xml(node,
/* create */
[&] (Xml_node const &node) -> Text_selection & {

View File

@ -128,7 +128,7 @@ class Menu_view::Widget : List_model<Widget>::Element
inline void _update_children(Xml_node node)
{
update_list_model_from_xml(_children, node,
_children.update_from_xml(node,
/* create */
[&] (Xml_node const &node) -> Widget & {

View File

@ -71,7 +71,7 @@ struct Sculpt::Component : Noncopyable
void _update_routes_from_xml(Xml_node const &node)
{
update_list_model_from_xml(routes, node,
routes.update_from_xml(node,
/* create */
[&] (Xml_node const &route) -> Route & {

View File

@ -68,7 +68,7 @@ class Sculpt::Launchers : public Noncopyable
void update_from_xml(Xml_node const &launchers)
{
update_list_model_from_xml(_launchers, launchers,
_launchers.update_from_xml(launchers,
/* create */
[&] (Xml_node const &node) -> Launcher & {

View File

@ -92,7 +92,7 @@ class Sculpt::Presets : public Noncopyable
void update_from_xml(Xml_node const &presets)
{
update_list_model_from_xml(_presets, presets,
_presets.update_from_xml(presets,
/* create */
[&] (Xml_node const &node) -> Preset & {

View File

@ -256,7 +256,7 @@ class Sculpt::Runtime_config
node.with_optional_sub_node("route", [&] (Xml_node route) {
update_list_model_from_xml(deps, route,
deps.update_from_xml(route,
/* create */
[&] (Xml_node const &node) -> Dep & {
@ -272,7 +272,7 @@ class Sculpt::Runtime_config
node.with_optional_sub_node("provides", [&] (Xml_node provides) {
update_list_model_from_xml(_child_services, provides,
_child_services.update_from_xml(provides,
/* create */
[&] (Xml_node const &node) -> Child_service & {
@ -364,7 +364,7 @@ class Sculpt::Runtime_config
void update_from_xml(Xml_node config)
{
update_list_model_from_xml(_components, config,
_components.update_from_xml(config,
/* create */
[&] (Xml_node const &node) -> Component & {

View File

@ -228,7 +228,7 @@ class Sculpt::Runtime_state : public Runtime_info
void update_from_state_report(Xml_node state)
{
update_list_model_from_xml(_children, state,
_children.update_from_xml(state,
/* create */
[&] (Xml_node const &node) -> Child & {

View File

@ -54,7 +54,7 @@ struct Sculpt::Storage_device
void _update_partitions_from_xml(Xml_node const &node)
{
update_list_model_from_xml(partitions, node,
partitions.update_from_xml(node,
/* create */
[&] (Xml_node const &node) -> Partition & {

View File

@ -37,7 +37,7 @@ struct Sculpt::Storage_devices
void update_block_devices_from_xml(Env &env, Allocator &alloc, Xml_node node,
Signal_context_capability sigh)
{
update_list_model_from_xml(block_devices, node,
block_devices.update_from_xml(node,
/* create */
[&] (Xml_node const &node) -> Block_device & {
@ -72,7 +72,7 @@ struct Sculpt::Storage_devices
bool device_added_or_vanished = false;
update_list_model_from_xml(usb_storage_devices, node,
usb_storage_devices.update_from_xml(node,
/* create */
[&] (Xml_node const &node) -> Usb_storage_device &

View File

@ -127,7 +127,7 @@ void Sculpt::Network::_handle_wlan_accesspoints()
if (!initial_scan && dialog.ap_list_hovered())
return;
update_list_model_from_xml(_access_points, _wlan_accesspoints_rom.xml(),
_access_points.update_from_xml(_wlan_accesspoints_rom.xml(),
/* create */
[&] (Xml_node const &node) -> Access_point &

View File

@ -120,7 +120,7 @@ struct Touch_keyboard::Dialog : private Dynamic_rom_session::Xml_producer
void update(Xml_node const &row)
{
update_list_model_from_xml(keys, row,
keys.update_from_xml(row,
/* create */
[&] (Xml_node const &node) -> Key & {
@ -154,7 +154,7 @@ struct Touch_keyboard::Dialog : private Dynamic_rom_session::Xml_producer
void update(Xml_node const &map)
{
update_list_model_from_xml(rows, map,
rows.update_from_xml(map,
/* create */
[&] (Xml_node const &node) -> Row & {
@ -187,7 +187,7 @@ struct Touch_keyboard::Dialog : private Dynamic_rom_session::Xml_producer
{
_default_key_min_ex = config.attribute_value("key_min_ex", 0U);
update_list_model_from_xml(_maps, config,
_maps.update_from_xml(config,
/* create */
[&] (Xml_node const &node) -> Map & {

View File

@ -35,7 +35,7 @@ class Window_layouter::Assign_list : Noncopyable
void update_from_xml(Xml_node node)
{
update_list_model_from_xml(_assignments, node,
_assignments.update_from_xml(node,
[&] (Xml_node const &node) -> Assign & {
return *new (_alloc) Assign(node); },

View File

@ -50,7 +50,7 @@ class Window_layouter::Window_list
_rom.update();
/* import window-list changes */
update_list_model_from_xml(_list, _rom.xml(),
_list.update_from_xml(_rom.xml(),
[&] (Xml_node const &node) -> Window &
{

View File

@ -192,7 +192,7 @@ void Decorator::Window_stack::update_model(Genode::Xml_node root_node,
{
Abandoned_windows _abandoned_windows { };
update_list_model_from_xml(_windows, root_node,
_windows.update_from_xml(root_node,
[&] (Xml_node const &node) -> Window_base & {
return *_window_factory.create(node); },

View File

@ -491,7 +491,7 @@ Main::Main(Env & env) : env(env)
if (apic_capable) {
update_list_model_from_xml(irq_override_list, xml,
irq_override_list.update_from_xml(xml,
/* create */
[&] (Xml_node const &node) -> Irq_override &
@ -509,7 +509,7 @@ Main::Main(Env & env) : env(env)
[&] (Irq_override &, Xml_node const &) { }
);
update_list_model_from_xml(irq_routing_list, xml,
irq_routing_list.update_from_xml(xml,
/* create */
[&] (Xml_node const &node) -> Irq_routing &
@ -530,7 +530,7 @@ Main::Main(Env & env) : env(env)
);
}
update_list_model_from_xml(reserved_memory_list, xml,
reserved_memory_list.update_from_xml(xml,
/* create */
[&] (Xml_node const &node) -> Rmrr &

View File

@ -188,7 +188,7 @@ void Driver::Device::update(Allocator &alloc, Xml_node const &node)
{
using Bar = Device::Pci_bar;
update_list_model_from_xml(_irq_list, node,
_irq_list.update_from_xml(node,
/* create */
[&] (Xml_node const &node) -> Irq &
@ -219,7 +219,7 @@ void Driver::Device::update(Allocator &alloc, Xml_node const &node)
[&] (Irq &, Xml_node const &) { }
);
update_list_model_from_xml(_io_mem_list, node,
_io_mem_list.update_from_xml(node,
/* create */
[&] (Xml_node const &node) -> Io_mem &
@ -241,7 +241,7 @@ void Driver::Device::update(Allocator &alloc, Xml_node const &node)
[&] (Io_mem &, Xml_node const &) { }
);
update_list_model_from_xml(_io_port_range_list, node,
_io_port_range_list.update_from_xml(node,
/* create */
[&] (Xml_node const &node) -> Io_port_range &
@ -262,7 +262,7 @@ void Driver::Device::update(Allocator &alloc, Xml_node const &node)
[&] (Io_port_range &, Xml_node const &) { }
);
update_list_model_from_xml(_property_list, node,
_property_list.update_from_xml(node,
/* create */
[&] (Xml_node const &node) -> Property &
@ -279,7 +279,7 @@ void Driver::Device::update(Allocator &alloc, Xml_node const &node)
[&] (Property &, Xml_node const &) { }
);
update_list_model_from_xml(_clock_list, node,
_clock_list.update_from_xml(node,
/* create */
[&] (Xml_node const &node) -> Clock &
@ -298,7 +298,7 @@ void Driver::Device::update(Allocator &alloc, Xml_node const &node)
[&] (Clock &, Xml_node const &) { }
);
update_list_model_from_xml(_power_domain_list, node,
_power_domain_list.update_from_xml(node,
/* create */
[&] (Xml_node const &node) -> Power_domain &
@ -314,7 +314,7 @@ void Driver::Device::update(Allocator &alloc, Xml_node const &node)
[&] (Power_domain &, Xml_node const &) { }
);
update_list_model_from_xml(_reset_domain_list, node,
_reset_domain_list.update_from_xml(node,
/* create */
[&] (Xml_node const &node) -> Reset_domain &
@ -330,7 +330,7 @@ void Driver::Device::update(Allocator &alloc, Xml_node const &node)
[&] (Reset_domain &, Xml_node const &) { }
);
update_list_model_from_xml(_pci_config_list, node,
_pci_config_list.update_from_xml(node,
/* create */
[&] (Xml_node const &node) -> Pci_config &
@ -365,7 +365,7 @@ void Driver::Device::update(Allocator &alloc, Xml_node const &node)
[&] (Pci_config &, Xml_node const &) { }
);
update_list_model_from_xml(_reserved_mem_list, node,
_reserved_mem_list.update_from_xml(node,
/* create */
[&] (Xml_node const &node) -> Reserved_memory &
@ -382,7 +382,7 @@ void Driver::Device::update(Allocator &alloc, Xml_node const &node)
[&] (Reserved_memory &, Xml_node const &) { }
);
update_list_model_from_xml(_io_mmu_list, node,
_io_mmu_list.update_from_xml(node,
/* create */
[&] (Xml_node const &node) -> Io_mmu &
@ -429,7 +429,7 @@ void Driver::Device_model::generate(Xml_generator & xml) const
void Driver::Device_model::update(Xml_node const & node)
{
update_list_model_from_xml(_model, node,
_model.update_from_xml(node,
/* create */
[&] (Xml_node const &node) -> Device &

View File

@ -385,7 +385,7 @@ void Config_model::update_from_xml(Xml_node const &xml,
auto update = [&] (Node &node, Xml_node const &xml) { node.update(xml); };
try {
update_list_model_from_xml(_model, xml, create, destroy, update);
_model.update_from_xml(xml, create, destroy, update);
}
catch (Unknown_element_type) {
error("unable to apply complete configuration"); }
@ -405,7 +405,7 @@ void Config_model::apply_children_restart(Xml_node const &xml)
};
try {
update_list_model_from_xml(_model, xml, create, destroy, update);
_model.update_from_xml(xml, create, destroy, update);
}
catch (...) { };
}

View File

@ -102,7 +102,7 @@ struct Sandbox::Parent_provides_model : Noncopyable
auto update = [&] (Node &, Xml_node const &) { };
try {
update_list_model_from_xml(_model, xml, create, destroy, update);
_model.update_from_xml(xml, create, destroy, update);
} catch (...) {
error("unable to apply complete configuration");
}

View File

@ -61,7 +61,7 @@ void Vmm::Config::update(Xml_node node)
_cpu_count = 1;
}
update_list_model_from_xml(_model, node,
_model.update_from_xml(node,
/* create */
[&] (Xml_node const &node) -> Virtio_device &