f90wrap icon indicating copy to clipboard operation
f90wrap copied to clipboard

Abstract classes

Open akshaysubr opened this issue 9 years ago • 2 comments
trafficstars

Looks like abstract classes are not parsed properly. The code snippet

type, abstract :: shapes
    integer :: shapetype = 0
end type

is parsed as type(abstract) instead of an abstract type(shapes). However, since this is an abstract class, the f90wrap_shapes__get__shapetype(this, shapetype) subroutine would probably have to be handled differently.

akshaysubr avatar Mar 20 '16 20:03 akshaysubr

If the abstract class is not required in Python, looks like moving f90wrap_shapes__get__shapetype(this, shapetype) to classes that extend the abstract class is sufficient. Maybe a pre-processor that copies everything in the abstract class to it's child class would be the easiest solution.

akshaysubr avatar Mar 20 '16 23:03 akshaysubr

That's correct, there's currently no support for any Fortran 2003 features. Mapping the abstract types to either standard Python classes or abstract base classes and then specifying the correct inheritance in the Python classes wrapped around the concrete Fortran derived types would be the best solution, and probably wouldn't be any more work than pre-processing.

jameskermode avatar Mar 21 '16 09:03 jameskermode