Type hierarchy within Clang.jl

freeman
Sun, 07 Aug 2022 23:02:42 +0000
New to Julia

I’m using Clang.jl to automatically generate julia wrappers over C structs, lets call them MyType1, MyType2, etc:

struct MyType1
    # generated by Clang.jl
end
struct MyType2
    # generated by Clang.jl
end

However, these are (as all concretes types by default) direct subtypes of Any. Instead I would like the generated types to be

abstract type AbstractMyType end
abstract type AbstractMyType1 <: AbstractMyType end
abstract type AbstractMyType2 <: AbstractMyType end
(...)
struct MyType1 <: AbstractMyType1
    # generated by Clang.jl
end
struct MyType2 <: AbstractMyType2
    # generated by Clang.jl
end

Is this possible?

2 posts - 2 participants