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.
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_typeis not accessible from a custom generator. This means the yaml config could contain a setting such assmart_ptr_type: boost::shared_ptrbut a custom generator would currently need to hard-code it again in the code it produces e.g.This is not ideal and can lead to drift between config and hard-coded elements in custom generators.