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: Storing C++ data in an instance field using CNI?


>>>>> "Paul" == Paul Gear <paul@gear.dyndns.org> writes:

>> http://gcc.gnu.org/onlinedocs/gcj/Mixing-with-C--.html

Paul> One more question: I notice in the examples that the field is defined in
Paul> the C++ source instead of the Java source.  Is this the recommended best
Paul> practice, or is it simply up to personal preference?  My natural
Paul> inclination is to put as much as possible in the Java source and write
Paul> only the parts actually required in C++.

The normal practice is to declare all fields in Java, compile to
.class, and then in turn generate a C++ header file for your class
using gcjh.  This will generate the C++ class declaration for you,
including field declarations.

Tom


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