JNIpp 1.0
JNI meets C++
|
Wrapper for local Java objects. More...
Public Member Functions | |
LObject () | |
Constructs empty object. | |
LObject (const LObject &other) | |
Copies Java object from other , adds local reference. | |
virtual | ~LObject () |
Deletes local reference from contained Java object. | |
void | Swap (LObject &other) |
Swaps two instances. | |
virtual jobject | GetJObject () const |
Returns contained Java object. | |
LObject & | operator= (const LObject &other) |
Copies Java object from other , adds local reference. | |
bool | IsEmpty () const |
Returns true if object is empty (contains NULL Java object). | |
bool | operator! () const |
Checks if object is empty (contains NULL Java object). | |
operator ComparasionHelper * () const | |
Comparasion helper. | |
Static Public Member Functions | |
static LObject | Wrap (jobject object) |
Creates and returns LObject by adding a local reference to the object . | |
static LObject | WrapLocal (jobject object) |
Creates and returns LObject, but DOES NOT add local reference. |
Wrapper for local Java objects.
Local objects are returned from functions like jni::NewObject() or jni::CallObjectMethod(). They have local references added to them and are valid only within native method that created them. See 5.1.1 Local References in JNI specification.
LObjects are just safe containers for local objects on their way from jni functions to wrapper classes like java::Object or java::String.
LObject supports the following usages:
if (lobject)
if (!lobject)
if (lobject1==lobject2)
if (lobject1!=lobject2)
EmailValidator.h, LiveThread.cpp, LiveThread.h, NativeSound.cpp, and NativeSound.h.