bytedeco / javacpp

The missing bridge between Java and native C++
Other
4.43k stars 576 forks source link

Parser doesn't add @Virtual annotations #743

Closed iexavl closed 5 months ago

iexavl commented 5 months ago

So I need to make some callbacks from C++ side to java side and in my case the best way to do it is with a C++ class which is parsed into java, instantiated in java and has some of it methods overriden. The thing is though every time I parse the header the @Virtual annotations on the methods disappear and I have to manually add them again. Is there a way to tell the parser to add those @Virtual annotations automatically to all virtual methods?

iexavl commented 5 months ago

Found the answer here: https://github.com/bytedeco/javacpp/wiki/Mapping-Recipes . I think it might not be a bad idea to put it in the introduction though, because the way it's said there it kind of makes it sound like it has to be done by hand.

saudet commented 5 months ago

We can of course use them manually too. That's how it's designed, that's perfectly fine.