From b706121f539c6221c7923caea9556b8c25b3311b Mon Sep 17 00:00:00 2001 From: Thomas Krijnen Date: Sat, 8 Aug 2026 16:28:47 +0200 Subject: [PATCH] Replace Boost function callbacks Generated with the assistance of an AI coding tool. --- src/ifcconvert/IfcConvert.cpp | 7 ++++--- src/ifcgeom/abstract_mapping.h | 9 ++++----- src/ifcgeom/converter.h | 1 - src/ifcgeom/filter.h | 1 - src/ifcgeom/function_item_evaluator.h | 2 -- src/ifcgeom/kernel_registry.h | 5 ++--- src/ifcgeom/serialization/serialization.h | 7 +++---- src/ifcgeom/tree_registry.h | 5 ++--- src/serializers/document_serializer_plugin.h | 4 ++-- src/serializers/geometry_serializer_plugin.h | 6 +++--- 10 files changed, 20 insertions(+), 27 deletions(-) diff --git a/src/ifcconvert/IfcConvert.cpp b/src/ifcconvert/IfcConvert.cpp index 9eb639b184..170066e133 100644 --- a/src/ifcconvert/IfcConvert.cpp +++ b/src/ifcconvert/IfcConvert.cpp @@ -46,6 +46,7 @@ #include #include +#include #include #include #include @@ -1276,9 +1277,9 @@ std::vector setup_filters(const std::vector entity_filter.entity_names = entities; } - if (!layer_filter.values.empty()) { filter_funcs.push_back(boost::ref(layer_filter)); } - if (!entity_filter.entity_names.empty()) { filter_funcs.push_back(boost::ref(entity_filter)); } - if (!attribute_filter.values.empty()) { filter_funcs.push_back(boost::ref(attribute_filter)); } + if (!layer_filter.values.empty()) { filter_funcs.push_back(std::ref(layer_filter)); } + if (!entity_filter.entity_names.empty()) { filter_funcs.push_back(std::ref(entity_filter)); } + if (!attribute_filter.values.empty()) { filter_funcs.push_back(std::ref(attribute_filter)); } return filter_funcs; } diff --git a/src/ifcgeom/abstract_mapping.h b/src/ifcgeom/abstract_mapping.h index ca0e15e005..fd33c694c0 100644 --- a/src/ifcgeom/abstract_mapping.h +++ b/src/ifcgeom/abstract_mapping.h @@ -25,8 +25,7 @@ #include "../ifcgeom/conversion_settings.h" #include "../plugin/plugin.h" -#include - +#include #include #include #include @@ -41,10 +40,10 @@ namespace geom { std::vector products; }; - /// The filter function (free or member function) or function object (use boost::ref() to reference to it) + /// The filter function (free or member function) or function object (use std::ref() to reference to it) /// should return true if the geometry for the product is wanted to be included in the output. /// http://www.boost.org/doc/libs/1_62_0/doc/html/function/tutorial.html - typedef boost::function filter_function; + typedef std::function filter_function; class IFC_GEOM_API abstract_mapping { protected: @@ -80,7 +79,7 @@ namespace geom { }; namespace impl { - typedef boost::function3 mapping_fn; + typedef std::function mapping_fn; class IFC_GEOM_API mapping_registry { public: diff --git a/src/ifcgeom/converter.h b/src/ifcgeom/converter.h index e2567ae25e..7a97f6ffa4 100644 --- a/src/ifcgeom/converter.h +++ b/src/ifcgeom/converter.h @@ -9,7 +9,6 @@ #include "../ifcgeom/abstract_kernel.h" #include "../ifcgeom/element.h" -#include #include namespace ifcopenshell { namespace geom { diff --git a/src/ifcgeom/filter.h b/src/ifcgeom/filter.h index 48d8fa234f..7aba6175cf 100644 --- a/src/ifcgeom/filter.h +++ b/src/ifcgeom/filter.h @@ -33,7 +33,6 @@ #include "../ifcgeom/abstract_mapping.h" #include -#include #include #include #include diff --git a/src/ifcgeom/function_item_evaluator.h b/src/ifcgeom/function_item_evaluator.h index d0def47a1b..88238239f2 100644 --- a/src/ifcgeom/function_item_evaluator.h +++ b/src/ifcgeom/function_item_evaluator.h @@ -3,8 +3,6 @@ #include "../ifcgeom/taxonomy.h" -#include - namespace ifcopenshell { namespace geom { /// @brief Computes a point on a helmert curve at s. diff --git a/src/ifcgeom/kernel_registry.h b/src/ifcgeom/kernel_registry.h index fc1aed374a..4cdc2b1d75 100644 --- a/src/ifcgeom/kernel_registry.h +++ b/src/ifcgeom/kernel_registry.h @@ -23,8 +23,7 @@ #include "../ifcgeom/abstract_kernel.h" #include "../plugin/plugin.h" -#include - +#include #include #include #include @@ -43,7 +42,7 @@ namespace ifcopenshell { class IFC_GEOM_API kernel_registry { public: - typedef boost::function2 create_fn; + typedef std::function create_fn; void bind(const kernel_info& info, create_fn create, const ifcopenshell::plugin::module& module = ifcopenshell::plugin::module()); bool has(const std::string& backend_id) const; diff --git a/src/ifcgeom/serialization/serialization.h b/src/ifcgeom/serialization/serialization.h index 68b30c053b..37d93098e7 100644 --- a/src/ifcgeom/serialization/serialization.h +++ b/src/ifcgeom/serialization/serialization.h @@ -7,8 +7,7 @@ #include "ifc_geomserialization_api.h" -#include - +#include #include #include @@ -21,8 +20,8 @@ namespace ifcopenshell { namespace ifcopenshell::geom { class IFC_GEOMSERIALIZATION_API opencascade_geometry_ifc_writer_registry { public: - typedef boost::function3 tesselate_fn; - typedef boost::function3 serialise_fn; + typedef std::function tesselate_fn; + typedef std::function serialise_fn; void bind(const std::string& schema_name, serialise_fn serialise, tesselate_fn tesselate, const ifcopenshell::plugin::module& module = ifcopenshell::plugin::module()); express::base tesselate(ifcopenshell::file& f, const conversion_result_shape& shape, double deflection) const; diff --git a/src/ifcgeom/tree_registry.h b/src/ifcgeom/tree_registry.h index de431ef22c..47d628fb6f 100644 --- a/src/ifcgeom/tree_registry.h +++ b/src/ifcgeom/tree_registry.h @@ -23,8 +23,7 @@ #include "tree.h" #include "../plugin/plugin.h" -#include - +#include #include #include #include @@ -74,7 +73,7 @@ namespace ifcopenshell { class IFC_GEOM_API tree_registry { public: - typedef boost::function0 create_fn; + typedef std::function create_fn; void bind(const tree_info& info, create_fn create, const ifcopenshell::plugin::module& module = ifcopenshell::plugin::module()); bool has(const std::string& backend_id) const; diff --git a/src/serializers/document_serializer_plugin.h b/src/serializers/document_serializer_plugin.h index b79c4c1f9c..621a7578e5 100644 --- a/src/serializers/document_serializer_plugin.h +++ b/src/serializers/document_serializer_plugin.h @@ -25,7 +25,7 @@ #include "../ifcparse/file.h" #include "../plugin/plugin.h" -#include +#include #include #include @@ -64,7 +64,7 @@ struct SERIALIZERS_API document_serializer_context { class SERIALIZERS_API document_serializer_registry { public: - typedef boost::function(const document_serializer_context&)> create_fn; + typedef std::function(const document_serializer_context&)> create_fn; void bind(const document_serializer_info& info, create_fn create, const ifcopenshell::plugin::module& module = ifcopenshell::plugin::module()); const document_serializer_info* find(const std::string& format, const std::string& schema_name = std::string()) const; diff --git a/src/serializers/geometry_serializer_plugin.h b/src/serializers/geometry_serializer_plugin.h index 938b504074..240bad74f6 100644 --- a/src/serializers/geometry_serializer_plugin.h +++ b/src/serializers/geometry_serializer_plugin.h @@ -24,7 +24,7 @@ #include "../ifcgeom/geometry_serializer.h" #include "../plugin/plugin.h" -#include +#include #include #include @@ -61,8 +61,8 @@ struct SERIALIZERS_API geometry_serializer_context { class SERIALIZERS_API geometry_serializer_registry { public: - typedef boost::function(const geometry_serializer_context&)> create_fn; - typedef boost::function configure_fn; + typedef std::function(const geometry_serializer_context&)> create_fn; + typedef std::function configure_fn; void bind(const geometry_serializer_info& info, create_fn create, configure_fn configure = configure_fn(), const ifcopenshell::plugin::module& module = ifcopenshell::plugin::module()); bool has(const std::string& extension) const;