Skip to content

Supply additional parameters to custom generators #132

Description

@kwabenantim

Summary

Custom generators currently have access to a limited set of parameters such as the Python class name, but do not have access to other parameters commonly used to fill in placeholder strings during wrapper generation.

For example, the configured smart_ptr_type is not accessible from a custom generator. This means the yaml config could contain a setting such as smart_ptr_type: boost::shared_ptr but a custom generator would currently need to hard-code it again in the code it produces e.g.

def get_class_cpp_def_code(self, class_name):
  code = f"""
  .def("Foo",
    (std::vector<Bar>({class_name}::*)(boost::shared_ptr<Jaz>))
  ...
"""

This is not ideal and can lead to drift between config and hard-coded elements in custom generators.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions