From 1bc4e82b7d78010847907633c4a9cce40e4e7760 Mon Sep 17 00:00:00 2001 From: Thomas Krijnen Date: Mon, 17 Nov 2025 19:15:20 +0100 Subject: [PATCH] reorder --- .../schema_dependent/JsonSerializer.cpp | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/src/serializers/schema_dependent/JsonSerializer.cpp b/src/serializers/schema_dependent/JsonSerializer.cpp index 656112e6fe..7c7ee890d9 100644 --- a/src/serializers/schema_dependent/JsonSerializer.cpp +++ b/src/serializers/schema_dependent/JsonSerializer.cpp @@ -78,17 +78,6 @@ class get_type_visitor : public boost::static_visitor { } }; -// A function to be called recursively. Template specialization is used -// to descend into decomposition, containment and property relationships. -template -void descend(A* instance, json& tree, IfcUtil::IfcBaseEntity* parent = nullptr) { - if (instance->declaration().is(IfcSchema::IfcObjectDefinition::Class())) { - return descend(instance->template as(), tree, parent); - } else { - return format_entity_instance(instance, tree); - } -} - // Returns related entity instances using IFC's objectified relationship // model. The second and third argument require a member function pointer. template @@ -173,6 +162,18 @@ void format_entity_instance(IfcUtil::IfcBaseEntity* instance, json& tree, IfcUti tree.push_back(child); } + +// A function to be called recursively. Template specialization is used +// to descend into decomposition, containment and property relationships. +template +void descend(A* instance, json& tree, IfcUtil::IfcBaseEntity* parent = nullptr) { + if (instance->declaration().is(IfcSchema::IfcObjectDefinition::Class())) { + descend(instance->template as(), tree, parent); + } else { + format_entity_instance(instance, tree); + } +} + // @todo would be nice to generalize this with the XML version // // Descends into the tree by recursing into IfcRelContainedInSpatialStructure,