diff --git a/cppwg/input/info_helper.py b/cppwg/input/info_helper.py index b2883d8..4b4f387 100644 --- a/cppwg/input/info_helper.py +++ b/cppwg/input/info_helper.py @@ -139,7 +139,8 @@ def extract_templates_from_source(self, feature_info: BaseInfo) -> None: template_params = [] for tp in template_substitution["signature"].split(","): template_params.append( - tp.replace("<", "") + tp.strip() + .replace("<", "") .replace(">", "") .split(" ")[1] .split("=")[0] diff --git a/cppwg/writers/class_writer.py b/cppwg/writers/class_writer.py index 0f1fbba..0999a29 100644 --- a/cppwg/writers/class_writer.py +++ b/cppwg/writers/class_writer.py @@ -336,11 +336,6 @@ def write(self, work_dir: str) -> None: for member_function in class_decl.member_functions( function=query, allow_empty=True ): - if self.class_info.excluded_methods: - # Skip excluded methods - if member_function.name in self.class_info.excluded_methods: - continue - method_writer = CppMethodWrapperWriter( self.class_info, idx, diff --git a/cppwg/writers/method_writer.py b/cppwg/writers/method_writer.py index 3d4d621..6309c2b 100644 --- a/cppwg/writers/method_writer.py +++ b/cppwg/writers/method_writer.py @@ -65,7 +65,12 @@ def exclude(self) -> bool: bool True if the method should be excluded, False otherwise """ - # Exclude private methods without over-rides + # Skip methods marked for exclusion + if self.class_info.excluded_methods: + if self.method_decl.name in self.class_info.excluded_methods: + return True + + # Exclude private methods if self.method_decl.access_type == "private": return True @@ -220,8 +225,8 @@ def generate_virtual_override_wrapper(self) -> str: str The virtual override wrapper code. """ - # Skip private methods - if self.method_decl.access_type == "private": + # Skip excluded methods + if self.exclude(): return "" # Get list of arguments and types diff --git a/examples/shapes/src/mesh/AbstractMesh.cpp b/examples/shapes/src/mesh/AbstractMesh.cpp index d03d193..7f6ec65 100644 --- a/examples/shapes/src/mesh/AbstractMesh.cpp +++ b/examples/shapes/src/mesh/AbstractMesh.cpp @@ -22,5 +22,10 @@ void AbstractMesh::SetIndex(unsigned index) mIndex = index; } +template +void AbstractMesh::AddVertex(Point vertex) +{ +} + template class AbstractMesh<2, 2>; template class AbstractMesh<3, 3>; diff --git a/examples/shapes/src/mesh/AbstractMesh.hpp b/examples/shapes/src/mesh/AbstractMesh.hpp index 83cf7de..4ccbae6 100644 --- a/examples/shapes/src/mesh/AbstractMesh.hpp +++ b/examples/shapes/src/mesh/AbstractMesh.hpp @@ -1,6 +1,8 @@ #ifndef _ABSTRACT_MESH_HPP #define _ABSTRACT_MESH_HPP +#include "Point.hpp" + /** * A mesh in SPACE_DIM space with ELEMENT_DIM dimensional elements */ @@ -34,6 +36,11 @@ class AbstractMesh */ void SetIndex(unsigned index); + /** + * Add a vertex to the mesh + */ + void AddVertex(Point vertex); + /** * Scale the mesh by a factor */ diff --git a/examples/shapes/wrapper/mesh/AbstractMesh2_2.cppwg.cpp b/examples/shapes/wrapper/mesh/AbstractMesh2_2.cppwg.cpp index 8706232..cf6e523 100644 --- a/examples/shapes/wrapper/mesh/AbstractMesh2_2.cppwg.cpp +++ b/examples/shapes/wrapper/mesh/AbstractMesh2_2.cppwg.cpp @@ -31,6 +31,10 @@ py::class_)) &AbstractMesh2_2::AddVertex, + " " , py::arg("vertex") ) .def( "Scale", (void(AbstractMesh2_2::*)(double const)) &AbstractMesh2_2::Scale, diff --git a/examples/shapes/wrapper/mesh/AbstractMesh3_3.cppwg.cpp b/examples/shapes/wrapper/mesh/AbstractMesh3_3.cppwg.cpp index a5eea68..c4e8c00 100644 --- a/examples/shapes/wrapper/mesh/AbstractMesh3_3.cppwg.cpp +++ b/examples/shapes/wrapper/mesh/AbstractMesh3_3.cppwg.cpp @@ -31,6 +31,10 @@ py::class_)) &AbstractMesh3_3::AddVertex, + " " , py::arg("vertex") ) .def( "Scale", (void(AbstractMesh3_3::*)(double const)) &AbstractMesh3_3::Scale,