Main Page | Modules | Class Hierarchy | Class List | Directories | File List | Class Members | Related Pages

xmog_java_ref Class Reference

The wrapper base type representing C++ proxy instances for Java objects. More...

#include <xmog_java_ref.h>

Inheritance diagram for xmog_java_ref:

Inheritance graph
[legend]
Collaboration diagram for xmog_java_ref:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 xmog_java_ref ()
 The default constructor.
 xmog_java_ref (const xmog_null &)
 The from null constructor.
 xmog_java_ref (xmog_java_array *_arr, jint _index)
 The array element constructor.
 xmog_java_ref (xmog_java_class *_clazz, xmog_java_dynamic *_dynamic, xmog_flags _flags)
 The constructor that allows the dynamic resolution of class-related information.
 xmog_java_ref (xmog_base *_delegate, bool _owns_delegate=true)
 The constructor that allows the creation of an instance to handle all requests by delegating to another instance.
 xmog_java_ref (xmog_java_ref *_ref, xmog_java_dynamic *_dynamic, xmog_flags _flags)
 The constructor that allows the dynamic resolution of instance-related information.
 xmog_java_ref (jobject _local, xmog_flags _flags)
 The constructor that sets an existing JNI reference into a wrapper instance.
 ~xmog_java_ref ()
 Deletes the reference we hold to the wrapped Java instance.
bool operator== (const xmog_null &) const
 Compares the instance for equality with null.
bool operator== (const xmog_java_ref &) const
 Compares the instance for equality with another instance.
bool operator!= (const xmog_null &) const
 Compares the instance for inequality with null.
bool operator!= (const xmog_java_ref &) const
 Compares the instance for inequality with another instance.
bool operator! () const
 Returns true if the instance refers to null, false otherwise.
jboolean xmog_equals (const xmog_java_ref &_rhs, xmog_localenv *env=NULL)
 Returns true if both instances are null or satisfy the equality test.
jint xmog_hashCode (xmog_localenv *env=NULL)
 Returns the Java instance's hashCode.
jobject xmog_toString (xmog_localenv *env=NULL)
 Returns the Java instance's toString() valus as a global reference.
virtual jobject get_jobject_ (xmog_localenv *env=NULL) const
 Returns this instance's object reference.
virtual void xmog_monitor_enter (xmog_localenv *env=NULL) const
 Attempts to enter into a lock on the object.
virtual void xmog_monitor_exit (xmog_localenv *env=NULL) const
 Leaves a lock in the object.

Detailed Description

The wrapper base type representing C++ proxy instances for Java objects.


Constructor & Destructor Documentation

xmog_java_ref::xmog_java_ref const xmog_null  ) 
 

The from null constructor.

This constructor is synonymous to the default constructor and creates an instance that does not refer to any Java instance.

xmog_java_ref::xmog_java_ref xmog_java_array _arr,
jint  _index
 

The array element constructor.

This is really just a convenience constructor that helps improve the performance of accessing array elements. The same could be achieved by using the version of the constructor that takes an xmog_java_ref and xmog_java_dynamic as input.

Parameters:
_arr the array instance to which the element belongs.
_index the index into the array.

xmog_java_ref::xmog_java_ref xmog_java_class _clazz,
xmog_java_dynamic _dynamic,
xmog_flags  _flags
 

The constructor that allows the dynamic resolution of class-related information.

This is the constructor that's used when we're creating support for static methods and fields.

Parameters:
_clazz the class instance to which the element belongs.
_dynamic the instance that knows how to access the information we're interested in.
_flags bit flags that provide additional processing information.

xmog_java_ref::xmog_java_ref xmog_base _delegate,
bool  _owns_delegate = true
 

The constructor that allows the creation of an instance to handle all requests by delegating to another instance.

This is the constructor that's used when we want to maintain a dynamically allocated instance inside another instance. This will for example allow us to have a more derived concrete instance maintained in a stack-based less concrete instance that is returned by a method call.

Parameters:
_delegate an instance that is of compatible type to the outer instance and can therefore be delegated to for every request being made of this instance.
_owns_delegate true if the proxy instance owns the delgate, false otherwise. The proxy's destructor will call delete() on the delegate if the value is true. The default value is true.

xmog_java_ref::xmog_java_ref xmog_java_ref _ref,
xmog_java_dynamic _dynamic,
xmog_flags  _flags
 

The constructor that allows the dynamic resolution of instance-related information.

This is the constructor that's used when we're creating support for instance methods and fields.

Parameters:
_ref the instance to which the element belongs.
_dynamic the instance that knows how to access the information we're interested in.
_flags bit flags that provide additional processing information.

xmog_java_ref::xmog_java_ref jobject  _local,
xmog_flags  _flags
 

The constructor that sets an existing JNI reference into a wrapper instance.

Parameters:
_local the JNI reference.
_flags bit flags that provide additional processing information.


Member Function Documentation

virtual jobject xmog_java_ref::get_jobject_ xmog_localenv env = NULL  )  const [virtual]
 

Returns this instance's object reference.

This method is only useful for reference-type proxies but not for primitive value proxies. Overrides the xmog_base::get_jobject_() method to potentially use a cached value.

Parameters:
env an optional local call environment. NULL is a legal value.

Reimplemented from xmog_base.

bool xmog_java_ref::operator!= const xmog_java_ref  )  const
 

Compares the instance for inequality with another instance.

This method returns true if this instance and the other instance reference different Java objects. It does not matter whether the Java objects contain the same data and satisfy the equals test. This is an identity-based comparison operation, not an equality-based comparison operation.

bool xmog_java_ref::operator== const xmog_java_ref  )  const
 

Compares the instance for equality with another instance.

This method returns true if this instance and the other instance reference the same Java object. This is an identity-based comparison operation, not an equality-based comparison operation.

jboolean xmog_java_ref::xmog_equals const xmog_java_ref _rhs,
xmog_localenv env = NULL
 

Returns true if both instances are null or satisfy the equality test.

This method is mainly used to support other languages than C++.

Parameters:
_rhs the other instance for the equality comparison.
env the local call environment. The default value is NULL.

jint xmog_java_ref::xmog_hashCode xmog_localenv env = NULL  ) 
 

Returns the Java instance's hashCode.

This method is mainly used to support other languages than C++.

Parameters:
env the local call environment. The default value is NULL.

jobject xmog_java_ref::xmog_toString xmog_localenv env = NULL  ) 
 

Returns the Java instance's toString() valus as a global reference.

This method is mainly used to support other languages than C++.

Parameters:
env the local call environment. The default value is NULL.


The documentation for this class was generated from the following file:
Generated on Wed May 31 14:01:32 2006 for Shared Codemesh Runtime Library API Reference by  doxygen 1.4.1