Replace Boost function callbacks

Generated with the assistance of an AI coding tool.
This commit is contained in:
Thomas Krijnen
2026-08-08 16:28:47 +02:00
parent 99a09a2a3c
commit b706121f53
10 changed files with 20 additions and 27 deletions
+4 -3
View File
@@ -46,6 +46,7 @@
#include <algorithm>
#include <fstream>
#include <functional>
#include <iomanip>
#include <map>
#include <set>
@@ -1276,9 +1277,9 @@ std::vector<ifcopenshell::geom::filter_function> 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;
}
+4 -5
View File
@@ -25,8 +25,7 @@
#include "../ifcgeom/conversion_settings.h"
#include "../plugin/plugin.h"
#include <boost/function.hpp>
#include <functional>
#include <map>
#include <string>
#include <tuple>
@@ -41,10 +40,10 @@ namespace geom {
std::vector<express::base> 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<bool(const express::base&)> filter_function;
typedef std::function<bool(const express::base&)> filter_function;
class IFC_GEOM_API abstract_mapping {
protected:
@@ -80,7 +79,7 @@ namespace geom {
};
namespace impl {
typedef boost::function3<abstract_mapping*, ifcopenshell::file*, ifcopenshell::geom::settings&, ifcopenshell::logger&> mapping_fn;
typedef std::function<abstract_mapping*(ifcopenshell::file*, ifcopenshell::geom::settings&, ifcopenshell::logger&)> mapping_fn;
class IFC_GEOM_API mapping_registry {
public:
-1
View File
@@ -9,7 +9,6 @@
#include "../ifcgeom/abstract_kernel.h"
#include "../ifcgeom/element.h"
#include <boost/function.hpp>
#include <memory>
namespace ifcopenshell { namespace geom {
-1
View File
@@ -33,7 +33,6 @@
#include "../ifcgeom/abstract_mapping.h"
#include <boost/foreach.hpp>
#include <boost/function.hpp>
#include <boost/regex.hpp>
#include <boost/algorithm/string/replace.hpp>
#include <boost/algorithm/string/case_conv.hpp>
-2
View File
@@ -3,8 +3,6 @@
#include "../ifcgeom/taxonomy.h"
#include <boost/function.hpp>
namespace ifcopenshell { namespace geom {
/// @brief Computes a point on a helmert curve at s.
+2 -3
View File
@@ -23,8 +23,7 @@
#include "../ifcgeom/abstract_kernel.h"
#include "../plugin/plugin.h"
#include <boost/function.hpp>
#include <functional>
#include <map>
#include <memory>
#include <string>
@@ -43,7 +42,7 @@ namespace ifcopenshell {
class IFC_GEOM_API kernel_registry {
public:
typedef boost::function2<abstract_kernel*, ifcopenshell::file*, ifcopenshell::geom::settings&> create_fn;
typedef std::function<abstract_kernel*(ifcopenshell::file*, ifcopenshell::geom::settings&)> 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;
+3 -4
View File
@@ -7,8 +7,7 @@
#include "ifc_geomserialization_api.h"
#include <boost/function.hpp>
#include <functional>
#include <map>
#include <string>
@@ -21,8 +20,8 @@ namespace ifcopenshell {
namespace ifcopenshell::geom {
class IFC_GEOMSERIALIZATION_API opencascade_geometry_ifc_writer_registry {
public:
typedef boost::function3<express::base, ifcopenshell::file&, const conversion_result_shape&, double> tesselate_fn;
typedef boost::function3<express::base, ifcopenshell::file&, const conversion_result_shape&, bool> serialise_fn;
typedef std::function<express::base(ifcopenshell::file&, const conversion_result_shape&, double)> tesselate_fn;
typedef std::function<express::base(ifcopenshell::file&, const conversion_result_shape&, bool)> 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;
+2 -3
View File
@@ -23,8 +23,7 @@
#include "tree.h"
#include "../plugin/plugin.h"
#include <boost/function.hpp>
#include <functional>
#include <map>
#include <memory>
#include <string>
@@ -74,7 +73,7 @@ namespace ifcopenshell {
class IFC_GEOM_API tree_registry {
public:
typedef boost::function0<abstract_tree*> create_fn;
typedef std::function<abstract_tree*()> 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;
+2 -2
View File
@@ -25,7 +25,7 @@
#include "../ifcparse/file.h"
#include "../plugin/plugin.h"
#include <boost/function.hpp>
#include <functional>
#include <memory>
#include <filesystem>
@@ -64,7 +64,7 @@ struct SERIALIZERS_API document_serializer_context {
class SERIALIZERS_API document_serializer_registry {
public:
typedef boost::function<std::shared_ptr<serializer>(const document_serializer_context&)> create_fn;
typedef std::function<std::shared_ptr<serializer>(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;
+3 -3
View File
@@ -24,7 +24,7 @@
#include "../ifcgeom/geometry_serializer.h"
#include "../plugin/plugin.h"
#include <boost/function.hpp>
#include <functional>
#include <memory>
#include <filesystem>
@@ -61,8 +61,8 @@ struct SERIALIZERS_API geometry_serializer_context {
class SERIALIZERS_API geometry_serializer_registry {
public:
typedef boost::function<std::shared_ptr<geometry_serializer>(const geometry_serializer_context&)> create_fn;
typedef boost::function<void(geometry_serializer_context&)> configure_fn;
typedef std::function<std::shared_ptr<geometry_serializer>(const geometry_serializer_context&)> create_fn;
typedef std::function<void(geometry_serializer_context&)> 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;