This is the mail archive of the java-discuss@sourceware.cygnus.com 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]

Re: instanceof in CNI


>> Is there anything similar to the Java instanceof operatior in C++/CNI?

Bryce> You can use _Jv_IsInstanceOf(object, class)

Usually we recommend only using "Jv" functions and not "_Jv_"
functions.  The former are exported and the latter are not.

I recommend using Class::isInstance.

Bryce> To get a reference to a Class object to compare against, you
Bryce> currently have to use Class::forName(), or compare against the
Bryce> mangled symbolic class name directly. This is something we're
Bryce> looking at addressing soon in gcjh.

Lately I've been thinking gcjh could generate a per-class inline
function named something like "$class"; I got this idea because
apparently javac generates an internal function named "class$" to
implement the ".class" notation.

Comments?  Naming here is the big problem, as I see it.

Tom

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