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

xmog_peer_value Class Reference
[Java Peer Framework]

The wrapper class for the builtin Java com.codemesh.peer.Value type. More...

#include <xmog_peer_value.h>

Inheritance diagram for xmog_peer_value:

Inheritance graph
[legend]
Collaboration diagram for xmog_peer_value:

Collaboration graph
[legend]
List of all members.

Public Types

enum  {
  XMOG_VOID = 0, XMOG_BOOLEAN = 2, XMOG_BYTE = 4, XMOG_CHAR = 8,
  XMOG_DOUBLE = 16, XMOG_FLOAT = 32, XMOG_INT = 64, XMOG_LONG = 128,
  XMOG_SHORT = 256, XMOG_OBJECT = 512, XMOG_EXCEPTION = 1
}
 The values that indicate the type of object that is encapsulated by an xmog_peer_value instance. More...

Public Member Functions

 xmog_peer_value ()
 The default constructor.
 xmog_peer_value (const xmog_peer_value &_rhs)
 The copy constructor.
 xmog_peer_value (jobject _ref, xmog_flags flags)
 The constructor from an already existing Java reference.
 xmog_peer_value (xmog_java_array *_array, jint index)
 The constructor for a pere value that is an element of an array.
 xmog_peer_value (bool z, xmog_localenv *env=NULL, xmog_flags flags=xmog_base::GLOBAL)
 Creates a peer value instance representing a bool value.
 xmog_peer_value (jboolean z, xmog_localenv *env=NULL, xmog_flags flags=xmog_base::GLOBAL)
 Creates a peer value instance representing a jboolean value.
 xmog_peer_value (jbyte b, xmog_localenv *env=NULL, xmog_flags flags=xmog_base::GLOBAL)
 Creates a peer value instance representing a jbyte value.
 xmog_peer_value (jchar ch, xmog_localenv *env=NULL, xmog_flags flags=xmog_base::GLOBAL)
 Creates a peer value instance representing a jchar value.
 xmog_peer_value (jdouble d, xmog_localenv *env=NULL, xmog_flags flags=xmog_base::GLOBAL)
 Creates a peer value instance representing a jdouble value.
 xmog_peer_value (jfloat f, xmog_localenv *env=NULL, xmog_flags flags=xmog_base::GLOBAL)
 Creates a peer value instance representing a jfloat value.
 xmog_peer_value (jint i, xmog_localenv *env=NULL, xmog_flags flags=xmog_base::GLOBAL)
 Creates a peer value instance representing a jint value.
 xmog_peer_value (jlong j, xmog_localenv *env=NULL, xmog_flags flags=xmog_base::GLOBAL)
 Creates a peer value instance representing a jlong value.
 xmog_peer_value (jshort s, xmog_localenv *env=NULL, xmog_flags flags=xmog_base::GLOBAL)
 Creates a peer value instance representing a jshort value.
 xmog_peer_value (const xmog_base &l, xmog_localenv *env=NULL, xmog_flags flags=xmog_base::GLOBAL)
 Creates a peer value instance representing an object.
 xmog_peer_value (const xmog_base &exc, bool bIsExc, xmog_localenv *env=NULL, xmog_flags flags=xmog_base::GLOBAL)
 Creates a peer value instance representing an exception (a Throwable).
xmog_peer_value operator= (const xmog_peer_value &_rhs)
 Duplicates the reference held by the argumnent into the receiver.
void setz (bool z, xmog_localenv *env, xmog_flags flags)
 A utility method to set the peer value to a bool value.
void setz (jboolean z, xmog_localenv *env, xmog_flags flags)
 A utility method to set the peer value to a jboolean value.
void setb (jbyte b, xmog_localenv *env, xmog_flags flags)
 A utility method to set the peer value to a byte value.
void setc (jchar c, xmog_localenv *env, xmog_flags flags)
 A utility method to set the peer value to a char value.
void setd (jdouble d, xmog_localenv *env, xmog_flags flags)
 A utility method to set the peer value to a double value.
void setf (jfloat f, xmog_localenv *env, xmog_flags flags)
 A utility method to set the peer value to a float value.
void seti (jint i, xmog_localenv *env, xmog_flags flags)
 A utility method to set the peer value to an int value.
void setj (jlong j, xmog_localenv *env, xmog_flags flags)
 A utility method to set the peer value to a long value.
void sets (jshort s, xmog_localenv *env, xmog_flags flags)
 A utility method to set the peer value to a short value.
void setl (const xmog_base &l, xmog_localenv *env, xmog_flags flags)
 A utility method to set the peer value to an reference type value.
void sete (const xmog_base &e, xmog_localenv *env, xmog_flags flags)
 A utility method to set the peer value to an exception value.
void printToString (FILE *file, xmog_localenv *env)
 A utility method for debugging.

Static Public Member Functions

static void startHeapMonitor (jlong collector, jint highWaterMark, jlong interval)
 Starts a heap monitor for .NET runtime environments.
static void stopHeapMonitor ()
 Stops the heap monitor for .NET runtime environments.
static int register_native (xmog_localenv *env=NULL)
 A framework method that registers the native method(s) of the corresponding Java class.
static xmog_java_classget_java_class (xmog_localenv *env=NULL)
 Returns the class instance representing the peer.Value type.
static jobject get_stack_trace (xmog_localenv *env, jlong exc, jint size)
 An method returning the stacktrace string upto a certain length.
static jobject get_ifc_names (xmog_localenv *env, jlong inst)
 An method returning an array of classnames, representing the interfaces implemented by the given object.

Public Attributes

xmog_jboolean z
 A field that allows access to the instance's bool value.
xmog_byte b
 A field that allows access to the instance's jbyte value.
xmog_char c
 A field that allows access to the instance's jchar value.
xmog_double d
 A field that allows access to the instance's jdouble value.
xmog_float f
 A field that allows access to the instance's jfloat value.
xmog_int i
 A field that allows access to the instance's jint value.
xmog_long j
 A field that allows access to the instance's jlong value.
xmog_short s
 A field that allows access to the instance's jshort value.
xmog_java_ref l
 A field that allows access to the instance's reference (jobject) value.
xmog_int type
 A field that allows access to the instance's type.

Detailed Description

The wrapper class for the builtin Java com.codemesh.peer.Value type.

This class helps us pass values polymorphically between C++ and Java. Think of it as a more powerful wrapper around JNI's jvalue type. This type adds housekeeping that allows us to pass information about the type of contained data, something that is not necessary in jvalue because it is only used in situations where the caller knows what data to expect.


Member Enumeration Documentation

anonymous enum
 

The values that indicate the type of object that is encapsulated by an xmog_peer_value instance.

This value is kept in the type field.

Enumeration values:
XMOG_VOID  unused
XMOG_BOOLEAN  Signals that the type is a primitive boolean.
XMOG_BYTE  Signals that the type is a primitive byte.
XMOG_CHAR  Signals that the type is a primitive char.
XMOG_DOUBLE  Signals that the type is a primitive double.
XMOG_FLOAT  Signals that the type is a primitive float.
XMOG_INT  Signals that the type is a primitive int.
XMOG_LONG  Signals that the type is a primitive long.
XMOG_SHORT  Signals that the type is a primitive short.
XMOG_OBJECT  Signals that the type is an object (reference) type.
XMOG_EXCEPTION  Signals that the type is an exception.


Constructor & Destructor Documentation

xmog_peer_value::xmog_peer_value const xmog_peer_value _rhs  ) 
 

The copy constructor.

Parameters:
_rhs the instance from which the newly created instance is initialized.

xmog_peer_value::xmog_peer_value jobject  _ref,
xmog_flags  flags
 

The constructor from an already existing Java reference.

Parameters:
_ref the Java object handle.
flags the housekeeping flags.

xmog_peer_value::xmog_peer_value xmog_java_array _array,
jint  index
 

The constructor for a pere value that is an element of an array.

Parameters:
_array pointr to the owning array.
index index into the array.

xmog_peer_value::xmog_peer_value bool  z,
xmog_localenv env = NULL,
xmog_flags  flags = xmog_base::GLOBAL
 

Creates a peer value instance representing a bool value.

Parameters:
z the instance's value.
env the optional local environment. Default value is NULL.
flags the optional housekeeping flags. Default value is xmog_base::GLOBAL.

xmog_peer_value::xmog_peer_value jboolean  z,
xmog_localenv env = NULL,
xmog_flags  flags = xmog_base::GLOBAL
 

Creates a peer value instance representing a jboolean value.

Parameters:
z the instance's value.
env the optional local environment. Default value is NULL.
flags the optional housekeeping flags. Default value is xmog_base::GLOBAL.

xmog_peer_value::xmog_peer_value jbyte  b,
xmog_localenv env = NULL,
xmog_flags  flags = xmog_base::GLOBAL
 

Creates a peer value instance representing a jbyte value.

Parameters:
b the instance's value.
env the optional local environment. Default value is NULL.
flags the optional housekeeping flags. Default value is xmog_base::GLOBAL.

xmog_peer_value::xmog_peer_value jchar  ch,
xmog_localenv env = NULL,
xmog_flags  flags = xmog_base::GLOBAL
 

Creates a peer value instance representing a jchar value.

Parameters:
ch the instance's value.
env the optional local environment. Default value is NULL.
flags the optional housekeeping flags. Default value is xmog_base::GLOBAL.

xmog_peer_value::xmog_peer_value jdouble  d,
xmog_localenv env = NULL,
xmog_flags  flags = xmog_base::GLOBAL
 

Creates a peer value instance representing a jdouble value.

Parameters:
d the instance's value.
env the optional local environment. Default value is NULL.
flags the optional housekeeping flags. Default value is xmog_base::GLOBAL.

xmog_peer_value::xmog_peer_value jfloat  f,
xmog_localenv env = NULL,
xmog_flags  flags = xmog_base::GLOBAL
 

Creates a peer value instance representing a jfloat value.

Parameters:
f the instance's value.
env the optional local environment. Default value is NULL.
flags the optional housekeeping flags. Default value is xmog_base::GLOBAL.

xmog_peer_value::xmog_peer_value jint  i,
xmog_localenv env = NULL,
xmog_flags  flags = xmog_base::GLOBAL
 

Creates a peer value instance representing a jint value.

Parameters:
i the instance's value.
env the optional local environment. Default value is NULL.
flags the optional housekeeping flags. Default value is xmog_base::GLOBAL.

xmog_peer_value::xmog_peer_value jlong  j,
xmog_localenv env = NULL,
xmog_flags  flags = xmog_base::GLOBAL
 

Creates a peer value instance representing a jlong value.

Parameters:
j the instance's value.
env the optional local environment. Default value is NULL.
flags the optional housekeeping flags. Default value is xmog_base::GLOBAL.

xmog_peer_value::xmog_peer_value jshort  s,
xmog_localenv env = NULL,
xmog_flags  flags = xmog_base::GLOBAL
 

Creates a peer value instance representing a jshort value.

Parameters:
s the instance's value.
env the optional local environment. Default value is NULL.
flags the optional housekeeping flags. Default value is xmog_base::GLOBAL.

xmog_peer_value::xmog_peer_value const xmog_base l,
xmog_localenv env = NULL,
xmog_flags  flags = xmog_base::GLOBAL
 

Creates a peer value instance representing an object.

Parameters:
l the instance's value.
env the optional local environment. Default value is NULL.
flags the optional housekeeping flags. Default value is xmog_base::GLOBAL.

xmog_peer_value::xmog_peer_value const xmog_base exc,
bool  bIsExc,
xmog_localenv env = NULL,
xmog_flags  flags = xmog_base::GLOBAL
 

Creates a peer value instance representing an exception (a Throwable).

Parameters:
exc the instance's value.
bIsExc always true to distinguish this constructor from the object constructor.
env the optional local environment. Default value is NULL.
flags the optional housekeeping flags. Default value is xmog_base::GLOBAL.


Member Function Documentation

static jobject xmog_peer_value::get_ifc_names xmog_localenv env,
jlong  inst
[static]
 

An method returning an array of classnames, representing the interfaces implemented by the given object.

This method is only used internally by by .NET bindings.

static xmog_java_class* xmog_peer_value::get_java_class xmog_localenv env = NULL  )  [static]
 

Returns the class instance representing the peer.Value type.

Parameters:
env an optional local call environment.

static jobject xmog_peer_value::get_stack_trace xmog_localenv env,
jlong  exc,
jint  size
[static]
 

An method returning the stacktrace string upto a certain length.

This method is only used internally by by .NET bindings.

xmog_peer_value xmog_peer_value::operator= const xmog_peer_value _rhs  ) 
 

Duplicates the reference held by the argumnent into the receiver.

Parameters:
_rhs the source operand.

void xmog_peer_value::printToString FILE *  file,
xmog_localenv env
 

A utility method for debugging.

Parameters:
file the file to which to print the instance.
env the local call environment.

static int xmog_peer_value::register_native xmog_localenv env = NULL  )  [static]
 

A framework method that registers the native method(s) of the corresponding Java class.

Parameters:
env an optional local call environment.

void xmog_peer_value::setb jbyte  b,
xmog_localenv env,
xmog_flags  flags
 

A utility method to set the peer value to a byte value.

This method also sets the type field to XMOG_BYTE.

Parameters:
b the new value of the instance.
env an optional local environment. May be NULL.
flags an optional housekeeping field.

void xmog_peer_value::setc jchar  c,
xmog_localenv env,
xmog_flags  flags
 

A utility method to set the peer value to a char value.

This method also sets the type field to XMOG_CHAR.

Parameters:
c the new value of the instance.
env an optional local environment. May be NULL.
flags an optional housekeeping field.

void xmog_peer_value::setd jdouble  d,
xmog_localenv env,
xmog_flags  flags
 

A utility method to set the peer value to a double value.

This method also sets the type field to XMOG_DOUBLE.

Parameters:
d the new value of the instance.
env an optional local environment. May be NULL.
flags an optional housekeeping field.

void xmog_peer_value::sete const xmog_base e,
xmog_localenv env,
xmog_flags  flags
 

A utility method to set the peer value to an exception value.

This method also sets the type field to XMOG_EXCEPTION. Its only difference to the setl() method is that it reports a different type. This allows us to use instances of this type to be used as return values that can distinguish between an Exception as a regular return value and an exception that was thrown.

Parameters:
e the new value of the instance.
env an optional local environment. May be NULL.
flags an optional housekeeping field.

void xmog_peer_value::setf jfloat  f,
xmog_localenv env,
xmog_flags  flags
 

A utility method to set the peer value to a float value.

This method also sets the type field to XMOG_FLOAT.

Parameters:
f the new value of the instance.
env an optional local environment. May be NULL.
flags an optional housekeeping field.

void xmog_peer_value::seti jint  i,
xmog_localenv env,
xmog_flags  flags
 

A utility method to set the peer value to an int value.

This method also sets the type field to XMOG_INT.

Parameters:
i the new value of the instance.
env an optional local environment. May be NULL.
flags an optional housekeeping field.

void xmog_peer_value::setj jlong  j,
xmog_localenv env,
xmog_flags  flags
 

A utility method to set the peer value to a long value.

This method also sets the type field to XMOG_LONG.

Parameters:
j the new value of the instance.
env an optional local environment. May be NULL.
flags an optional housekeeping field.

void xmog_peer_value::setl const xmog_base l,
xmog_localenv env,
xmog_flags  flags
 

A utility method to set the peer value to an reference type value.

This method also sets the type field to XMOG_OBJECT.

Parameters:
l the new value of the instance.
env an optional local environment. May be NULL.
flags an optional housekeeping field.

void xmog_peer_value::sets jshort  s,
xmog_localenv env,
xmog_flags  flags
 

A utility method to set the peer value to a short value.

This method also sets the type field to XMOG_SHORT.

Parameters:
s the new value of the instance.
env an optional local environment. May be NULL.
flags an optional housekeeping field.

void xmog_peer_value::setz jboolean  z,
xmog_localenv env,
xmog_flags  flags
 

A utility method to set the peer value to a jboolean value.

This method also sets the type field to XMOG_BOOLEAN.

Parameters:
z the new value of the instance.
env an optional local environment. May be NULL.
flags an optional housekeeping field.

void xmog_peer_value::setz bool  z,
xmog_localenv env,
xmog_flags  flags
 

A utility method to set the peer value to a bool value.

This method also sets the type field to XMOG_BOOLEAN.

Parameters:
z the new value of the instance.
env an optional local environment. May be NULL.
flags an optional housekeeping field.

static void xmog_peer_value::startHeapMonitor jlong  collector,
jint  highWaterMark,
jlong  interval
[static]
 

Starts a heap monitor for .NET runtime environments.

Parameters:
collector a delegate to call.
highWaterMark the percentage of heap utilization at which the callback is invoked.
interval the sleep interval for hte monitor thread.


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