Codemesh Runtime v3 C++ API Reference
3.9.205
|
A utility class that provides access to the Java interface com.codemesh.peer.PeerType. More...
#include <xmog_peer.h>
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. More... | |
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. More... | |
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. More... | |
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. More... | |
static int | get_typeInfo (xmog_base *peer, char *result, jint size, jint &required, xmog_localenv *env=NULL) |
Gets the typeinfo from the peer instance. More... | |
static int | set_binaryData (xmog_base *peer, jbyte *pBytes, size_t len, xmog_localenv *env=NULL) |
Sets binary data into the instance. More... | |
static int | get_binaryData (xmog_base *peer, jbyte **ppBytes, size_t *len, xmog_localenv *env=NULL) |
Retrieves binary data from the instance. More... | |
static int | set_byte (xmog_base *peer, const char *fieldNameUtf, jbyte b, xmog_localenv *env=NULL) |
Sets a byte field into the instance. More... | |
static int | get_byte (xmog_base *peer, const char *fieldNameUtf, jbyte *b, xmog_localenv *env=NULL) |
Reads a byte field from the instance. More... | |
static int | set_bool (xmog_base *peer, const char *fieldNameUtf, bool b, xmog_localenv *env=NULL) |
Sets a bool field into the instance. More... | |
static int | get_bool (xmog_base *peer, const char *fieldNameUtf, bool *b, xmog_localenv *env=NULL) |
Reads a bool field from the instance. More... | |
static int | set_boolean (xmog_base *peer, const char *fieldNameUtf, jboolean b, xmog_localenv *env=NULL) |
Sets a boolean field into the instance. More... | |
static int | get_boolean (xmog_base *peer, const char *fieldNameUtf, jboolean *b, xmog_localenv *env=NULL) |
Reads a jboolean field from the instance. More... | |
static int | set_char (xmog_base *peer, const char *fieldNameUtf, jchar c, xmog_localenv *env=NULL) |
Sets a char field into the instance. More... | |
static int | get_char (xmog_base *peer, const char *fieldNameUtf, jchar *ch, xmog_localenv *env=NULL) |
Reads a char field from the instance. More... | |
static int | set_double (xmog_base *peer, const char *fieldNameUtf, jdouble d, xmog_localenv *env=NULL) |
Sets a double field into the instance. More... | |
static int | get_double (xmog_base *peer, const char *fieldNameUtf, jdouble *d, xmog_localenv *env=NULL) |
Reads a double field from the instance. More... | |
static int | set_float (xmog_base *peer, const char *fieldNameUtf, jfloat f, xmog_localenv *env=NULL) |
Sets a float field into the instance. More... | |
static int | get_float (xmog_base *peer, const char *fieldNameUtf, jfloat *f, xmog_localenv *env=NULL) |
Reads a float field from the instance. More... | |
static int | set_int (xmog_base *peer, const char *fieldNameUtf, jint i, xmog_localenv *env=NULL) |
Sets a int field into the instance. More... | |
static int | get_int (xmog_base *peer, const char *fieldNameUtf, jint *i, xmog_localenv *env=NULL) |
Reads an int field from the instance. More... | |
static int | set_long (xmog_base *peer, const char *fieldNameUtf, jlong l, xmog_localenv *env=NULL) |
Sets a long field into the instance. More... | |
static int | get_long (xmog_base *peer, const char *fieldNameUtf, jlong *l, xmog_localenv *env=NULL) |
Reads a long field from the instance. More... | |
static int | set_short (xmog_base *peer, const char *fieldNameUtf, jshort s, xmog_localenv *env=NULL) |
Sets a short field into the instance. More... | |
static int | get_short (xmog_base *peer, const char *fieldNameUtf, jshort *s, xmog_localenv *env=NULL) |
Reads a short field from the instance. More... | |
static int | set_Object (xmog_base *peer, const char *fieldNameUtf, jobject o, xmog_localenv *env=NULL) |
Sets an Object field into the instance. More... | |
static int | get_Object (xmog_base *peer, const char *fieldNameUtf, jobject *o, xmog_localenv *env=NULL) |
Reads an Object field from the instance. More... | |
static int | set_Object (xmog_base *peer, const char *fieldNameUtf, const char *str, xmog_localenv *env=NULL) |
Sets a String field into the instance. More... | |
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. More... | |
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. More... | |
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. More... | |
static char * | to_string (xmog_base *peer, xmog_localenv *env=NULL) |
Returns a string containing the instance's state in text representation. More... | |
static xmog_java_class * | get_class () |
Returns a pointer to the xmog_java_class that represents the com.codemesh.peer.PeerType interface. More... | |
static xmog_java_class * | get_class (const char *classNameUtf, xmog_localenv *env=NULL) |
Returns a pointer to the class of the given name. More... | |
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>. More... | |
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.
|
static |
Creates a new instance of a Java type that is supposedly implementing the com.codemesh.peer.PeerType interface.
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 |
Retrieves binary data from the instance.
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 |
Reads a bool
field from the instance.
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 |
Reads a jboolean
field from the instance.
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 |
Reads a byte
field from the instance.
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 |
Reads a char
field from the instance.
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 |
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.
|
static |
Returns a pointer to the class of the given name.
The owner is responsible for deleting the returned instance.
classNameUtf | the name of the peer type we wish to use. |
env | the local call environment. May be NULL . |
|
static |
Reads a double
field from the instance.
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 |
Reads a float
field from the instance.
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 |
Reads an int
field from the instance.
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 |
Reads a long
field from the instance.
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 |
Reads an Object field from the instance.
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 |
Reads a short
field from the instance.
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 |
Reads a String field from the instance.
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 |
Reads a String field from the instance.
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 |
Gets the typeinfo from the peer instance.
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 |
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.
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. |
|
static |
Sets binary data into the instance.
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 |
Sets a bool
field into the instance.
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 |
Sets a boolean
field into the instance.
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 |
Sets a byte
field into the instance.
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 |
Sets a char
field into the instance.
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 |
Sets a double
field into the instance.
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 |
Sets a float
field into the instance.
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 |
Sets a int
field into the instance.
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 |
Sets a long
field into the instance.
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 |
Sets a String field into the instance.
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 |
Sets a String field into the instance.
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 |
Sets an Object field into the instance.
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 |
Sets a short
field into the instance.
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 |
Sets the typeinfo for the C++ instance that is storing data into this instance.
peer | the peer instance. |
typeInfoUtf | the type identifier in UTF-8 format. |
env | the local call environment. May be NULL . |
|
static |
Sets the typeinfo for the C++ instance that is storing data into this instance.
peer | the peer instance. |
typeInfo | the type identifier. |
env | the local call environment. May be 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.
peer | the peer instance. |
typeInfo | the type identifier. |
env | the local call environment. May be 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.
peer | the peer instance. |
env | the local call environment. May be NULL . |