00001
00002
00003
00004
00005 #ifndef xmog_peer_inc
00006 #define xmog_peer_inc
00007
00008
00009 #include "xmog_java.h"
00010
00154
00217 typedef void * (XMOG_CALLING_CONVENTION *XMOG_PEER_UNMARSHAL_METHOD)(
00218 xmog_base & peer,
00219 xmog_java_class * peerClass,
00220 const char * cppType,
00221 xmog_localenv * env );
00222
00223
00232 class XMOG_DECLSPEC xmog_peer
00233 {
00234 public:
00235
00244 static int create( xmog_base * peer, const char * classNameUtf, xmog_localenv * env = NULL, xmog_flags = xmog_base::LOCAL );
00245
00254 static int set_typeInfo( xmog_base * peer, const char * typeInfoUtf, xmog_localenv * env = NULL );
00255
00264 static int set_typeInfo( xmog_base * peer, const wchar_t * typeInfo, xmog_localenv * env = NULL );
00265
00277 static int set_typeInfo( xmog_base * peer, xmog_base * typeInfo, xmog_localenv * env = NULL );
00278
00288 static int get_typeInfo( xmog_base * peer, char * result, jint size, jint & required, xmog_localenv * env = NULL );
00289
00298 static int set_binaryData( xmog_base * peer, jbyte * pBytes, size_t len, xmog_localenv * env = NULL );
00299
00308 static int get_binaryData( xmog_base * peer, jbyte ** ppBytes, size_t * len, xmog_localenv * env = NULL );
00309
00318 static int set_byte( xmog_base * peer, const char * fieldNameUtf, jbyte b, xmog_localenv * env = NULL );
00319
00328 static int get_byte( xmog_base * peer, const char * fieldNameUtf, jbyte * b, xmog_localenv * env = NULL );
00329
00338 static int set_bool( xmog_base * peer, const char * fieldNameUtf, bool b, xmog_localenv * env = NULL );
00339
00348 static int get_bool( xmog_base * peer, const char * fieldNameUtf, bool * b, xmog_localenv * env = NULL );
00349
00358 static int set_boolean( xmog_base * peer, const char * fieldNameUtf, jboolean b, xmog_localenv * env = NULL );
00359
00368 static int get_boolean( xmog_base * peer, const char * fieldNameUtf, jboolean * b, xmog_localenv * env = NULL );
00369
00378 static int set_char( xmog_base * peer, const char * fieldNameUtf, jchar c, xmog_localenv * env = NULL );
00379
00388 static int get_char( xmog_base * peer, const char * fieldNameUtf, jchar * ch, xmog_localenv * env = NULL );
00389
00398 static int set_double( xmog_base * peer, const char * fieldNameUtf, jdouble d, xmog_localenv * env = NULL );
00399
00408 static int get_double( xmog_base * peer, const char * fieldNameUtf, jdouble * d, xmog_localenv * env = NULL );
00409
00418 static int set_float( xmog_base * peer, const char * fieldNameUtf, jfloat f, xmog_localenv * env = NULL );
00419
00428 static int get_float( xmog_base * peer, const char * fieldNameUtf, jfloat * f, xmog_localenv * env = NULL );
00429
00438 static int set_int( xmog_base * peer, const char * fieldNameUtf, jint i, xmog_localenv * env = NULL );
00439
00448 static int get_int( xmog_base * peer, const char * fieldNameUtf, jint * i, xmog_localenv * env = NULL );
00449
00458 static int set_long( xmog_base * peer, const char * fieldNameUtf, jlong l, xmog_localenv * env = NULL );
00459
00468 static int get_long( xmog_base * peer, const char * fieldNameUtf, jlong * l, xmog_localenv * env = NULL );
00469
00478 static int set_short( xmog_base * peer, const char * fieldNameUtf, jshort s, xmog_localenv * env = NULL );
00479
00488 static int get_short( xmog_base * peer, const char * fieldNameUtf, jshort * s, xmog_localenv * env = NULL );
00489
00498 static int set_Object( xmog_base * peer, const char * fieldNameUtf, jobject o, xmog_localenv * env = NULL );
00499
00508 static int get_Object( xmog_base * peer, const char * fieldNameUtf, jobject * o, xmog_localenv * env = NULL );
00509
00518 static int set_Object( xmog_base * peer, const char * fieldNameUtf, const char * str, xmog_localenv * env = NULL );
00519
00529 static int get_String( xmog_base * peer, const char * fieldNameUtf, const char ** str, size_t * len, xmog_localenv * env = NULL );
00530
00531 # if (XMOG_SUPPORTS_WCHAR_T==1)
00541 static int get_String( xmog_base * peer, const char * fieldNameUtf, const XMOG_WCHAR ** str, size_t * len, xmog_localenv * env = NULL );
00542 # endif
00543
00544 # if (XMOG_REQUIRES_UNSIGNED_SHORT_OVERLOAD==1)
00554 static int get_String( xmog_base * peer, const char * fieldNameUtf, const unsigned short ** str, size_t * len, xmog_localenv * env = NULL );
00555 # endif
00556
00566 static int get_StringUtf8( xmog_base * peer, const char * fieldNameUtf, const char ** strUtf8, size_t * len, xmog_localenv * env = NULL );
00567
00576 static int set_Object( xmog_base * peer, const char * fieldNameUtf, const wchar_t * str, xmog_localenv * env = NULL );
00577
00586 static char * to_string( xmog_base * peer, xmog_localenv * env = NULL );
00587
00595 static xmog_java_class * get_class();
00596
00605 static xmog_java_class * get_class( const char * classNameUtf, xmog_localenv * env = NULL );
00606
00620 static int register_unmarshaller( const char * javaClassNameUtf,
00621 const char * cppClassIdentifier,
00622 XMOG_PEER_UNMARSHAL_METHOD pUnmarshal );
00623
00624 };
00625
00626
00627 #endif