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

xmog_peer Class Reference
[Java Peer Framework]

A utility class that provides access to the Java interface com.codemesh.peer.PeerType. More...

#include <xmog_peer.h>

Inheritance diagram for xmog_peer:

Inheritance graph
[legend]
List of all members.

Static Public Member Functions

static int create (xmog_base *peer, const char *classNameUtf, xmog_localenv *env=NULL, xmog_flags=xmog_base::LOCAL)
 Creates a new instance of a Java type that is supposedly implementing the com.codemesh.peer.PeerType interface.
static int set_typeInfo (xmog_base *peer, const char *typeInfoUtf, xmog_localenv *env=NULL)
 Sets the typeinfo for the C++ instance that is storing data into this instance.
static int set_typeInfo (xmog_base *peer, const wchar_t *typeInfo, xmog_localenv *env=NULL)
 Sets the typeinfo for the C++ instance that is storing data into this instance.
static int set_typeInfo (xmog_base *peer, xmog_base *typeInfo, xmog_localenv *env=NULL)
 Sets the typeinfo for the C++ instance that is storing data into this instance.
static int get_typeInfo (xmog_base *peer, char *result, jint size, jint &required, xmog_localenv *env=NULL)
 Gets the typeinfo from the peer instance.
static int set_binaryData (xmog_base *peer, jbyte *pBytes, size_t len, xmog_localenv *env=NULL)
 Sets binary data into the instance.
static int get_binaryData (xmog_base *peer, jbyte **ppBytes, size_t *len, xmog_localenv *env=NULL)
 Retrieves binary data from the instance.
static int set_byte (xmog_base *peer, const char *fieldNameUtf, jbyte b, xmog_localenv *env=NULL)
 Sets a byte field into the instance.
static int get_byte (xmog_base *peer, const char *fieldNameUtf, jbyte *b, xmog_localenv *env=NULL)
 Reads a byte field from the instance.
static int set_bool (xmog_base *peer, const char *fieldNameUtf, bool b, xmog_localenv *env=NULL)
 Sets a bool field into the instance.
static int get_bool (xmog_base *peer, const char *fieldNameUtf, bool *b, xmog_localenv *env=NULL)
 Reads a bool field from the instance.
static int set_boolean (xmog_base *peer, const char *fieldNameUtf, jboolean b, xmog_localenv *env=NULL)
 Sets a boolean field into the instance.
static int get_boolean (xmog_base *peer, const char *fieldNameUtf, jboolean *b, xmog_localenv *env=NULL)
 Reads a jboolean field from the instance.
static int set_char (xmog_base *peer, const char *fieldNameUtf, jchar c, xmog_localenv *env=NULL)
 Sets a char field into the instance.
static int get_char (xmog_base *peer, const char *fieldNameUtf, jchar *ch, xmog_localenv *env=NULL)
 Reads a char field from the instance.
static int set_double (xmog_base *peer, const char *fieldNameUtf, jdouble d, xmog_localenv *env=NULL)
 Sets a double field into the instance.
static int get_double (xmog_base *peer, const char *fieldNameUtf, jdouble *d, xmog_localenv *env=NULL)
 Reads a double field from the instance.
static int set_float (xmog_base *peer, const char *fieldNameUtf, jfloat f, xmog_localenv *env=NULL)
 Sets a float field into the instance.
static int get_float (xmog_base *peer, const char *fieldNameUtf, jfloat *f, xmog_localenv *env=NULL)
 Reads a float field from the instance.
static int set_int (xmog_base *peer, const char *fieldNameUtf, jint i, xmog_localenv *env=NULL)
 Sets a int field into the instance.
static int get_int (xmog_base *peer, const char *fieldNameUtf, jint *i, xmog_localenv *env=NULL)
 Reads an int field from the instance.
static int set_long (xmog_base *peer, const char *fieldNameUtf, jlong l, xmog_localenv *env=NULL)
 Sets a long field into the instance.
static int get_long (xmog_base *peer, const char *fieldNameUtf, jlong *l, xmog_localenv *env=NULL)
 Reads a long field from the instance.
static int set_short (xmog_base *peer, const char *fieldNameUtf, jshort s, xmog_localenv *env=NULL)
 Sets a short field into the instance.
static int get_short (xmog_base *peer, const char *fieldNameUtf, jshort *s, xmog_localenv *env=NULL)
 Reads a short field from the instance.
static int set_Object (xmog_base *peer, const char *fieldNameUtf, jobject o, xmog_localenv *env=NULL)
 Sets an Object field into the instance.
static int get_Object (xmog_base *peer, const char *fieldNameUtf, jobject *o, xmog_localenv *env=NULL)
 Reads an Object field from the instance.
static int set_Object (xmog_base *peer, const char *fieldNameUtf, const char *str, xmog_localenv *env=NULL)
 Sets a String field into the instance.
static int get_String (xmog_base *peer, const char *fieldNameUtf, const char **str, size_t *len, xmog_localenv *env=NULL)
 Reads a String field from the instance.
static int get_StringUtf8 (xmog_base *peer, const char *fieldNameUtf, const char **strUtf8, size_t *len, xmog_localenv *env=NULL)
 Reads a String field from the instance.
static int set_Object (xmog_base *peer, const char *fieldNameUtf, const wchar_t *str, xmog_localenv *env=NULL)
 Sets a String field into the instance.
static char * to_string (xmog_base *peer, xmog_localenv *env=NULL)
 Returns a string containing the instance's state in text representation.
static xmog_java_classget_class ()
 Returns a pointer to the xmog_java_class that represents the com.codemesh.peer.PeerType interface.
static xmog_java_classget_class (const char *classNameUtf, xmog_localenv *env=NULL)
 Returns a pointer to the class of the given name.
static int register_unmarshaller (const char *javaClassNameUtf, const char *cppClassIdentifier, XMOG_PEER_UNMARSHAL_METHOD pUnmarshal)
 Registers a peer unmarshaller for the tuple of <Java peer classname, C++ class identifier>.

Detailed Description

A utility class that provides access to the Java interface com.codemesh.peer.PeerType.

This type is useful to access arbitrary custom peer types if they implement the com.codemesh.peer.PeerType interface.


Member Function Documentation

static int xmog_peer::create xmog_base peer,
const char *  classNameUtf,
xmog_localenv env = NULL,
xmog_flags  = xmog_base::LOCAL
[static]
 

Creates a new instance of a Java type that is supposedly implementing the com.codemesh.peer.PeerType interface.

Parameters:
peer the instance into which the peer instance is created.
classNameUtf the classname in UTF-8 format.
env the local call environment. May be NULL.

static int xmog_peer::get_binaryData xmog_base peer,
jbyte **  ppBytes,
size_t *  len,
xmog_localenv env = NULL
[static]
 

Retrieves binary data from the instance.

Parameters:
peer the peer instance.
ppBytes a pointer to the buffer that holds the retrieved bytes.
len pointer the variable that holds the number of bytes.
env the local call environment. May be NULL.

static int xmog_peer::get_bool xmog_base peer,
const char *  fieldNameUtf,
bool *  b,
xmog_localenv env = NULL
[static]
 

Reads a bool field from the instance.

Parameters:
peer the peer instance.
fieldNameUtf the fieldname to which this data belongs in the C++ instance.
b a pointer to the field value
env the local call environment. May be NULL.

static int xmog_peer::get_boolean xmog_base peer,
const char *  fieldNameUtf,
jboolean *  b,
xmog_localenv env = NULL
[static]
 

Reads a jboolean field from the instance.

Parameters:
peer the peer instance.
fieldNameUtf the fieldname to which this data belongs in the C++ instance.
b a pointer to the field value
env the local call environment. May be NULL.

static int xmog_peer::get_byte xmog_base peer,
const char *  fieldNameUtf,
jbyte *  b,
xmog_localenv env = NULL
[static]
 

Reads a byte field from the instance.

Parameters:
peer the peer instance.
fieldNameUtf the fieldname to which this data belongs in the C++ instance.
b a pointer to the field value
env the local call environment. May be NULL.

static int xmog_peer::get_char xmog_base peer,
const char *  fieldNameUtf,
jchar *  ch,
xmog_localenv env = NULL
[static]
 

Reads a char field from the instance.

Parameters:
peer the peer instance.
fieldNameUtf the fieldname to which this data belongs in the C++ instance.
ch a pointer to the field value
env the local call environment. May be NULL.

static xmog_java_class* xmog_peer::get_class const char *  classNameUtf,
xmog_localenv env = NULL
[static]
 

Returns a pointer to the class of the given name.

The owner is responsible for deleting the returned instance.

Parameters:
classNameUtf the name of the peer type we wish to use.
env the local call environment. May be NULL.

static xmog_java_class* xmog_peer::get_class  )  [static]
 

Returns a pointer to the xmog_java_class that represents the com.codemesh.peer.PeerType interface.

The owner should not delete the returned instance; it is owned by the xmog_peer type.

Reimplemented in xmog_serializable.

static int xmog_peer::get_double xmog_base peer,
const char *  fieldNameUtf,
jdouble *  d,
xmog_localenv env = NULL
[static]
 

Reads a double field from the instance.

Parameters:
peer the peer instance.
fieldNameUtf the fieldname to which this data belongs in the C++ instance.
d a pointer to the field value
env the local call environment. May be NULL.

static int xmog_peer::get_float xmog_base peer,
const char *  fieldNameUtf,
jfloat *  f,
xmog_localenv env = NULL
[static]
 

Reads a float field from the instance.

Parameters:
peer the peer instance.
fieldNameUtf the fieldname to which this data belongs in the C++ instance.
f a pointer to the field value
env the local call environment. May be NULL.

static int xmog_peer::get_int xmog_base peer,
const char *  fieldNameUtf,
jint *  i,
xmog_localenv env = NULL
[static]
 

Reads an int field from the instance.

Parameters:
peer the peer instance.
fieldNameUtf the fieldname to which this data belongs in the C++ instance.
i a pointer to the field value
env the local call environment. May be NULL.

static int xmog_peer::get_long xmog_base peer,
const char *  fieldNameUtf,
jlong *  l,
xmog_localenv env = NULL
[static]
 

Reads a long field from the instance.

Parameters:
peer the peer instance.
fieldNameUtf the fieldname to which this data belongs in the C++ instance.
l a pointer to the field value
env the local call environment. May be NULL.

static int xmog_peer::get_Object xmog_base peer,
const char *  fieldNameUtf,
jobject *  o,
xmog_localenv env = NULL
[static]
 

Reads an Object field from the instance.

Parameters:
peer the peer instance.
fieldNameUtf the fieldname to which this data belongs in the C++ instance.
o a pointer to the field value
env the local call environment. May be NULL.

static int xmog_peer::get_short xmog_base peer,
const char *  fieldNameUtf,
jshort *  s,
xmog_localenv env = NULL
[static]
 

Reads a short field from the instance.

Parameters:
peer the peer instance.
fieldNameUtf the fieldname to which this data belongs in the C++ instance.
s a pointer to the field value
env the local call environment. May be NULL.

static int xmog_peer::get_String xmog_base peer,
const char *  fieldNameUtf,
const char **  str,
size_t *  len,
xmog_localenv env = NULL
[static]
 

Reads a String field from the instance.

Parameters:
peer the peer instance.
fieldNameUtf the fieldname to which this data belongs in the C++ instance.
str a pointer to variable that will receive the string in the current default encoding.
len a pointer to the variable that will receive the bytecount.
env the local call environment. May be NULL.

static int xmog_peer::get_StringUtf8 xmog_base peer,
const char *  fieldNameUtf,
const char **  strUtf8,
size_t *  len,
xmog_localenv env = NULL
[static]
 

Reads a String field from the instance.

Parameters:
peer the peer instance.
fieldNameUtf the fieldname to which this data belongs in the C++ instance.
strUtf8 a pointer to variable that will receive the UTF-8 string.
len a pointer to the variable that will receive the UTF-8 bytecount.
env the local call environment. May be NULL.

static int xmog_peer::get_typeInfo xmog_base peer,
char *  result,
jint  size,
jint &  required,
xmog_localenv env = NULL
[static]
 

Gets the typeinfo from the peer instance.

Parameters:
peer the peer instance.
result a pointer to the buffer that will hold the result.
size the buffer size.
required the number of bytes required to hold the result.
env the local call environment. May be NULL.

static int xmog_peer::register_unmarshaller const char *  javaClassNameUtf,
const char *  cppClassIdentifier,
XMOG_PEER_UNMARSHAL_METHOD  pUnmarshal
[static]
 

Registers a peer unmarshaller for the tuple of <Java peer classname, C++ class identifier>.

One unmarshaller may be used for more than one C++ class, so the runtime will parse the cppClassIdentifier as a comma separated list of identifiers, allowing the registration of more than one C++ type for one Java peer type.

Parameters:
javaClassNameUtf the name of the Java peer type.
cppClassIdentifier the (comma-separated list of) C++ type identifiers handled by this unamrshaller.
pUnmarshal the function performing the unmarshalling for us.
Returns:
0 on success, -1 on failure.

static int xmog_peer::set_binaryData xmog_base peer,
jbyte *  pBytes,
size_t  len,
xmog_localenv env = NULL
[static]
 

Sets binary data into the instance.

Parameters:
peer the peer instance.
pBytes a pointer to the beginning of the native data.
len the number of bytes to store.
env the local call environment. May be NULL.

static int xmog_peer::set_bool xmog_base peer,
const char *  fieldNameUtf,
bool  b,
xmog_localenv env = NULL
[static]
 

Sets a bool field into the instance.

Parameters:
peer the peer instance.
fieldNameUtf the fieldname to which this data belongs in the C++ instance.
b the field value
env the local call environment. May be NULL.

static int xmog_peer::set_boolean xmog_base peer,
const char *  fieldNameUtf,
jboolean  b,
xmog_localenv env = NULL
[static]
 

Sets a boolean field into the instance.

Parameters:
peer the peer instance.
fieldNameUtf the fieldname to which this data belongs in the C++ instance.
b the field value
env the local call environment. May be NULL.

static int xmog_peer::set_byte xmog_base peer,
const char *  fieldNameUtf,
jbyte  b,
xmog_localenv env = NULL
[static]
 

Sets a byte field into the instance.

Parameters:
peer the peer instance.
fieldNameUtf the fieldname to which this data belongs in the C++ instance.
b the field value
env the local call environment. May be NULL.

static int xmog_peer::set_char xmog_base peer,
const char *  fieldNameUtf,
jchar  c,
xmog_localenv env = NULL
[static]
 

Sets a char field into the instance.

Parameters:
peer the peer instance.
fieldNameUtf the fieldname to which this data belongs in the C++ instance.
c the field value
env the local call environment. May be NULL.

static int xmog_peer::set_double xmog_base peer,
const char *  fieldNameUtf,
jdouble  d,
xmog_localenv env = NULL
[static]
 

Sets a double field into the instance.

Parameters:
peer the peer instance.
fieldNameUtf the fieldname to which this data belongs in the C++ instance.
d the field value
env the local call environment. May be NULL.

static int xmog_peer::set_float xmog_base peer,
const char *  fieldNameUtf,
jfloat  f,
xmog_localenv env = NULL
[static]
 

Sets a float field into the instance.

Parameters:
peer the peer instance.
fieldNameUtf the fieldname to which this data belongs in the C++ instance.
f the field value
env the local call environment. May be NULL.

static int xmog_peer::set_int xmog_base peer,
const char *  fieldNameUtf,
jint  i,
xmog_localenv env = NULL
[static]
 

Sets a int field into the instance.

Parameters:
peer the peer instance.
fieldNameUtf the fieldname to which this data belongs in the C++ instance.
i the field value
env the local call environment. May be NULL.

static int xmog_peer::set_long xmog_base peer,
const char *  fieldNameUtf,
jlong  l,
xmog_localenv env = NULL
[static]
 

Sets a long field into the instance.

Parameters:
peer the peer instance.
fieldNameUtf the fieldname to which this data belongs in the C++ instance.
l the field value
env the local call environment. May be NULL.

static int xmog_peer::set_Object xmog_base peer,
const char *  fieldNameUtf,
const wchar_t *  str,
xmog_localenv env = NULL
[static]
 

Sets a String field into the instance.

Parameters:
peer the peer instance.
fieldNameUtf the fieldname to which this data belongs in the C++ instance.
str the field value.
env the local call environment. May be NULL.

static int xmog_peer::set_Object xmog_base peer,
const char *  fieldNameUtf,
const char *  str,
xmog_localenv env = NULL
[static]
 

Sets a String field into the instance.

Parameters:
peer the peer instance.
fieldNameUtf the fieldname to which this data belongs in the C++ instance.
str the field value.
env the local call environment. May be NULL.

static int xmog_peer::set_Object xmog_base peer,
const char *  fieldNameUtf,
jobject  o,
xmog_localenv env = NULL
[static]
 

Sets an Object field into the instance.

Parameters:
peer the peer instance.
fieldNameUtf the fieldname to which this data belongs in the C++ instance.
o the field value
env the local call environment. May be NULL.

static int xmog_peer::set_short xmog_base peer,
const char *  fieldNameUtf,
jshort  s,
xmog_localenv env = NULL
[static]
 

Sets a short field into the instance.

Parameters:
peer the peer instance.
fieldNameUtf the fieldname to which this data belongs in the C++ instance.
s the field value
env the local call environment. May be NULL.

static int xmog_peer::set_typeInfo xmog_base peer,
xmog_base typeInfo,
xmog_localenv env = NULL
[static]
 

Sets the typeinfo for the C++ instance that is storing data into this instance.

This is the best variant of the method in terms of performance because no temporary Java string needs to be created.

Parameters:
peer the peer instance.
typeInfo the type identifier.
env the local call environment. May be NULL.

static int xmog_peer::set_typeInfo xmog_base peer,
const wchar_t *  typeInfo,
xmog_localenv env = NULL
[static]
 

Sets the typeinfo for the C++ instance that is storing data into this instance.

Parameters:
peer the peer instance.
typeInfo the type identifier.
env the local call environment. May be NULL.

static int xmog_peer::set_typeInfo xmog_base peer,
const char *  typeInfoUtf,
xmog_localenv env = NULL
[static]
 

Sets the typeinfo for the C++ instance that is storing data into this instance.

Parameters:
peer the peer instance.
typeInfoUtf the type identifier in UTF-8 format.
env the local call environment. May be NULL.

static char* xmog_peer::to_string xmog_base peer,
xmog_localenv env = NULL
[static]
 

Returns a string containing the instance's state in text representation.

The returned string is dynamically allocated and needs to be freed by the caller.

Parameters:
peer the peer instance.
env the local call environment. May be NULL.

Reimplemented in xmog_serializable.


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