Skip to content

Can I extend a struct ? #586

Answered by saudet
gwenn asked this question in Q&A
Jun 25, 2022 · 2 comments · 5 replies
Discussion options

You must be logged in to vote

It sounds like we have to create a new type, and if that is the case, we need to provide an additional header file to JavaCPP for that, yes.

If you would like to be able to do that kind of thing from Java, JavaCPP already implements a mechanism for virtual methods in C++:
https://github.com/bytedeco/javacpp/wiki/Mapping-Recipes#dealing-with-abstract-classes-and-virtual-methods
So that means if you can figure out a way to map that to a standard C++ abstract class, JavaCPP can do the rest.

Replies: 2 comments 5 replies

Comment options

You must be logged in to vote
3 replies
@gwenn
Comment options

@saudet
Comment options

@saudet
Comment options

Answer selected by gwenn
Comment options

You must be logged in to vote
2 replies
@gwenn
Comment options

@saudet
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants