This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Integration with C


>>>>> "Geert" == Geert Bevin <gbevin at uwyn dot com> writes:

>> class Callback
>> {
>> RawData method;

Geert> I see how this would work, but my main question is how do you
Geert> get the function point in the method variable. Here you only
Geert> use it, you never provide it.

  obj->method = (RawData) fnptr;

Geert> Since the interface needs to be declared in java as being
Geert> native, there's no way to write a method that takes a function
Geert> pointer argument, is there?

You have to do some of the work in C++.  There's no way around that.
I think I'm not understanding your question though.

Geert> Would it be possible to derive the Callback class in C++ alone
Geert> and add a setCallback(fptr callback) method?

You can't derive a C++ class from a Java class.  You have to at least
write the class declaration in Java.  That's a limitation of our
implementation -- the C++ compiler doesn't know how to create a Java
Class object.

Tom


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]