Skip to content

Automatically add type-caster includes #95

Description

@kwabenantim

Summary

Custom type-caster headers (e.g. for PETSc, VTK and Ublas types) currently need to be added in manually per class via source_includes in the yaml configuration file. If a class uses a type that needs translating by a type-caster, forgetting to include the relevant header in config results in runtime errors.

It would make configuration easier if we could detect which classes need type-casters and automatically include the relevant header. For example, we could provide a config key to describe which type-caster headers are required for certain types:

typecasters:
  - header: caster_petsc.h
    types: [Vec, Mat]
  - header: PybindVTKTypeCaster.h
    types: [vtkSmartPointer, vtkObject]
  - header: PybindUblasTypeCaster.hpp
    types: ["boost::numeric::ublas::c_vector"]

If a class has any methods which have one or more of these types in args, the relevant type-caster header should be included in its wrapper automatically.

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