3101 Martin Zaun 2009-11-06 [merge]
ndbjtie - merge from 6.3-ndbjtie-automake to 6.3-ndbjtie.
added:
storage/ndb/ndbjtie/src/ndbjtie_defs.hpp
modified:
storage/ndb/ndbjtie/jtie/include/jtie_gcalls.hpp
storage/ndb/ndbjtie/jtie/include/jtie_tconv_array_impl.hpp
storage/ndb/ndbjtie/jtie/include/jtie_tconv_enum.hpp
storage/ndb/ndbjtie/jtie/include/jtie_tconv_enum_impl.hpp
storage/ndb/ndbjtie/jtie/include/jtie_tconv_impl.hpp
storage/ndb/ndbjtie/jtie/include/jtie_tconv_object_impl.hpp
storage/ndb/ndbjtie/jtie/include/jtie_tconv_ptrbybb_impl.hpp
storage/ndb/ndbjtie/jtie/include/jtie_tconv_ptrbyval.hpp
storage/ndb/ndbjtie/jtie/include/jtie_tconv_ptrbyval_impl.hpp
storage/ndb/ndbjtie/jtie/include/jtie_tconv_refbybb_impl.hpp
storage/ndb/ndbjtie/jtie/include/jtie_tconv_refbyval.hpp
storage/ndb/ndbjtie/jtie/include/jtie_tconv_refbyval_impl.hpp
storage/ndb/ndbjtie/jtie/include/jtie_tconv_string_impl.hpp
storage/ndb/ndbjtie/jtie/include/jtie_tconv_value.hpp
storage/ndb/ndbjtie/jtie/include/jtie_tconv_value_impl.hpp
storage/ndb/ndbjtie/jtie/include/jtie_tconv_vwidth.hpp
storage/ndb/ndbjtie/jtie/test/myjapi/Makefile.am
storage/ndb/ndbjtie/jtie/test/myjapi/myjapi_MyJapi.hpp
storage/ndb/ndbjtie/jtie/test/myjapi/myjapi_MyJapiCtypes.hpp
storage/ndb/ndbjtie/jtie/test/myjapi/myjapi_lib.cpp
storage/ndb/ndbjtie/src/mysql_jtie.hpp
storage/ndb/ndbjtie/src/ndbapi_jtie.hpp
3100 Jorgen Austvik 2009-11-05
Let us run NDB JTie JUnittest from install directory in addition to compile directory
modified:
mysql-test/Makefile.am
mysql-test/suite/ndb/include/have_ndbjtie.inc
mysql-test/suite/ndb/include/have_ndbjtie_junit.inc
mysql-test/suite/ndb/t/ndb_jtie.test
=== modified file 'storage/ndb/ndbjtie/jtie/include/jtie_gcalls.hpp'
--- a/storage/ndb/ndbjtie/jtie/include/jtie_gcalls.hpp 2009-11-04 17:28:51 +0000
+++ b/storage/ndb/ndbjtie/jtie/include/jtie_gcalls.hpp 2009-11-07 04:40:48 +0000
@@ -23,6 +23,7 @@
#define jtie_gcalls_hpp
#include "jtie_tconv_impl.hpp"
+#include "jtie_tconv_object_impl.hpp"
#include "helpers.hpp"
// ---------------------------------------------------------------------------
@@ -849,6 +850,9 @@ gdelete(JEPD, JCPD, JFPD(1))
(void)cls;
SFD;
PARAM_CONV_BEGIN(1);
+#ifdef JTIE_OBJECT_CLEAR_ADDRESS_UPON_DELETE
+ detachWrapper(jap1, env);
+#endif // JTIE_OBJECT_CLEAR_ADDRESS_UPON_DELETE
Destructor< CAPT(1) >::cdelete(CAP(1));
PARAM_CONV_END(1);
}
=== modified file 'storage/ndb/ndbjtie/jtie/include/jtie_tconv_array_impl.hpp'
--- a/storage/ndb/ndbjtie/jtie/include/jtie_tconv_array_impl.hpp 2009-11-04 17:28:51 +0000
+++ b/storage/ndb/ndbjtie/jtie/include/jtie_tconv_array_impl.hpp 2009-11-07 04:40:48 +0000
@@ -25,7 +25,6 @@
#include <stdint.h>
#include <jni.h>
-#include "jtie_tconv_vwidth.hpp"
#include "jtie_tconv_value.hpp"
// ---------------------------------------------------------------------------
@@ -37,34 +36,56 @@
* and vice versa.
* ArrayConv's function signatures support both, const and non-const base type
* specializations.
+ *
+ * This class only documents prototypes, no functions are declared or
+ * defined here, in order to have undefined type mappings result in a
+ * compilation error.
*/
template< typename JA,
typename CA >
struct ArrayConv {
-#if 1
-// XXX these declarations do not enforce but document only; consider other
-// patterns like the Curiosly Recurring Template Pattern...
-
/**
* Returns the body of the primitive array.
* The result is valid until ReleaseArrayElements() is called.
* Returns a non-const C array to allow for use in non-const context.
**/
- static CA GetArrayElements(JNIEnv * env, JA j, jboolean * isCopy);
+#if 0 // disabled on purpose, only document function
+ static CA
+ GetArrayElements(JNIEnv * env, JA j, jboolean * isCopy) {
+ TRACE("CA GetArrayElements(JNIEnv *, JA, jboolean *)");
+ (void)env; (void)j; (void)isCopy;
+ static_assert(false, "missing specialization of array conversion");
+ return 0;
+ }
+#endif // disabled on purpose, only document function
/**
* Informs the VM that the native code no longer needs access to elems.
* Accepts a const C array to allow for use in const context.
*/
- static void ReleaseArrayElements(JNIEnv * env, JA j, const CA c,
- jint mode);
+#if 0 // disabled on purpose, only document function
+ static void
+ ReleaseArrayElements(JNIEnv * env, JA j, const CA c, jint mode) {
+ TRACE("void ReleaseArrayElements(JNIEnv *, JA, const CA, jint)");
+ (void)env; (void)j; (void)c; (void)mode;
+ static_assert(false, "missing specialization of array conversion");
+ return 0;
+ }
+#endif // disabled on purpose, only document function
/**
* Constructs a new primitive array object with elements from a buffer.
* Accepts a const C array to allow for use in const context.
*/
- static JA NewArray(JNIEnv * env, jsize len, const CA c);
-#endif
+#if 0 // disabled on purpose, only document function
+ static JA
+ NewArray(JNIEnv * env, jsize len, const CA c) {
+ TRACE("JA NewArray(JNIEnv *, jsize, const CA)");
+ (void)env; (void)len; (void)c;
+ static_assert(false, "missing specialization of array conversion");
+ return 0;
+ }
+#endif // disabled on purpose, only document function
};
/**
@@ -81,23 +102,31 @@ template< typename JA,
JA (JNIEnv::*NEW)(jsize),
void (JNIEnv::*SET)(JA, jsize, jsize, const J *) >
struct ArrayConvImpl {
- static C * GetArrayElements(JNIEnv * env, JA j, jboolean * isCopy) {
- // convert pointer types (safety check in c'tor)
+ static C *
+ GetArrayElements(JNIEnv * env, JA j, jboolean * isCopy) {
+ // XXX currently, only exact-width base type conversions supported
+ assert(sizeof(J) == sizeof(C));
+ // convert pointer types
return reinterpret_cast< C * >((env->*GET)(j, isCopy));
}
- static void ReleaseArrayElements(JNIEnv * env, JA j, const C * c,
- jint mode) {
+ static void
+ ReleaseArrayElements(JNIEnv * env, JA j, const C * c, jint mode) {
+ // XXX currently, only exact-width base type conversions supported
+ assert(sizeof(J) == sizeof(C));
// ok to strip const, pinned arrays are not changed by release
// and copies cannot be used after release
C * ca = const_cast< C * >(c);
- // convert pointer types (safety check in c'tor)
+ // convert pointer types
(env->*REL)(j, reinterpret_cast< J * >(ca), mode);
}
- static JA NewArray(JNIEnv * env, jsize len, const C * c) {
+ static JA
+ NewArray(JNIEnv * env, jsize len, const C * c) {
+ // XXX currently, only exact-width base type conversions supported
+ assert(sizeof(J) == sizeof(C));
JA ja = (env->*NEW)(len);
- // convert pointer types (safety check in c'tor)
+ // convert pointer types
const J * cjc = reinterpret_cast< const J * >(c);
(env->*SET)(ja, 0, len, cjc);
return ja;
@@ -105,262 +134,83 @@ struct ArrayConvImpl {
private:
ArrayConvImpl() {
- // prohibit unsupported pointer type casts
+ // prohibit unsupported array type casts
is_valid_primitive_type_mapping< J, C >();
}
};
// ---------------------------------------------------------------------------
-// Specializations for array conversions of exact-width primitive type
-// ---------------------------------------------------------------------------
-
-template<> struct ArrayConv< jbooleanArray, bool * >
-: ArrayConvImpl< jbooleanArray, jboolean, bool,
- &JNIEnv::GetBooleanArrayElements,
- &JNIEnv::ReleaseBooleanArrayElements,
- &JNIEnv::NewBooleanArray,
- &JNIEnv::SetBooleanArrayRegion > {};
-
-template<> struct ArrayConv< jbyteArray, char * >
-: ArrayConvImpl< jbyteArray, jbyte, char,
- &JNIEnv::GetByteArrayElements,
- &JNIEnv::ReleaseByteArrayElements,
- &JNIEnv::NewByteArray,
- &JNIEnv::SetByteArrayRegion > {};
-
-template<> struct ArrayConv< jbyteArray, int8_t * >
-: ArrayConvImpl< jbyteArray, jbyte, int8_t,
- &JNIEnv::GetByteArrayElements,
- &JNIEnv::ReleaseByteArrayElements,
- &JNIEnv::NewByteArray,
- &JNIEnv::SetByteArrayRegion > {};
-
-template<> struct ArrayConv< jbyteArray, uint8_t * >
-: ArrayConvImpl< jbyteArray, jbyte, uint8_t,
- &JNIEnv::GetByteArrayElements,
- &JNIEnv::ReleaseByteArrayElements,
- &JNIEnv::NewByteArray,
- &JNIEnv::SetByteArrayRegion > {};
-
-template<> struct ArrayConv< jshortArray, int16_t * >
-: ArrayConvImpl< jshortArray, jshort, int16_t,
- &JNIEnv::GetShortArrayElements,
- &JNIEnv::ReleaseShortArrayElements,
- &JNIEnv::NewShortArray,
- &JNIEnv::SetShortArrayRegion > {};
-
-template<> struct ArrayConv< jshortArray, uint16_t * >
-: ArrayConvImpl< jshortArray, jshort, uint16_t,
- &JNIEnv::GetShortArrayElements,
- &JNIEnv::ReleaseShortArrayElements,
- &JNIEnv::NewShortArray,
- &JNIEnv::SetShortArrayRegion > {};
-
-template<> struct ArrayConv< jintArray, int32_t * >
-: ArrayConvImpl< jintArray, jint, int32_t,
- &JNIEnv::GetIntArrayElements,
- &JNIEnv::ReleaseIntArrayElements,
- &JNIEnv::NewIntArray,
- &JNIEnv::SetIntArrayRegion > {};
-
-template<> struct ArrayConv< jintArray, uint32_t * >
-: ArrayConvImpl< jintArray, jint, uint32_t,
- &JNIEnv::GetIntArrayElements,
- &JNIEnv::ReleaseIntArrayElements,
- &JNIEnv::NewIntArray,
- &JNIEnv::SetIntArrayRegion > {};
-
-template<> struct ArrayConv< jlongArray, int64_t * >
-: ArrayConvImpl< jlongArray, jlong, int64_t,
- &JNIEnv::GetLongArrayElements,
- &JNIEnv::ReleaseLongArrayElements,
- &JNIEnv::NewLongArray,
- &JNIEnv::SetLongArrayRegion > {};
-
-template<> struct ArrayConv< jlongArray, uint64_t * >
-: ArrayConvImpl< jlongArray, jlong, uint64_t,
- &JNIEnv::GetLongArrayElements,
- &JNIEnv::ReleaseLongArrayElements,
- &JNIEnv::NewLongArray,
- &JNIEnv::SetLongArrayRegion > {};
-
-template<> struct ArrayConv< jfloatArray, float * >
-: ArrayConvImpl< jfloatArray, jfloat, float,
- &JNIEnv::GetFloatArrayElements,
- &JNIEnv::ReleaseFloatArrayElements,
- &JNIEnv::NewFloatArray,
- &JNIEnv::SetFloatArrayRegion > {};
-
-template<> struct ArrayConv< jdoubleArray, double * >
-: ArrayConvImpl< jdoubleArray, jdouble, double,
- &JNIEnv::GetDoubleArrayElements,
- &JNIEnv::ReleaseDoubleArrayElements,
- &JNIEnv::NewDoubleArray,
- &JNIEnv::SetDoubleArrayRegion > {};
-
-// ---------------------------------------------------------------------------
-// Specializations for array conversions of variable-width primitive type
-// ---------------------------------------------------------------------------
-
-#if (defined(JTIE_TSPECIALIZE_SHORT_ARRAY) && JTIE_TSPECIALIZE_SHORT_ARRAY > 0)
-template<> struct ArrayConv< JTIE_JNI_SHORT_ARRAY_T *, signed short * >
-: ArrayConvImpl< JTIE_JNI_SHORT_ARRAY_T *, JTIE_JNI_SHORT_T, signed short,
- &JNIEnv::JTIE_JNI_GET_SHORT_ARRAY_ELEMENTS,
- &JNIEnv::JTIE_JNI_RELEASE_SHORT_ARRAY_ELEMENTS,
- &JNIEnv::JTIE_JNI_NEW_SHORT_ARRAY,
- &JNIEnv::JTIE_JNI_SET_SHORT_ARRAY_REGION > {};
-
-template<> struct ArrayConv< JTIE_JNI_SHORT_ARRAY_T *, unsigned short * >
-: ArrayConvImpl< JTIE_JNI_SHORT_ARRAY_T *, JTIE_JNI_SHORT_T, unsigned short,
- &JNIEnv::JTIE_JNI_GET_SHORT_ARRAY_ELEMENTS,
- &JNIEnv::JTIE_JNI_RELEASE_SHORT_ARRAY_ELEMENTS,
- &JNIEnv::JTIE_JNI_NEW_SHORT_ARRAY,
- &JNIEnv::JTIE_JNI_SET_SHORT_ARRAY_REGION > {};
-#endif
-
-#if (defined(JTIE_TSPECIALIZE_INT_ARRAY) && JTIE_TSPECIALIZE_INT_ARRAY > 0)
-template<> struct ArrayConv< JTIE_JNI_INT_ARRAY_T *, signed int * >
-: ArrayConvImpl< JTIE_JNI_INT_ARRAY_T *, JTIE_JNI_INT_T, signed int,
- &JNIEnv::JTIE_JNI_GET_INT_ARRAY_ELEMENTS,
- &JNIEnv::JTIE_JNI_RELEASE_INT_ARRAY_ELEMENTS,
- &JNIEnv::JTIE_JNI_NEW_INT_ARRAY,
- &JNIEnv::JTIE_JNI_SET_INT_ARRAY_REGION > {};
-
-template<> struct ArrayConv< JTIE_JNI_LONG_ARRAY_T *, unsigned long * >
-: ArrayConvImpl< JTIE_JNI_LONG_ARRAY_T *, JTIE_JNI_LONG_T, unsigned long,
- &JNIEnv::JTIE_JNI_GET_LONG_ARRAY_ELEMENTS,
- &JNIEnv::JTIE_JNI_RELEASE_LONG_ARRAY_ELEMENTS,
- &JNIEnv::JTIE_JNI_NEW_LONG_ARRAY,
- &JNIEnv::JTIE_JNI_SET_LONG_ARRAY_REGION > {};
-#endif
-
-#if (defined(JTIE_TSPECIALIZE_LONG_ARRAY) && JTIE_TSPECIALIZE_LONG_ARRAY > 0)
-template<> struct ArrayConv< JTIE_JNI_LONG_ARRAY_T *, signed long * >
-: ArrayConvImpl< JTIE_JNI_LONG_ARRAY_T *, JTIE_JNI_LONG_T, signed long,
- &JNIEnv::JTIE_JNI_GET_LONG_ARRAY_ELEMENTS,
- &JNIEnv::JTIE_JNI_RELEASE_LONG_ARRAY_ELEMENTS,
- &JNIEnv::JTIE_JNI_NEW_LONG_ARRAY,
- &JNIEnv::JTIE_JNI_SET_LONG_ARRAY_REGION > {};
-
-template<> struct ArrayConv< JTIE_JNI_LONG_ARRAY_T *, unsigned long * >
-: ArrayConvImpl< JTIE_JNI_LONG_ARRAY_T *, JTIE_JNI_LONG_T, unsigned long,
- &JNIEnv::JTIE_JNI_GET_LONG_ARRAY_ELEMENTS,
- &JNIEnv::JTIE_JNI_RELEASE_LONG_ARRAY_ELEMENTS,
- &JNIEnv::JTIE_JNI_NEW_LONG_ARRAY,
- &JNIEnv::JTIE_JNI_SET_LONG_ARRAY_REGION > {};
-#endif
-
-#if (defined(JTIE_TSPECIALIZE_LONGLONG_ARRAY) && JTIE_TSPECIALIZE_LONGLONG_ARRAY > 0)
-template<> struct ArrayConv< JTIE_JNI_LONGLONG_ARRAY_T *, signed long long * >
-: ArrayConvImpl< JTIE_JNI_LONGLONG_ARRAY_T *, JTIE_JNI_LONGLONG_T, signed long long,
- &JNIEnv::JTIE_JNI_GET_LONGLONG_ARRAY_ELEMENTS,
- &JNIEnv::JTIE_JNI_RELEASE_LONGLONG_ARRAY_ELEMENTS,
- &JNIEnv::JTIE_JNI_NEW_LONGLONG_ARRAY,
- &JNIEnv::JTIE_JNI_SET_LONGLONG_ARRAY_REGION > {};
-
-template<> struct ArrayConv< JTIE_JNI_LONG_ARRAY_T *, unsigned long * >
-: ArrayConvImpl< JTIE_JNI_LONG_ARRAY_T *, JTIE_JNI_LONG_T, unsigned long,
- &JNIEnv::JTIE_JNI_GET_LONG_ARRAY_ELEMENTS,
- &JNIEnv::JTIE_JNI_RELEASE_LONG_ARRAY_ELEMENTS,
- &JNIEnv::JTIE_JNI_NEW_LONG_ARRAY,
- &JNIEnv::JTIE_JNI_SET_LONG_ARRAY_REGION > {};
-#endif
-
-#if (defined(JTIE_TSPECIALIZE_LONGDOUBLE_ARRAY) && JTIE_TSPECIALIZE_LONGDOUBLE_ARRAY > 0)
-template<> struct ArrayConv< JTIE_JNI_LONGDOUBLE_ARRAY_T *, long double * >
-: ArrayConvImpl< JTIE_JNI_LONGDOUBLE_ARRAY_T *, JTIE_JNI_LONGDOUBLE_T, long double,
- &JNIEnv::JTIE_JNI_GET_LONGDOUBLE_ARRAY_ELEMENTS,
- &JNIEnv::JTIE_JNI_RELEASE_LONGDOUBLE_ARRAY_ELEMENTS,
- &JNIEnv::JTIE_JNI_NEW_LONGDOUBLE_ARRAY,
- &JNIEnv::JTIE_JNI_SET_LONGDOUBLE_ARRAY_REGION > {};
-#endif
-
-// ---------------------------------------------------------------------------
-// Specializations for const array conversions of exact-width primitive type
+// Specializations for array conversions
// ---------------------------------------------------------------------------
+// extend specializations to array of const
// Not sure why this generalized const specialization
// template< typename JA,
// typename CA >
// struct ArrayConv< JA, const CA > : ArrayConv< JA, CA > {};
-// doesn't resolve. Implementing by explicit delegation didn't fix it either.
+// doesn't resolve (no effect); specializing individually for each type then.
-template<> struct ArrayConv< jbooleanArray, const bool * >
-: ArrayConv< jbooleanArray, bool * > {};
+// specialize arrays conversion helper (for non-const and const)
+#define JTIE_SPECIALIZE_ARRAY_TYPE_HELPER( JA, J, JN, C ) \
+ template<> \
+ struct ArrayConv< JA, C * > \
+ : ArrayConvImpl< JA, J, C, \
+ &JNIEnv::Get##JN##ArrayElements, \
+ &JNIEnv::Release##JN##ArrayElements, \
+ &JNIEnv::New##JN##Array, \
+ &JNIEnv::Set##JN##ArrayRegion > {}; \
+ template<> \
+ struct ArrayConv< JA, const C * > \
+ : ArrayConv< JA, C * > {};
+
+// ---------------------------------------------------------------------------
+// Specializations for exact-width type array conversions
+// ---------------------------------------------------------------------------
-template<> struct ArrayConv< jbyteArray, const char * >
-: ArrayConv< jbyteArray, char * > {};
+JTIE_SPECIALIZE_ARRAY_TYPE_HELPER(jbooleanArray, jboolean, Boolean, bool)
-template<> struct ArrayConv< jbyteArray, const int8_t * >
-: ArrayConv< jbyteArray, int8_t * > {};
+JTIE_SPECIALIZE_ARRAY_TYPE_HELPER(jbyteArray, jbyte, Byte, char)
+JTIE_SPECIALIZE_ARRAY_TYPE_HELPER(jbyteArray, jbyte, Byte, signed char)
+JTIE_SPECIALIZE_ARRAY_TYPE_HELPER(jbyteArray, jbyte, Byte, unsigned char)
-template<> struct ArrayConv< jbyteArray, const uint8_t * >
-: ArrayConv< jbyteArray, uint8_t * > {};
+JTIE_SPECIALIZE_ARRAY_TYPE_HELPER(jfloatArray, jfloat, Float, float)
+JTIE_SPECIALIZE_ARRAY_TYPE_HELPER(jdoubleArray, jdouble, Double, double)
-template<> struct ArrayConv< jshortArray, const int16_t * >
-: ArrayConv< jshortArray, int16_t * > {};
-template<> struct ArrayConv< jshortArray, const uint16_t * >
-: ArrayConv< jshortArray, uint16_t * > {};
+// ---------------------------------------------------------------------------
+// Specializations for variable-width type array conversions
+// ---------------------------------------------------------------------------
-template<> struct ArrayConv< jintArray, const int32_t * >
-: ArrayConv< jintArray, int32_t * > {};
+// jshort in LP32, ILP32, LP64, ILP64, LLP64
+JTIE_SPECIALIZE_ARRAY_TYPE_HELPER(jshortArray, jshort, Short, signed short)
+JTIE_SPECIALIZE_ARRAY_TYPE_HELPER(jshortArray, jshort, Short, unsigned short)
-template<> struct ArrayConv< jintArray, const uint32_t * >
-: ArrayConv< jintArray, uint32_t * > {};
+// jshort in LP32
+JTIE_SPECIALIZE_ARRAY_TYPE_HELPER(jshortArray, jshort, Short, signed int)
+JTIE_SPECIALIZE_ARRAY_TYPE_HELPER(jshortArray, jshort, Short, unsigned int)
-template<> struct ArrayConv< jlongArray, const int64_t * >
-: ArrayConv< jlongArray, int64_t * > {};
+// jint in ILP32, LP64, LLP64
+JTIE_SPECIALIZE_ARRAY_TYPE_HELPER(jintArray, jint, Int, signed int)
+JTIE_SPECIALIZE_ARRAY_TYPE_HELPER(jintArray, jint, Int, unsigned int)
-template<> struct ArrayConv< jlongArray, const uint64_t * >
-: ArrayConv< jlongArray, uint64_t * > {};
+// jint in LP32, ILP32, LLP64
+JTIE_SPECIALIZE_ARRAY_TYPE_HELPER(jintArray, jint, Int, signed long)
+JTIE_SPECIALIZE_ARRAY_TYPE_HELPER(jintArray, jint, Int, unsigned long)
-template<> struct ArrayConv< jfloatArray, const float * >
-: ArrayConv< jfloatArray, float * > {};
+// jlong in ILP64
+JTIE_SPECIALIZE_ARRAY_TYPE_HELPER(jlongArray, jlong, Long, signed int)
+JTIE_SPECIALIZE_ARRAY_TYPE_HELPER(jlongArray, jlong, Long, unsigned int)
-template<> struct ArrayConv< jdoubleArray, const double * >
-: ArrayConv< jdoubleArray, double * > {};
+// jlong in LP64, ILP64
+JTIE_SPECIALIZE_ARRAY_TYPE_HELPER(jlongArray, jlong, Long, signed long)
+JTIE_SPECIALIZE_ARRAY_TYPE_HELPER(jlongArray, jlong, Long, unsigned long)
-// ---------------------------------------------------------------------------
-// Specializations for const array conversions of variable-width primitive type
-// ---------------------------------------------------------------------------
+// jlong in LLP64
+JTIE_SPECIALIZE_ARRAY_TYPE_HELPER(jlongArray, jlong, Long, signed long long)
+JTIE_SPECIALIZE_ARRAY_TYPE_HELPER(jlongArray, jlong, Long, unsigned long long)
-#if (defined(JTIE_TSPECIALIZE_SHORT_ARRAY) && JTIE_TSPECIALIZE_SHORT_ARRAY > 0)
-template<> struct ArrayConv< JTIE_JNI_SHORT_ARRAY_T *, const signed short * >
-: ArrayConv< JTIE_JNI_SHORT_ARRAY_T *, signed short * > {};
-
-template<> struct ArrayConv< JTIE_JNI_SHORT_ARRAY_T *, const unsigned short * >
-: ArrayConv< JTIE_JNI_SHORT_ARRAY_T *, unsigned short * > {};
-#endif
-
-#if (defined(JTIE_TSPECIALIZE_INT_ARRAY) && JTIE_TSPECIALIZE_INT_ARRAY > 0)
-template<> struct ArrayConv< JTIE_JNI_INT_ARRAY_T *, const signed int * >
-: ArrayConv< JTIE_JNI_INT_ARRAY_T *, signed int * > {};
-
-template<> struct ArrayConv< JTIE_JNI_INT_ARRAY_T *, const unsigned int * >
-: ArrayConv< JTIE_JNI_INT_ARRAY_T *, unsigned int * > {};
-#endif
-
-#if (defined(JTIE_TSPECIALIZE_LONG_ARRAY) && JTIE_TSPECIALIZE_LONG_ARRAY > 0)
-template<> struct ArrayConv< JTIE_JNI_LONG_ARRAY_T *, const signed long * >
-: ArrayConv< JTIE_JNI_LONG_ARRAY_T *, signed long * > {};
-
-template<> struct ArrayConv< JTIE_JNI_LONG_ARRAY_T *, const unsigned long * >
-: ArrayConv< JTIE_JNI_LONG_ARRAY_T *, unsigned long * > {};
-#endif
-
-#if (defined(JTIE_TSPECIALIZE_LONGLONG_ARRAY) && JTIE_TSPECIALIZE_LONGLONG_ARRAY > 0)
-template<> struct ArrayConv< JTIE_JNI_LONGLONG_ARRAY_T *, const signed long long * >
-: ArrayConv< JTIE_JNI_LONGLONG_ARRAY_T *, signed long long * > {};
-
-template<> struct ArrayConv< JTIE_JNI_LONGLONG_ARRAY_T *, const unsigned long long * >
-: ArrayConv< JTIE_JNI_LONGLONG_ARRAY_T *, unsigned long long * > {};
-#endif
-
-#if (defined(JTIE_TSPECIALIZE_LONGDOUBLE_ARRAY) && JTIE_TSPECIALIZE_LONGDOUBLE_ARRAY > 0)
-template<> struct ArrayConv< JTIE_JNI_LONGDOUBLE_ARRAY_T *, const long double * >
-: ArrayConv< JTIE_JNI_LONGDOUBLE_ARRAY_T *, long double * > {};
-#endif
+// jdouble
+JTIE_SPECIALIZE_ARRAY_TYPE_HELPER(jdoubleArray, jdouble, Double, long double)
// ---------------------------------------------------------------------------
=== modified file 'storage/ndb/ndbjtie/jtie/include/jtie_tconv_enum.hpp'
--- a/storage/ndb/ndbjtie/jtie/include/jtie_tconv_enum.hpp 2009-10-27 06:56:52 +0000
+++ b/storage/ndb/ndbjtie/jtie/include/jtie_tconv_enum.hpp 2009-11-07 04:40:48 +0000
@@ -25,41 +25,76 @@
#include <stdint.h>
#include <jni.h>
-#include "jtie_tconv_vwidth.hpp"
-
-#if 1 // XXX! provisional enum support, introduce strict mapping type
-
// ---------------------------------------------------------------------------
// Java value <-> C enum conversions
// ---------------------------------------------------------------------------
+// currently, only Java int <-> C enum mappings are supported
+
+// root type for enum value argument/result mappings
+// Unlike the root class definitions for object (array etc) mappings,
+// this class does not represent a (static) trait object, for it cannot
+// derive from a basic number type like int. Instead, automatic type
+// conversion by constructor/operator is employed, which allows for
+// static type conversion between the Java formal and actual type in
+// this mapping. While this approach leads to conceptually creating
+// instances of this root class at runtime holding the enum value, the
+// compiler is likely to detect and optimize away any value-preserving,
+// purely type-changing copy operations.
+struct _jtie_jint_Enum {
+ /*const*/ jint value;
+
+ // conversion constructor
+ _jtie_jint_Enum(jint v) : value(v) {}
+
+ // conversion operator
+ operator jint() { return value; }
+
+/*
+private:
+ // can't have default assignment operator due to non-static const member
+ _jtie_jint_Enum & operator=(const _jtie_jint_Enum &) {
+ return *this;
+ }
+*/
+};
+//typedef _jtie_jint_Enum * jtie_jint_Enum;
+
+// XXX rename to hint jint
+#define JTIE_DEFINE_ENUM_MAPPING_INFO_AND_TRAITS( J, C ) \
+ typedef ttrait< jint, C, \
+ _jtie_jint_Enum \
+ > ttrait_##J##_iv; \
+ typedef ttrait< jint, C const, \
+ _jtie_jint_Enum \
+ > ttrait_##J##_c_iv;
+
#if 0 // XXX! provisional enum support, introduce strict mapping type
-// aliases for: <primitive-ctype>
-typedef ttrait< jint, int32_t > ttrait_int32;
+ template struct Param< jint, C >; \
+ template struct Result< jint, C >; \
+ template<> struct is_supported_type_mapping< jint, C >{}; // XXX! bad
+
+#define JTIE_INSTANTIATE_CLASS_MAPPING_INFO( J, JCN ) \
+ const char * const J::class_name = JCN; \
+ template struct _jtie_ObjectMapper< J >; \
+ template struct MemberId< _jtie_ObjectMapper< J > >; \
+ template struct MemberIdCache< _jtie_ObjectMapper< J > >;
+#endif // XXX! provisional enum support, introduce strict mapping type
-// aliases for: <const-primitive-ctype>
-typedef ttrait< jint, const int32_t > ttrait_int32_c;
/**
* A helper class template that predicates the supported type conversions
* by presence of specialization.
*/
+/*
template < typename J, typename C >
struct is_valid_enum_type_mapping;
-#endif // XXX! provisional enum support, introduce strict mapping type
+*/
-#define JTIE_DEFINE_ENUM_MAPPING_INFO_AND_TRAITS( J, C ) \
- typedef ttrait< jint, C > ttrait_##J##_iv; \
- typedef ttrait< jint, const C > ttrait_##J##_c_iv;
+#define JTIE_INSTANTIATE_JINT_ENUM_MAPPING_INFO( C )
-// XXX! hack: this puts a coin in the fusebox...
-#define JTIE_INSTANTIATE_JINT_ENUM_MAPPING_INFO( C ) \
- template struct Param< jint, C >; \
- template struct Result< jint, C >; \
- template<> struct is_supported_type_mapping< jint, C >{}; // XXX! bad
+// template struct is_valid_enum_type_mapping< jint, C >;
// ---------------------------------------------------------------------------
-#endif // XXX! provisional enum support, introduce strict mapping type
-
#endif // jtie_tconv_enum_hpp
=== modified file 'storage/ndb/ndbjtie/jtie/include/jtie_tconv_enum_impl.hpp'
--- a/storage/ndb/ndbjtie/jtie/include/jtie_tconv_enum_impl.hpp 2009-11-04 17:28:51 +0000
+++ b/storage/ndb/ndbjtie/jtie/include/jtie_tconv_enum_impl.hpp 2009-11-07 04:40:48 +0000
@@ -29,69 +29,56 @@
#include "jtie_tconv_impl.hpp"
#include "helpers.hpp"
-#if 1 // XXX! provisional enum support, introduce strict mapping type
-
// ---------------------------------------------------------------------------
// Java value <-> C enum conversions
// ---------------------------------------------------------------------------
-// XXX, as of now, we only support Java int <-> C enum mappings
-// XXX this implementation is a provisional hack, for the supported
-// integer conversion is too broad leading to template instantiation
-// ambiguities and also matches jint<->float etc
-
-#if 0 // XXX! provisional enum support, introduce strict mapping type
-// define set of valid enum type mappings
-template < typename C > struct is_valid_enum_type_mapping< jint, C > {};
-
-// extend for const enum specializations
-//template < typename J, typename C >
-//struct is_valid_enum_type_mapping< const J, C > {};
-//template < typename J, typename C >
-//struct is_valid_enum_type_mapping< J, const C > {};
-//template < typename J, typename C >
-//struct is_valid_enum_type_mapping< const J, const C > {};
+// currently, only Java int <-> C enum mappings are supported
// Implements enum parameter conversions.
template< typename J, typename C >
struct ParamEnumT {
+ // ok to pass J by value
static C
convert(cstatus & s, J j, JNIEnv * env) {
TRACE("C ParamEnumT.convert(cstatus &, J, JNIEnv *)");
+ (void)env;
s = 0;
- return j;
+ return static_cast< C >(j.value);
}
static void
release(C c, J j, JNIEnv * env) {
TRACE("void ParamEnumT.release(C, J, JNIEnv *)");
+ (void)c; (void)j; (void)env;
}
private:
// prohibit instantiation
ParamEnumT() {
// prohibit unsupported template specializations
- is_valid_enum_type_mapping< J, C >();
+ /* is_valid_enum_type_mapping< J, C >(); */
}
};
// Implements enum type result conversions.
template< typename J, typename C >
struct ResultEnumT {
+ // ok to return J by value
static J
convert(C c, JNIEnv * env) {
TRACE("J ResultEnumT.convert(C, JNIEnv *)");
- return c;
+ (void)env;
+ return static_cast< J >(c);
}
private:
// prohibit instantiation
ResultEnumT() {
// prohibit unsupported template specializations
- is_valid_enum_type_mapping< J, C >();
+ /* is_valid_enum_type_mapping< J, C >(); */
}
};
-#endif // XXX! provisional enum support, introduce strict mapping type
// ---------------------------------------------------------------------------
// Specializations for integral <-> enum type conversions
@@ -101,9 +88,33 @@ private:
// template instantiation ambiguities for non-enum types. Therefore,
// we enumerate all specicializations for enum types.
+/*
+// define set of valid enum type mappings
+template < typename C >
+struct is_valid_enum_type_mapping< _jtie_jint_Enum, C > {};
+
+// extend for const enum specializations
+template < typename J, typename C >
+struct is_valid_enum_type_mapping< const J, C > {};
+template < typename J, typename C >
+struct is_valid_enum_type_mapping< J, const C > {};
+template < typename J, typename C >
+struct is_valid_enum_type_mapping< const J, const C > {};
+*/
+
+// non-const enum value parameter types
+template< typename C >
+struct Param< _jtie_jint_Enum, C >
+ : ParamEnumT< _jtie_jint_Enum, C > {};
+
+// non-const enum value result types
+template< typename C >
+struct Result< _jtie_jint_Enum, C >
+ : ResultEnumT< _jtie_jint_Enum, C > {};
+
+#if 0 // XXX HACK -- tmp support for enums
// non-const enum parameter types
//template< typename C > struct Param< jint, C > : ParamEnumT< jint, C > {};
-#if 1 // XXX HACK -- tmp support for enums
template< typename J, typename C >
C
Param< J, C >::convert(cstatus & s, J j, JNIEnv * env)
@@ -111,11 +122,10 @@ Param< J, C >::convert(cstatus & s, J j,
TRACE("C Param.convert(cstatus &, J, JNIEnv *)");
(void)env;
s = 0;
- return static_cast< C >(j);
+ // XXX assert(static_cast< J >(static_cast< C >(j)) == j);
+ return static_cast< C >(j); // XXX check why necessary when fixed enums
}
-#endif // XXX HACK -- tmp support for enums
-#if 1 // XXX HACK -- tmp support for enums
template< typename J, typename C >
void
Param< J, C >::release(C c, J j, JNIEnv * env)
@@ -123,23 +133,21 @@ Param< J, C >::release(C c, J j, JNIEnv
TRACE("void Param.release(C, J, JNIEnv *)");
(void)c; (void)j; (void)env;
}
-#endif // XXX HACK -- tmp support for enums
// non-const enum result types
//template< typename C > struct Result< jint, C > : ResultEnumT< jint, C > {};
-#if 1 // XXX HACK -- tmp support for enums
template< typename J, typename C >
J
Result< J, C >::convert(C c, JNIEnv * env)
{
TRACE("J Result.convert(C, JNIEnv *)");
(void)env;
- return c;
+ return static_cast< J >(c);
+ // XXX assert(static_cast< C >(static_cast< J >(c)) == c);
+ return static_cast< J >(c); // XXX check why necessary when fixed enums
}
#endif // XXX HACK -- tmp support for enums
// ---------------------------------------------------------------------------
-#endif // XXX! provisional enum support, introduce strict mapping type
-
#endif // jtie_tconv_enum_impl_hpp
=== modified file 'storage/ndb/ndbjtie/jtie/include/jtie_tconv_impl.hpp'
--- a/storage/ndb/ndbjtie/jtie/include/jtie_tconv_impl.hpp 2009-09-18 20:40:07 +0000
+++ b/storage/ndb/ndbjtie/jtie/include/jtie_tconv_impl.hpp 2009-11-07 04:40:48 +0000
@@ -30,6 +30,15 @@
// Java <-> C type conversions
// ---------------------------------------------------------------------------
+// Design rationale:
+//
+// The classes here only document prototypes, no functions are declared
+// or defined here, in order to have undefined type mappings result in a
+// compilation error. A better option might be to use static_assert()
+// when made available in upcoming C++0x. Alternatively, other patterns
+// could be looked at for specifying and mandating specialization
+// (a possible candidate: the Curiosly Recurring Template Pattern).
+
/*
* A type conversion status type.
*/
@@ -48,9 +57,9 @@ template < typename J, typename C > stru
* A class template with static functions for conversion of parameter data
* (Java <-> C++).
*
- * As a safety fallback, this class only provides prototypes (no functions
- * are defined) in order to have undefined type mappings result in
- * unresolved symbols during linking.
+ * This class only documents prototypes, no functions are declared or
+ * defined here, in order to have undefined type mappings result in a
+ * compilation error.
*/
template< typename J, typename C >
struct Param {
@@ -73,8 +82,16 @@ struct Param {
* - no other convert() or the C delegate function must be called
* - the corresponding release() function must not be called
*/
+#if 0 // disabled on purpose, only document function
static C
- convert(cstatus & s, J j, JNIEnv * env);
+ convert(cstatus & s, J j, JNIEnv * env) {
+ TRACE("C Param.convert(cstatus &, J, JNIEnv *)");
+ (void)j; (void)env;
+ s = 1;
+ static_assert(false, "missing specialization of parameter conversion");
+ return 0;
+ }
+#endif // disabled on purpose, only document function
/**
* Releases any resources allocated by the corresponding convert() call.
@@ -100,8 +117,14 @@ struct Param {
* - DeleteWeakGlobalRef
* - MonitorExit
*/
+#if 0 // disabled on purpose, only document function
static void
- release(C c, J j, JNIEnv * env);
+ release(C c, J j, JNIEnv * env) {
+ TRACE("void Param.release(C, J, JNIEnv *)");
+ (void)c; (void)j; (void)env;
+ static_assert(false, "missing specialization of parameter conversion");
+ }
+#endif // disabled on purpose, only document function
private:
// prohibit instantiation
@@ -120,9 +143,9 @@ private:
* (instantiated with a direct class type, not pointer or reference), which
* make Target incompatible to derive from Param.
*
- * As a safety fallback, this class only provides prototypes (no functions
- * are defined) in order to have undefined type mappings result in
- * unresolved symbols during linking.
+ * This class only documents prototypes, no functions are declared or
+ * defined here, in order to have undefined type mappings result in a
+ * compilation error.
*/
template< typename J, typename C >
struct Target {
@@ -132,16 +155,30 @@ struct Target {
*
* Pre + Post conditions: same as Param< J, C >::convert.
*/
+#if 0 // disabled on purpose, only document function
static C &
- convert(cstatus & s, J j, JNIEnv * env);
+ convert(cstatus & s, J j, JNIEnv * env) {
+ TRACE("C & Target.convert(cstatus &, J, JNIEnv *)");
+ (void)j; (void)env;
+ s = 1;
+ static_assert(false, "missing specialization of target conversion");
+ return 0;
+ }
+#endif // disabled on purpose, only document function
/**
* Releases any resources allocated by the corresponding convert() call.
*
* Pre + Post conditions: same as Param< J, C >::release.
*/
+#if 0 // disabled on purpose, only document function
static void
- release(C & c, J j, JNIEnv * env);
+ release(C & c, J j, JNIEnv * env) {
+ TRACE("void Target.release(C &, J, JNIEnv *)");
+ (void)c; (void)j; (void)env;
+ static_assert(false, "missing specialization of target conversion");
+ }
+#endif // disabled on purpose, only document function
private:
// prohibit instantiation
@@ -153,11 +190,11 @@ private:
/**
* A class template with static functions for conversion of function call
- * or data access result data (C++ -> Java).
+ * or data access result data (Java <- C++).
*
- * As a safety fallback, this class only provides prototypes (no functions
- * are defined) in order to have undefined type mappings result in
- * unresolved symbols during linking.
+ * This class only documents prototypes, no functions are declared or
+ * defined here, in order to have undefined type mappings result in a
+ * compilation error.
*/
template< typename J, typename C >
struct Result {
@@ -174,8 +211,15 @@ struct Result {
* In other words, any errors during the result conversion must be
* signaled by registering a Java exception with the VM.
*/
+#if 0 // disabled on purpose, only document function
static J
- convert(C c, JNIEnv * env);
+ convert(C c, JNIEnv * env) {
+ TRACE("J Result.convert(C, JNIEnv *)");
+ (void)c; (void)env;
+ static_assert(false, "missing specialization of result conversion");
+ return 0;
+ }
+#endif // disabled on purpose, only document function
private:
// prohibit instantiation
@@ -185,7 +229,7 @@ private:
}
};
-// Design note:
+// Lessons learned:
//
// Basing the type conversion code on class templates rather than loose
// function templates allows for:
@@ -208,11 +252,19 @@ private:
//
// Examples: 'int const', 'A * const' (does not apply to 'const A *')
+// XXX ambigous with enums
+//template< typename J, typename C >
+//struct Param< J, C const > : Param< J, C > {};
+//
+//template< typename J, typename C >
+//struct Result< J, C const > : Result< J, C > {};
+
+// XXX untested
template< typename J, typename C >
-struct Param< J, C const > : Param< J, C > {};
+struct Param< J const, C > : Param< J, C > {};
template< typename J, typename C >
-struct Result< J, C const > : Result< J, C > {};
+struct Result< J const, C > : Result< J, C > {};
// ---------------------------------------------------------------------------
// formal <-> actual parameter/result type casts
=== modified file 'storage/ndb/ndbjtie/jtie/include/jtie_tconv_object_impl.hpp'
--- a/storage/ndb/ndbjtie/jtie/include/jtie_tconv_object_impl.hpp 2009-11-04 17:28:51 +0000
+++ b/storage/ndb/ndbjtie/jtie/include/jtie_tconv_object_impl.hpp 2009-11-07 04:40:48 +0000
@@ -37,12 +37,7 @@
// ObjectParam, Target, ObjectResult
// ---------------------------------------------------------------------------
-// XXX consider changing
-//template< typename C > struct ObjectParam< jtie_Object, C * > {
-// to
-//template< typename J, typename C > struct ObjectParam< J *, C * > {
-//
-// same for Target, Result
+// XXX cleanup, document
// Defines the field info type for Wrapper.cdelegate.
JTIE_DEFINE_FIELD_MEMBER_INFO(_Wrapper_cdelegate)
@@ -56,40 +51,24 @@ typedef JniMemberId< WEAK_CACHING, _Wrap
//typedef JniMemberId< WEAK_CACHING_PRELOAD, _Wrapper_cdelegate > Wrapper_cdelegate;
//typedef JniMemberId< STRONG_CACHING_PRELOAD, _Wrapper_cdelegate > Wrapper_cdelegate;
-// XXX cleanup, document
+// XXX consider changing
+//template< typename C > struct ObjectParam< jtie_Object, C * > {
+// to
+//template< typename J, typename C > struct ObjectParam< J *, C * > {
+//
+// same for Target, Result
-// Nullifies a Wrapper object's stored address of the native delegate.
-inline void
-detachWrapper(jtie_Object jo, JNIEnv * env) {
- // get a (local or global) class object reference
- // as a precaution, do not use env->GetObjectClass(jobject), for we
- // never want to access a field from a subclass that hides the delegate
- // field in Wrapper
- jclass cls = Wrapper_cdelegate::getClass(env);
- if (cls == NULL) {
- // exception pending
- } else {
- // get the field ID valid along with the class reference
- jfieldID fid = Wrapper_cdelegate::getId(env, cls);
- if (fid == NULL) {
- // exception pending
- } else {
- // convert address to a jlong via intptr_t (C99)
- //printf(" p = %p\n", c);
- intptr_t ip = 0; //reinterpret_cast< intptr_t >((void*)NULL);
- jlong p = static_cast< jlong >(ip);
- assert(static_cast< intptr_t >(p) == ip);
+// Implements the mapping of jtie_Objects parameters.
+template< typename J, typename C >
+struct ObjectParam;
- // set the field's value
- env->SetLongField(jo, fid, p);
- }
- // release reference (if needed)
- Wrapper_cdelegate::releaseRef(env, cls);
- }
-}
+// Implements the mapping of jtie_Object invocation targets.
+template< typename J, typename C >
+struct Target;
-// Implements the mapping of jtie_Objects parameters.
-template< typename J, typename C > struct ObjectParam;
+// Implements the mapping of jtie_Object results.
+template< typename J, typename C >
+struct ObjectResult;
// Implements the mapping of jtie_Objects parameters to pointers.
template< typename C >
@@ -119,9 +98,10 @@ struct ObjectParam< jtie_Object, C * > {
//printf(" c = %lx\n", (unsigned long)p);
if (p == 0L) {
const char * m
- = ("NDB JTie: Java wrapper object must have a"
+ = ("JTie: Java wrapper object must have a"
" non-zero delegate when used as target or"
- " in a method call (file: " __FILE__ ")");
+ " argument in a method call"
+ " (file: " __FILE__ ")");
registerException(env, "java/lang/AssertionError", m);
} else {
// convert jlong to an address via intptr_t (C99)
@@ -160,7 +140,7 @@ struct ObjectParam< jtie_Object, C & > {
if (j == NULL) {
const char * msg
- = ("NDB JTie: Java argument must not be null when mapped"
+ = ("JTie: Java argument must not be null when mapped"
" to a C reference (file: " __FILE__ ")");
registerException(env, "java/lang/IllegalArgumentException", msg);
} else {
@@ -177,9 +157,6 @@ struct ObjectParam< jtie_Object, C & > {
};
};
-// XXX Implements the mapping of jtie_Object invocation targets.
-template< typename J, typename C > struct Target;
-
// Implements the mapping of jtie_Object invocation targets.
template< typename C >
struct Target< jtie_Object, C > {
@@ -190,13 +167,13 @@ struct Target< jtie_Object, C > {
C * c = NULL;
if (j == NULL) {
- const char * msg = ("NDB JTie: Java target object of a method call"
+ const char * msg = ("JTie: Java target object of a method call"
" must not be null (file: " __FILE__ ")");
registerException(env, "java/lang/NullPointerException", msg);
} else {
// to avoid template instantiation clutter and ambiguities
// specialize/delegate to either ObjectParam< jtie_Object, C * >
- // (preferred since smaller space) or Param< J *, C * >
+ // (preferred for smaller type space) or Param< J *, C * >
c = ObjectParam< jtie_Object, C * >::convert(s, j, env);
assert(s != 0 || c != NULL);
}
@@ -211,55 +188,9 @@ struct Target< jtie_Object, C > {
};
};
-// Constructs a Wrapper object of user-defined type.
-template< typename J, typename C >
-inline J *
-wrapAsJavaObject(jclass cls, jmethodID cid, C * c, JNIEnv * env) {
- J * j = NULL;
-
- // get a (local or global) class object reference
- // as a precaution, do not use parameter cls, for we never want to access
- // a field from a subclass that hides the delegate field in Wrapper
- jclass cls0 = Wrapper_cdelegate::getClass(env);
- if (cls0 == NULL) {
- // exception pending
- } else {
- // get the field ID valid along with the class reference
- jfieldID fid = Wrapper_cdelegate::getId(env, cls0);
- if (fid == NULL) {
- // exception pending
- } else {
- // construct a Wrapper object
- jobject jo = env->NewObject(cls, cid);
- if (jo == NULL) {
- // exception pending
- } else {
- // convert address to a jlong via intptr_t (C99)
- //printf(" p = %p\n", c);
- intptr_t ip = reinterpret_cast< intptr_t >(c);
- jlong p = static_cast< jlong >(ip);
- assert(static_cast< intptr_t >(p) == ip);
-
- // set the field's value
- env->SetLongField(jo, fid, p);
-
- // ok
- j = static_cast< J * >(jo);
- }
- }
- // release reference (if needed)
- Wrapper_cdelegate::releaseRef(env, cls0);
- }
- return j;
-}
-
-// Implements the mapping of jtie_Object results.
-template< typename J, typename C > struct ObjectResult;
-
// Implements the mapping of jtie_Object results to pointers.
template< typename J, typename C >
-struct ObjectResult< J *, C * > {
-
+struct ObjectResult< J *, C * > {
// Provides a (cached) access to the method Id of the constructor of J.
//typedef JniMemberId< NO_CACHING, J > J_ctor;
typedef JniMemberId< WEAK_CACHING, J > J_ctor;
@@ -283,7 +214,8 @@ struct ObjectResult< J *, C * > {
if (cid == NULL) {
// exception pending
} else {
- J * jo = wrapAsJavaObject< J, C >(cls, cid, c, env);
+
+ J * jo = wrapAsJavaObject(cls, cid, c, env);
if (jo == NULL) {
// exception pending
} else {
@@ -297,6 +229,11 @@ struct ObjectResult< J *, C * > {
}
return j;
}
+
+private:
+ // Constructs a Wrapper object of user-defined type.
+ static J *
+ wrapAsJavaObject(jclass cls, jmethodID cid, C * c, JNIEnv * env);
};
// Implements the mapping of jtie_Object results to references.
@@ -310,7 +247,7 @@ struct ObjectResult< J *, C & > {
if (p == NULL) {
const char * msg
- = ("NDB JTie: returned C reference must not be null"
+ = ("JTie: returned C reference must not be null"
" (e.g., check if memory allocation has failed without"
" raising an exception, as can happen with older C++"
" compilers?) (file: " __FILE__ ")");
@@ -324,9 +261,94 @@ struct ObjectResult< J *, C & > {
};
// ---------------------------------------------------------------------------
+// Helper functions
+// ---------------------------------------------------------------------------
+
+// Nullifies a Wrapper object's stored address of the native delegate.
+inline void
+detachWrapper(jtie_Object jo, JNIEnv * env) {
+ // get a (local or global) class object reference
+ // as a precaution, do not use env->GetObjectClass(jobject), for we
+ // never want to access a field from a subclass that hides the delegate
+ // field in Wrapper
+ jclass cls = Wrapper_cdelegate::getClass(env);
+ if (cls == NULL) {
+ // exception pending
+ } else {
+ // get the field ID valid along with the class reference
+ jfieldID fid = Wrapper_cdelegate::getId(env, cls);
+ if (fid == NULL) {
+ // exception pending
+ } else {
+ // convert address to a jlong via intptr_t (C99)
+ //printf(" p = %p\n", c);
+ intptr_t ip = 0; //reinterpret_cast< intptr_t >((void*)NULL);
+ jlong p = static_cast< jlong >(ip);
+ assert(static_cast< intptr_t >(p) == ip);
+
+ // set the field's value
+ env->SetLongField(jo, fid, p);
+ }
+ // release reference (if needed)
+ Wrapper_cdelegate::releaseRef(env, cls);
+ }
+}
+
+// Constructs a Wrapper object of user-defined type.
+template< typename J, typename C >
+inline J *
+ObjectResult< J *, C * >::
+wrapAsJavaObject(jclass cls, jmethodID cid, C * c, JNIEnv * env) {
+ J * j = NULL;
+
+ // get a (local or global) class object reference
+ // as a precaution, do not use parameter cls, for we never want to access
+ // a field from a subclass that hides the delegate field in Wrapper
+ jclass cls0 = Wrapper_cdelegate::getClass(env);
+ if (cls0 == NULL) {
+ // exception pending
+ } else {
+ // get the field ID valid along with the class reference
+ jfieldID fid = Wrapper_cdelegate::getId(env, cls0);
+ if (fid == NULL) {
+ // exception pending
+ } else {
+ // construct a Wrapper object
+ jobject jo = env->NewObject(cls, cid);
+ if (jo == NULL) {
+ // exception pending
+ } else {
+ // convert address to a jlong via intptr_t (C99)
+ //printf(" p = %p\n", c);
+ intptr_t ip = reinterpret_cast< intptr_t >(c);
+ jlong p = static_cast< jlong >(ip);
+ assert(static_cast< intptr_t >(p) == ip);
+
+ // set the field's value
+ env->SetLongField(jo, fid, p);
+
+ // ok
+ j = static_cast< J * >(jo);
+ }
+ }
+ // release reference (if needed)
+ Wrapper_cdelegate::releaseRef(env, cls0);
+ }
+ return j;
+}
+
+// ---------------------------------------------------------------------------
// Specializations for Object type conversions
// ---------------------------------------------------------------------------
+// extend jtie_Object specializations to const pointers
+template< typename J, typename C >
+struct Param< _jtie_ObjectMapper< J > *, C * const >
+ : Param< _jtie_ObjectMapper< J > *, C * > {};
+template< typename J, typename C >
+struct Result< _jtie_ObjectMapper< J > *, C * const >
+ : Result< _jtie_ObjectMapper< J > *, C * > {};
+
// Sufficient to specialize Param<> and Target<> over jtie_Object.
// specialize Target (note usage of C, which is a direct type)
=== modified file 'storage/ndb/ndbjtie/jtie/include/jtie_tconv_ptrbybb_impl.hpp'
--- a/storage/ndb/ndbjtie/jtie/include/jtie_tconv_ptrbybb_impl.hpp 2009-11-04 17:28:51 +0000
+++ b/storage/ndb/ndbjtie/jtie/include/jtie_tconv_ptrbybb_impl.hpp 2009-11-07 04:40:48 +0000
@@ -77,6 +77,117 @@ typedef JniMemberId< WEAK_CACHING, _Byte
// ---------------------------------------------------------------------------
+// helper functions
+
+inline cstatus
+ensureMutableBuffer(jtie_j_n_ByteBuffer jbb, JNIEnv * env);
+
+template< jlong N >
+inline cstatus
+ensureMinBufferSize(jtie_j_n_ByteBuffer jbb, JNIEnv * env);
+
+inline int32_t
+getBufferPosition(jtie_j_n_ByteBuffer jbb, JNIEnv * env);
+
+inline void *
+getByteBufferAddress(jtie_j_n_ByteBuffer jbb, JNIEnv * env);
+
+template< typename J >
+inline J *
+wrapAddressAsByteBuffer(const void * c, JNIEnv * env);
+
+template< typename J >
+inline J *
+wrapByteBufferAsReadOnly(J * jbb, JNIEnv * env);
+
+// ---------------------------------------------------------------------------
+
+// Implements the mapping of ByteBuffers to pointer parameters.
+template< typename J, typename C >
+struct ByteBufferPtrParam {
+
+ static C *
+ convert(cstatus & s, jtie_j_n_ByteBuffer j, JNIEnv * env) {
+ TRACE("C * ByteBufferPtrParam.convert(cstatus &, jtie_j_n_ByteBuffer, JNIEnv *)");
+
+ // init return value and status to error
+ s = -1;
+ C * c = NULL;
+
+ if (j == NULL) {
+ // ok
+ s = 0;
+ } else {
+ if (TypeInfo< C >::isMutable()
+ && (ensureMutableBuffer(j, env) != 0)) {
+ // exception pending
+ } else {
+ if (ensureMinBufferSize< J::capacity >(j, env) != 0) {
+ // exception pending
+ } else {
+ assert(env->GetDirectBufferCapacity(j) >= J::capacity);
+ void * a = getByteBufferAddress(j, env);
+ if (a == NULL) {
+ // exception pending
+ } else {
+ // ok
+ s = 0;
+ c = static_cast<C *>(a);
+ }
+ }
+ }
+ }
+ return c;
+ }
+
+ static void
+ release(C * c, jtie_j_n_ByteBuffer j, JNIEnv * env) {
+ TRACE("void ByteBufferPtrParam.release(C *, jtie_j_n_ByteBuffer, JNIEnv *)");
+ (void)c; (void)j; (void)env;
+ }
+};
+
+// Implements the mapping of ByteBuffers to pointer results.
+template< typename J, typename C >
+struct ByteBufferPtrResult {
+ static J *
+ convert(C * c, JNIEnv * env) {
+ TRACE("J * ByteBufferPtrResult.convert(C *, JNIEnv *)");
+
+ // init return value to error
+ J * j = NULL;
+
+ if (c == NULL) {
+ // ok
+ } else {
+ J * jbb = wrapAddressAsByteBuffer< J >(c, env);
+ if (jbb == NULL) {
+ // exception pending
+ } else {
+ assert(env->GetDirectBufferCapacity(jbb) == J::capacity);
+ if (TypeInfo< C >::isMutable()) {
+ // ok
+ j = jbb;
+ } else {
+ J * jrobb = wrapByteBufferAsReadOnly(jbb, env);
+ if (jrobb == NULL) {
+ // exception pending
+ } else {
+ // ok
+ j = jrobb;
+ }
+ env->DeleteLocalRef(jbb);
+ }
+ }
+ }
+ return j;
+ }
+};
+
+// ---------------------------------------------------------------------------
+// Helper functions
+// ---------------------------------------------------------------------------
+
// Returns zero if a buffer is read-only; otherwise, an exception is pending.
inline cstatus
ensureMutableBuffer(jtie_j_n_ByteBuffer jbb, JNIEnv * env) {
@@ -254,51 +365,6 @@ getByteBufferAddress(jtie_j_n_ByteBuffer
return a;
}
-// Implements the mapping of ByteBuffers to pointer parameters.
-template< typename J, typename C >
-struct ByteBufferPtrParam {
-
- static C *
- convert(cstatus & s, jtie_j_n_ByteBuffer j, JNIEnv * env) {
- TRACE("C * ByteBufferPtrParam.convert(cstatus &, jtie_j_n_ByteBuffer, JNIEnv *)");
-
- // init return value and status to error
- s = -1;
- C * c = NULL;
-
- if (j == NULL) {
- // ok
- s = 0;
- } else {
- if (TypeInfo< C >::isMutable()
- && (ensureMutableBuffer(j, env) != 0)) {
- // exception pending
- } else {
- if (ensureMinBufferSize< J::capacity >(j, env) != 0) {
- // exception pending
- } else {
- assert(env->GetDirectBufferCapacity(j) >= J::capacity);
- void * a = getByteBufferAddress(j, env);
- if (a == NULL) {
- // exception pending
- } else {
- // ok
- s = 0;
- c = static_cast<C *>(a);
- }
- }
- }
- }
- return c;
- }
-
- static void
- release(C * c, jtie_j_n_ByteBuffer j, JNIEnv * env) {
- TRACE("void ByteBufferPtrParam.release(C *, jtie_j_n_ByteBuffer, JNIEnv *)");
- (void)c; (void)j; (void)env;
- }
-};
-
// Constructs a fixed-length, direct ByteBuffer wrapping an address.
template< typename J >
inline J *
@@ -348,71 +414,48 @@ wrapByteBufferAsReadOnly(J * jbb, JNIEnv
return j;
}
-// Implements the mapping of ByteBuffers to pointer results.
-template< typename J, typename C >
-struct ByteBufferPtrResult {
- static J *
- convert(C * c, JNIEnv * env) {
- TRACE("J * ByteBufferPtrResult.convert(C *, JNIEnv *)");
-
- // init return value to error
- J * j = NULL;
-
- if (c == NULL) {
- // ok
- } else {
- J * jbb = wrapAddressAsByteBuffer< J >(c, env);
- if (jbb == NULL) {
- // exception pending
- } else {
- assert(env->GetDirectBufferCapacity(jbb) == J::capacity);
- if (TypeInfo< C >::isMutable()) {
- // ok
- j = jbb;
- } else {
- J * jrobb = wrapByteBufferAsReadOnly(jbb, env);
- if (jrobb == NULL) {
- // exception pending
- } else {
- // ok
- j = jrobb;
- }
- env->DeleteLocalRef(jbb);
- }
- }
- }
- return j;
- }
-};
-
// ---------------------------------------------------------------------------
// Specializations for ByteBuffer type conversions
// ---------------------------------------------------------------------------
-// for ByteBuffers mapped to pointers/arrays, do not require a minimum
-// buffer capacity, for size may be zero when just passing an address
+// extend ByteBuffer specializations to const pointers
template< typename C >
-struct Param< jtie_j_n_ByteBuffer, C * >
- : ByteBufferPtrParam< _jtie_j_n_BoundedByteBuffer< 0 >, C > {};
+struct Param< jtie_j_n_ByteBuffer, C * const >
+ : Param< jtie_j_n_ByteBuffer, C * > {};
+template< typename C >
+struct Result< jtie_j_n_ByteBuffer, C * const >
+ : Result< jtie_j_n_ByteBuffer, C * > {};
+template< typename J, typename C >
+struct Param< _jtie_j_n_ByteBufferMapper< J > *, C * const >
+ : Param< _jtie_j_n_ByteBufferMapper< J > *, C * > {};
+template< typename J, typename C >
+struct Result< _jtie_j_n_ByteBufferMapper< J > *, C * const >
+ : Result< _jtie_j_n_ByteBufferMapper< J > *, C * > {};
-// for BoundedByteBuffers mapped to pointers/arrays, require a minimum
-// buffer capacity of the BoundedByteBuffer's static data member
+// specialize BoundedByteBuffers mapped to pointers/arrays:
+// - params: require a minimum buffer capacity given by the
+// BoundedByteBuffer's static data member
+// - results: allocate buffer with a capacity given by the
+// BoundedByteBuffer's static data member
template< typename J, typename C >
struct Param< _jtie_j_n_ByteBufferMapper< J > *, C * >
: ByteBufferPtrParam< _jtie_j_n_ByteBufferMapper< J >, C > {};
+template< typename J, typename C >
+struct Result< _jtie_j_n_ByteBufferMapper< J > *, C * >
+ : ByteBufferPtrResult< _jtie_j_n_ByteBufferMapper< J >, C > {};
-// for ByteBuffers mapped to pointers/arrays, allocate buffer with a capacity
-// of zero, since the size is unknown (i.e., just returning an address)
+// specialize ByteBuffers mapped to pointers/arrays:
+// - params: do not require a minimum buffer capacity, for size may be zero
+// when just passing an address
+// - results: allocate buffer with a capacity of zero, since the size is
+// unknown (i.e., just returning an address)
+template< typename C >
+struct Param< jtie_j_n_ByteBuffer, C * >
+ : ByteBufferPtrParam< _jtie_j_n_BoundedByteBuffer< 0 >, C > {};
template< typename C >
struct Result< jtie_j_n_ByteBuffer, C * >
: ByteBufferPtrResult< _jtie_j_n_BoundedByteBuffer< 0 >, C > {};
-// for BoundedByteBuffers mapped to pointers/arrays, allocate buffer with
-// a capacity of the BoundedByteBuffer's static data member
-template< typename J, typename C >
-struct Result< _jtie_j_n_ByteBufferMapper< J > *, C * >
- : ByteBufferPtrResult< _jtie_j_n_ByteBufferMapper< J >, C > {};
-
// ---------------------------------------------------------------------------
#endif // jtie_tconv_ptrbybb_impl_hpp
=== modified file 'storage/ndb/ndbjtie/jtie/include/jtie_tconv_ptrbyval.hpp'
--- a/storage/ndb/ndbjtie/jtie/include/jtie_tconv_ptrbyval.hpp 2009-10-27 06:56:52 +0000
+++ b/storage/ndb/ndbjtie/jtie/include/jtie_tconv_ptrbyval.hpp 2009-11-07 04:40:48 +0000
@@ -26,7 +26,6 @@
#include <jni.h>
#include "jtie_tconv.hpp"
-#include "jtie_tconv_vwidth.hpp"
// ---------------------------------------------------------------------------
// Java array <-> C array/pointer type conversions
@@ -58,26 +57,6 @@ typedef ttrait< jlongArray, uint64_t * >
typedef ttrait< jfloatArray, float * > ttrait_float_0p_a;
typedef ttrait< jdoubleArray, double * > ttrait_double_0p_a;
-#ifdef JTIE_JNI_SHORT_ARRAY_T
-typedef ttrait< JTIE_JNI_SHORT_ARRAY_T *, signed short * > ttrait_short_0p_a;
-typedef ttrait< JTIE_JNI_SHORT_ARRAY_T *, unsigned short * > ttrait_ushort_0p_a;
-#endif
-#ifdef JTIE_JNI_INT_ARRAY_T
-typedef ttrait< JTIE_JNI_INT_ARRAY_T *, signed int * > ttrait_int_0p_a;
-typedef ttrait< JTIE_JNI_INT_ARRAY_T *, unsigned int * > ttrait_uint_0p_a;
-#endif
-#ifdef JTIE_JNI_LONG_ARRAY_T
-typedef ttrait< JTIE_JNI_LONG_ARRAY_T *, signed long * > ttrait_long_0p_a;
-typedef ttrait< JTIE_JNI_LONG_ARRAY_T *, unsigned long * > ttrait_ulong_0p_a;
-#endif
-#ifdef JTIE_JNI_LONGLONG_ARRAY_T
-typedef ttrait< JTIE_JNI_LONGLONG_ARRAY_T *, signed long long * > ttrait_longlong_0p_a;
-typedef ttrait< JTIE_JNI_LONGLONG_ARRAY_T *, unsigned long long * > ttrait_ulonglong_0p_a;
-#endif
-#ifdef JTIE_JNI_LONGDOUBLE_ARRAY_T
-typedef ttrait< JTIE_JNI_LONGDOUBLE_ARRAY_T *, long double * > ttrait_longdouble_0p_a;
-#endif
-
// aliases for: <const-primitive-ctype>_<pointer>_<Array<size=0>>
typedef ttrait< jbooleanArray, const bool * > ttrait_bool_0cp_a;
typedef ttrait< jbyteArray, const char * > ttrait_char_0cp_a;
@@ -92,26 +71,6 @@ typedef ttrait< jlongArray, const uint64
typedef ttrait< jfloatArray, const float * > ttrait_float_0cp_a;
typedef ttrait< jdoubleArray, const double * > ttrait_double_0cp_a;
-#ifdef JTIE_JNI_SHORT_ARRAY_T
-typedef ttrait< JTIE_JNI_SHORT_ARRAY_T *, const signed short * > ttrait_short_0cp_a;
-typedef ttrait< JTIE_JNI_SHORT_ARRAY_T *, const unsigned short * > ttrait_ushort_0cp_a;
-#endif
-#ifdef JTIE_JNI_INT_ARRAY_T
-typedef ttrait< JTIE_JNI_INT_ARRAY_T *, const signed int * > ttrait_int_0cp_a;
-typedef ttrait< JTIE_JNI_INT_ARRAY_T *, const unsigned int * > ttrait_uint_0cp_a;
-#endif
-#ifdef JTIE_JNI_LONG_ARRAY_T
-typedef ttrait< JTIE_JNI_LONG_ARRAY_T *, const signed long * > ttrait_long_0cp_a;
-typedef ttrait< JTIE_JNI_LONG_ARRAY_T *, const unsigned long * > ttrait_ulong_0cp_a;
-#endif
-#ifdef JTIE_JNI_LONGLONG_ARRAY_T
-typedef ttrait< JTIE_JNI_LONGLONG_ARRAY_T *, const signed long long * > ttrait_longlong_0cp_a;
-typedef ttrait< JTIE_JNI_LONGLONG_ARRAY_T *, const unsigned long long * > ttrait_ulonglong_0cp_a;
-#endif
-#ifdef JTIE_JNI_LONGDOUBLE_ARRAY_T
-typedef ttrait< JTIE_JNI_LONGDOUBLE_ARRAY_T *, const long double * > ttrait_longdouble_0cp_a;
-#endif
-
// aliases for: <primitive-ctype>_<pointer>_<Array<size=0>>
typedef ttrait< jbooleanArray, bool * const > ttrait_bool_0pc_a;
typedef ttrait< jbyteArray, char * const > ttrait_char_0pc_a;
@@ -126,26 +85,6 @@ typedef ttrait< jlongArray, uint64_t * c
typedef ttrait< jfloatArray, float * const > ttrait_float_0pc_a;
typedef ttrait< jdoubleArray, double * const > ttrait_double_0pc_a;
-#ifdef JTIE_JNI_SHORT_ARRAY_T
-typedef ttrait< JTIE_JNI_SHORT_ARRAY_T *, signed short * const > ttrait_short_0pc_a;
-typedef ttrait< JTIE_JNI_SHORT_ARRAY_T *, unsigned short * const > ttrait_ushort_0pc_a;
-#endif
-#ifdef JTIE_JNI_INT_ARRAY_T
-typedef ttrait< JTIE_JNI_INT_ARRAY_T *, signed int * const > ttrait_int_0pc_a;
-typedef ttrait< JTIE_JNI_INT_ARRAY_T *, unsigned int * const > ttrait_uint_0pc_a;
-#endif
-#ifdef JTIE_JNI_LONG_ARRAY_T
-typedef ttrait< JTIE_JNI_LONG_ARRAY_T *, signed long * const > ttrait_long_0pc_a;
-typedef ttrait< JTIE_JNI_LONG_ARRAY_T *, unsigned long * const > ttrait_ulong_0pc_a;
-#endif
-#ifdef JTIE_JNI_LONGLONG_ARRAY_T
-typedef ttrait< JTIE_JNI_LONGLONG_ARRAY_T *, signed long long * const > ttrait_longlong_0pc_a;
-typedef ttrait< JTIE_JNI_LONGLONG_ARRAY_T *, unsigned long long * const > ttrait_ulonglong_0pc_a;
-#endif
-#ifdef JTIE_JNI_LONGDOUBLE_ARRAY_T
-typedef ttrait< JTIE_JNI_LONGDOUBLE_ARRAY_T *, long double * const > ttrait_longdouble_0pc_a;
-#endif
-
// aliases for: <const-primitive-ctype>_<pointer>_<Array<size=0>>
typedef ttrait< jbooleanArray, const bool * const > ttrait_bool_0cpc_a;
typedef ttrait< jbyteArray, const char * const > ttrait_char_0cpc_a;
@@ -160,26 +99,6 @@ typedef ttrait< jlongArray, const uint64
typedef ttrait< jfloatArray, const float * const > ttrait_float_0cpc_a;
typedef ttrait< jdoubleArray, const double * const > ttrait_double_0cpc_a;
-#ifdef JTIE_JNI_SHORT_ARRAY_T
-typedef ttrait< JTIE_JNI_SHORT_ARRAY_T *, const signed short * const > ttrait_short_0cpc_a;
-typedef ttrait< JTIE_JNI_SHORT_ARRAY_T *, const unsigned short * const > ttrait_ushort_0cpc_a;
-#endif
-#ifdef JTIE_JNI_INT_ARRAY_T
-typedef ttrait< JTIE_JNI_INT_ARRAY_T *, const signed int * const > ttrait_int_0cpc_a;
-typedef ttrait< JTIE_JNI_INT_ARRAY_T *, const unsigned int * const > ttrait_uint_0cpc_a;
-#endif
-#ifdef JTIE_JNI_LONG_ARRAY_T
-typedef ttrait< JTIE_JNI_LONG_ARRAY_T *, const signed long * const > ttrait_long_0cpc_a;
-typedef ttrait< JTIE_JNI_LONG_ARRAY_T *, const unsigned long * const > ttrait_ulong_0cpc_a;
-#endif
-#ifdef JTIE_JNI_LONGLONG_ARRAY_T
-typedef ttrait< JTIE_JNI_LONGLONG_ARRAY_T *, const signed long long * const > ttrait_longlong_0cpc_a;
-typedef ttrait< JTIE_JNI_LONGLONG_ARRAY_T *, const unsigned long long * const > ttrait_ulonglong_0cpc_a;
-#endif
-#ifdef JTIE_JNI_LONGDOUBLE_ARRAY_T
-typedef ttrait< JTIE_JNI_LONGDOUBLE_ARRAY_T *, const long double * const > ttrait_longdouble_0cpc_a;
-#endif
-
// aliases for: <primitive-ctype>_<pointer>_<Array<size=1>>
typedef ttrait< jbooleanArray, bool *, _jtie_j_ArrayMapper< _jtie_j_BoundedArray< _jbooleanArray, 1 > > * > ttrait_bool_1p_a;
typedef ttrait< jbyteArray, char *, _jtie_j_ArrayMapper< _jtie_j_BoundedArray< _jbyteArray, 1 > > * > ttrait_char_1p_a;
@@ -194,26 +113,6 @@ typedef ttrait< jlongArray, uint64_t *,
typedef ttrait< jfloatArray, float *, _jtie_j_ArrayMapper< _jtie_j_BoundedArray< _jfloatArray, 1 > > * > ttrait_float_1p_a;
typedef ttrait< jdoubleArray, double *, _jtie_j_ArrayMapper< _jtie_j_BoundedArray< _jdoubleArray, 1 > > * > ttrait_double_1p_a;
-#ifdef JTIE_JNI_SHORT_ARRAY_T
-typedef ttrait< JTIE_JNI_SHORT_ARRAY_T *, signed short *, _jtie_j_ArrayMapper< _jtie_j_BoundedArray< JTIE_JNI_SHORT_ARRAY_T, 1 > > * > ttrait_short_1p_a;
-typedef ttrait< JTIE_JNI_SHORT_ARRAY_T *, unsigned short *, _jtie_j_ArrayMapper< _jtie_j_BoundedArray< JTIE_JNI_SHORT_ARRAY_T, 1 > > * > ttrait_ushort_1p_a;
-#endif
-#ifdef JTIE_JNI_INT_ARRAY_T
-typedef ttrait< JTIE_JNI_INT_ARRAY_T *, signed int *, _jtie_j_ArrayMapper< _jtie_j_BoundedArray< JTIE_JNI_INT_ARRAY_T, 1 > > * > ttrait_int_1p_a;
-typedef ttrait< JTIE_JNI_INT_ARRAY_T *, unsigned int *, _jtie_j_ArrayMapper< _jtie_j_BoundedArray< JTIE_JNI_INT_ARRAY_T, 1 > > * > ttrait_uint_1p_a;
-#endif
-#ifdef JTIE_JNI_LONG_ARRAY_T
-typedef ttrait< JTIE_JNI_LONG_ARRAY_T *, signed long *, _jtie_j_ArrayMapper< _jtie_j_BoundedArray< JTIE_JNI_LONG_ARRAY_T, 1 > > * > ttrait_long_1p_a;
-typedef ttrait< JTIE_JNI_LONG_ARRAY_T *, unsigned long *, _jtie_j_ArrayMapper< _jtie_j_BoundedArray< JTIE_JNI_LONG_ARRAY_T, 1 > > * > ttrait_ulong_1p_a;
-#endif
-#ifdef JTIE_JNI_LONGLONG_ARRAY_T
-typedef ttrait< JTIE_JNI_LONGLONG_ARRAY_T *, signed long long *, _jtie_j_ArrayMapper< _jtie_j_BoundedArray< JTIE_JNI_LONGLONG_ARRAY_T, 1 > > * > ttrait_longlong_1p_a;
-typedef ttrait< JTIE_JNI_LONGLONG_ARRAY_T *, unsigned long long *, _jtie_j_ArrayMapper< _jtie_j_BoundedArray< JTIE_JNI_LONGLONG_ARRAY_T, 1 > > * > ttrait_ulonglong_1p_a;
-#endif
-#ifdef JTIE_JNI_LONGDOUBLE_ARRAY_T
-typedef ttrait< JTIE_JNI_LONGDOUBLE_ARRAY_T *, long double *, _jtie_j_ArrayMapper< _jtie_j_BoundedArray< JTIE_JNI_LONGDOUBLE_ARRAY_T, 1 > > * > ttrait_longdouble_1p_a;
-#endif
-
// aliases for: <const-primitive-ctype>_<pointer>_<Array<size=1>>
typedef ttrait< jbooleanArray, const bool *, _jtie_j_ArrayMapper< _jtie_j_BoundedArray< _jbooleanArray, 1 > > * > ttrait_bool_1cp_a;
typedef ttrait< jbyteArray, const char *, _jtie_j_ArrayMapper< _jtie_j_BoundedArray< _jbyteArray, 1 > > * > ttrait_char_1cp_a;
@@ -228,26 +127,6 @@ typedef ttrait< jlongArray, const uint64
typedef ttrait< jfloatArray, const float *, _jtie_j_ArrayMapper< _jtie_j_BoundedArray< _jfloatArray, 1 > > * > ttrait_float_1cp_a;
typedef ttrait< jdoubleArray, const double *, _jtie_j_ArrayMapper< _jtie_j_BoundedArray< _jdoubleArray, 1 > > * > ttrait_double_1cp_a;
-#ifdef JTIE_JNI_SHORT_ARRAY_T
-typedef ttrait< JTIE_JNI_SHORT_ARRAY_T *, const signed short *, _jtie_j_ArrayMapper< _jtie_j_BoundedArray< JTIE_JNI_SHORT_ARRAY_T, 1 > > * > ttrait_short_1cp_a;
-typedef ttrait< JTIE_JNI_SHORT_ARRAY_T *, const unsigned short *, _jtie_j_ArrayMapper< _jtie_j_BoundedArray< JTIE_JNI_SHORT_ARRAY_T, 1 > > * > ttrait_ushort_1cp_a;
-#endif
-#ifdef JTIE_JNI_INT_ARRAY_T
-typedef ttrait< JTIE_JNI_INT_ARRAY_T *, const signed int *, _jtie_j_ArrayMapper< _jtie_j_BoundedArray< JTIE_JNI_INT_ARRAY_T, 1 > > * > ttrait_int_1cp_a;
-typedef ttrait< JTIE_JNI_INT_ARRAY_T *, const unsigned int *, _jtie_j_ArrayMapper< _jtie_j_BoundedArray< JTIE_JNI_INT_ARRAY_T, 1 > > * > ttrait_uint_1cp_a;
-#endif
-#ifdef JTIE_JNI_LONG_ARRAY_T
-typedef ttrait< JTIE_JNI_LONG_ARRAY_T *, const signed long *, _jtie_j_ArrayMapper< _jtie_j_BoundedArray< JTIE_JNI_LONG_ARRAY_T, 1 > > * > ttrait_long_1cp_a;
-typedef ttrait< JTIE_JNI_LONG_ARRAY_T *, const unsigned long *, _jtie_j_ArrayMapper< _jtie_j_BoundedArray< JTIE_JNI_LONG_ARRAY_T, 1 > > * > ttrait_ulong_1cp_a;
-#endif
-#ifdef JTIE_JNI_LONGLONG_ARRAY_T
-typedef ttrait< JTIE_JNI_LONGLONG_ARRAY_T *, const signed long long *, _jtie_j_ArrayMapper< _jtie_j_BoundedArray< JTIE_JNI_LONGLONG_ARRAY_T, 1 > > * > ttrait_longlong_1cp_a;
-typedef ttrait< JTIE_JNI_LONGLONG_ARRAY_T *, const unsigned long long *, _jtie_j_ArrayMapper< _jtie_j_BoundedArray< JTIE_JNI_LONGLONG_ARRAY_T, 1 > > * > ttrait_ulonglong_1cp_a;
-#endif
-#ifdef JTIE_JNI_LONGDOUBLE_ARRAY_T
-typedef ttrait< JTIE_JNI_LONGDOUBLE_ARRAY_T *, const long double *, _jtie_j_ArrayMapper< _jtie_j_BoundedArray< JTIE_JNI_LONGDOUBLE_ARRAY_T, 1 > > * > ttrait_longdouble_1cp_a;
-#endif
-
// aliases for: <primitive-ctype>_<const-pointer>_<Array<size=1>>
typedef ttrait< jbooleanArray, bool * const, _jtie_j_ArrayMapper< _jtie_j_BoundedArray<_jbooleanArray, 1 > > * > ttrait_bool_1pc_a;
typedef ttrait< jbyteArray, char * const, _jtie_j_ArrayMapper< _jtie_j_BoundedArray<_jbyteArray, 1 > > * > ttrait_char_1pc_a;
@@ -262,26 +141,6 @@ typedef ttrait< jlongArray, uint64_t * c
typedef ttrait< jfloatArray, float * const, _jtie_j_ArrayMapper< _jtie_j_BoundedArray<_jfloatArray, 1 > > * > ttrait_float_1pc_a;
typedef ttrait< jdoubleArray, double * const, _jtie_j_ArrayMapper< _jtie_j_BoundedArray<_jdoubleArray, 1 > > * > ttrait_double_1pc_a;
-#ifdef JTIE_JNI_SHORT_ARRAY_T
-typedef ttrait< JTIE_JNI_SHORT_ARRAY_T *, signed short *, _jtie_j_ArrayMapper< _jtie_j_BoundedArray< JTIE_JNI_SHORT_ARRAY_T, 1 > > * const > ttrait_short_1pc_a;
-typedef ttrait< JTIE_JNI_SHORT_ARRAY_T *, unsigned short *, _jtie_j_ArrayMapper< _jtie_j_BoundedArray< JTIE_JNI_SHORT_ARRAY_T, 1 > > * const > ttrait_ushort_1pc_a;
-#endif
-#ifdef JTIE_JNI_INT_ARRAY_T
-typedef ttrait< JTIE_JNI_INT_ARRAY_T *, signed int *, _jtie_j_ArrayMapper< _jtie_j_BoundedArray< JTIE_JNI_INT_ARRAY_T, 1 > > * const > ttrait_int_1pc_a;
-typedef ttrait< JTIE_JNI_INT_ARRAY_T *, unsigned int *, _jtie_j_ArrayMapper< _jtie_j_BoundedArray< JTIE_JNI_INT_ARRAY_T, 1 > > * const > ttrait_uint_1pc_a;
-#endif
-#ifdef JTIE_JNI_LONG_ARRAY_T
-typedef ttrait< JTIE_JNI_LONG_ARRAY_T *, signed long *, _jtie_j_ArrayMapper< _jtie_j_BoundedArray< JTIE_JNI_LONG_ARRAY_T, 1 > > * const > ttrait_long_1pc_a;
-typedef ttrait< JTIE_JNI_LONG_ARRAY_T *, unsigned long *, _jtie_j_ArrayMapper< _jtie_j_BoundedArray< JTIE_JNI_LONG_ARRAY_T, 1 > > * const > ttrait_ulong_1pc_a;
-#endif
-#ifdef JTIE_JNI_LONGLONG_ARRAY_T
-typedef ttrait< JTIE_JNI_LONGLONG_ARRAY_T *, signed long long *, _jtie_j_ArrayMapper< _jtie_j_BoundedArray< JTIE_JNI_LONGLONG_ARRAY_T, 1 > > * const > ttrait_longlong_1pc_a;
-typedef ttrait< JTIE_JNI_LONGLONG_ARRAY_T *, unsigned long long *, _jtie_j_ArrayMapper< _jtie_j_BoundedArray< JTIE_JNI_LONGLONG_ARRAY_T, 1 > > * const > ttrait_ulonglong_1pc_a;
-#endif
-#ifdef JTIE_JNI_LONGDOUBLE_ARRAY_T
-typedef ttrait< JTIE_JNI_LONGDOUBLE_ARRAY_T *, long double *, _jtie_j_ArrayMapper< _jtie_j_BoundedArray< JTIE_JNI_LONGDOUBLE_ARRAY_T, 1 > > * const > ttrait_longdouble_1pc_a;
-#endif
-
// aliases for: <const-primitive-ctype>_<const-pointer>_<Array<size=1>>
typedef ttrait< jbooleanArray, const bool * const, _jtie_j_ArrayMapper< _jtie_j_BoundedArray<_jbooleanArray, 1 > > * > ttrait_bool_1cpc_a;
typedef ttrait< jbyteArray, const char * const, _jtie_j_ArrayMapper< _jtie_j_BoundedArray<_jbyteArray, 1 > > * > ttrait_char_1cpc_a;
@@ -296,26 +155,6 @@ typedef ttrait< jlongArray, const uint64
typedef ttrait< jfloatArray, const float * const, _jtie_j_ArrayMapper< _jtie_j_BoundedArray<_jfloatArray, 1 > > * > ttrait_float_1cpc_a;
typedef ttrait< jdoubleArray, const double * const, _jtie_j_ArrayMapper< _jtie_j_BoundedArray<_jdoubleArray, 1 > > * > ttrait_double_1cpc_a;
-#ifdef JTIE_JNI_SHORT_ARRAY_T
-typedef ttrait< JTIE_JNI_SHORT_ARRAY_T *, const signed short *, _jtie_j_ArrayMapper< _jtie_j_BoundedArray< JTIE_JNI_SHORT_ARRAY_T, 1 > > * const > ttrait_short_1cpc_a;
-typedef ttrait< JTIE_JNI_SHORT_ARRAY_T *, const unsigned short *, _jtie_j_ArrayMapper< _jtie_j_BoundedArray< JTIE_JNI_SHORT_ARRAY_T, 1 > > * const > ttrait_ushort_1cpc_a;
-#endif
-#ifdef JTIE_JNI_INT_ARRAY_T
-typedef ttrait< JTIE_JNI_INT_ARRAY_T *, const signed int *, _jtie_j_ArrayMapper< _jtie_j_BoundedArray< JTIE_JNI_INT_ARRAY_T, 1 > > * const > ttrait_int_1cpc_a;
-typedef ttrait< JTIE_JNI_INT_ARRAY_T *, const unsigned int *, _jtie_j_ArrayMapper< _jtie_j_BoundedArray< JTIE_JNI_INT_ARRAY_T, 1 > > * const > ttrait_uint_1cpc_a;
-#endif
-#ifdef JTIE_JNI_LONG_ARRAY_T
-typedef ttrait< JTIE_JNI_LONG_ARRAY_T *, const signed long *, _jtie_j_ArrayMapper< _jtie_j_BoundedArray< JTIE_JNI_LONG_ARRAY_T, 1 > > * const > ttrait_long_1cpc_a;
-typedef ttrait< JTIE_JNI_LONG_ARRAY_T *, const unsigned long *, _jtie_j_ArrayMapper< _jtie_j_BoundedArray< JTIE_JNI_LONG_ARRAY_T, 1 > > * const > ttrait_ulong_1cpc_a;
-#endif
-#ifdef JTIE_JNI_LONGLONG_ARRAY_T
-typedef ttrait< JTIE_JNI_LONGLONG_ARRAY_T *, const signed long long *, _jtie_j_ArrayMapper< _jtie_j_BoundedArray< JTIE_JNI_LONGLONG_ARRAY_T, 1 > > * const > ttrait_longlong_1cpc_a;
-typedef ttrait< JTIE_JNI_LONGLONG_ARRAY_T *, const unsigned long long *, _jtie_j_ArrayMapper< _jtie_j_BoundedArray< JTIE_JNI_LONGLONG_ARRAY_T, 1 > > * const > ttrait_ulonglong_1cpc_a;
-#endif
-#ifdef JTIE_JNI_LONGDOUBLE_ARRAY_T
-typedef ttrait< JTIE_JNI_LONGDOUBLE_ARRAY_T *, const long double *, _jtie_j_ArrayMapper< _jtie_j_BoundedArray< JTIE_JNI_LONGDOUBLE_ARRAY_T, 1 > > * const > ttrait_longdouble_1cpc_a;
-#endif
-
// ---------------------------------------------------------------------------
#endif // jtie_tconv_ptrbyval_hpp
=== modified file 'storage/ndb/ndbjtie/jtie/include/jtie_tconv_ptrbyval_impl.hpp'
--- a/storage/ndb/ndbjtie/jtie/include/jtie_tconv_ptrbyval_impl.hpp 2009-11-04 17:28:51 +0000
+++ b/storage/ndb/ndbjtie/jtie/include/jtie_tconv_ptrbyval_impl.hpp 2009-11-07 04:40:48 +0000
@@ -164,181 +164,138 @@ struct ArrayPtrResult {
// template instantiation ambiguities for non-primitive types. Therefore,
// we enumerate all specicializations for primitive type pointers.
-// for BoundedArrays mapped to pointers/arrays, require a minimum
-// array length of the BoundedArray's static data member
+// extend array param specializations to const pointers
+template< typename C >
+struct Param< _jbooleanArray *, C * const >
+ : Param< _jbooleanArray *, C * > {};
+template< typename C >
+struct Param< _jbyteArray *, C * const >
+ : Param< _jbyteArray *, C * > {};
+template< typename C >
+struct Param< _jshortArray *, C * const >
+ : Param< _jshortArray *, C * > {};
+template< typename C >
+struct Param< _jintArray *, C * const >
+ : Param< _jintArray *, C * > {};
+template< typename C >
+struct Param< _jlongArray *, C * const >
+ : Param< _jlongArray *, C * > {};
+template< typename C >
+struct Param< _jfloatArray *, C * const >
+ : Param< _jfloatArray *, C * > {};
+template< typename C >
+struct Param< _jdoubleArray *, C * const >
+ : Param< _jdoubleArray *, C * > {};
+
+// extend result array specializations to const pointers
+template< typename C >
+struct Result< _jbooleanArray *, C * const >
+ : Result< _jbooleanArray *, C * > {};
+template< typename C >
+struct Result< _jbyteArray *, C * const >
+ : Result< _jbyteArray *, C * > {};
+template< typename C >
+struct Result< _jshortArray *, C * const >
+ : Result< _jshortArray *, C * > {};
+template< typename C >
+struct Result< _jintArray *, C * const >
+ : Result< _jintArray *, C * > {};
+template< typename C >
+struct Result< _jlongArray *, C * const >
+ : Result< _jlongArray *, C * > {};
+template< typename C >
+struct Result< _jfloatArray *, C * const >
+ : Result< _jfloatArray *, C * > {};
+template< typename C >
+struct Result< _jdoubleArray *, C * const >
+ : Result< _jdoubleArray *, C * > {};
+
+// extend BoundedArrays specializations to const pointers
+template< typename J, typename C >
+struct Param< _jtie_j_ArrayMapper< J > *, C * const >
+ : Param< _jtie_j_ArrayMapper< J > *, C * > {};
+template< typename J, typename C >
+struct Result< _jtie_j_ArrayMapper< J > *, C * const >
+ : Result< _jtie_j_ArrayMapper< J > *, C * > {};
+
+// specialize BoundedArrays mapped to pointers/arrays:
+// - params: require a minimum array length given by the BoundedArray's
+// static data member
+// - results: allocate array with a length given by the BoundedArray's
+// static data member
template< typename J, typename C >
struct Param< _jtie_j_ArrayMapper< J > *, C * >
: ArrayPtrParam< _jtie_j_ArrayMapper< J >, C > {};
-
-// for BoundedArrays mapped to pointers/arrays, allocate array with
-// a length of the BoundedArray's static data member
template< typename J, typename C >
struct Result< _jtie_j_ArrayMapper< J > *, C * >
: ArrayPtrResult< _jtie_j_ArrayMapper< J >, C > {};
+// specialize arrays mapped to pointers/arrays:
+// - params: do not require a minimum buffer capacity, for size may be zero
+// when just passing an address
+// - results: allocate buffer with a capacity of zero, since the size is
+// unknown (i.e., just returning an address)
+#define JTIE_SPECIALIZE_ARRAY_TYPE_MAPPING( J, C ) \
+ template<> \
+ struct Param< J *, C * > \
+ : ArrayPtrParam< _jtie_j_BoundedArray< J, 0 >, C > {}; \
+ template<> \
+ struct Param< J *, const C * > \
+ : ArrayPtrParam< _jtie_j_BoundedArray< J, 0 >, const C > {}; \
+ template<> \
+ struct Result< J *, C * > \
+ : ArrayPtrResult< _jtie_j_BoundedArray< J, 0 >, C > {}; \
+ template<> \
+ struct Result< J *, const C * > \
+ : ArrayPtrResult< _jtie_j_BoundedArray< J, 0 >, const C > {};
+
// ---------------------------------------------------------------------------
// Specializations for pointer to exact-width primitive type conversions
// ---------------------------------------------------------------------------
-// non-const pointer parameters
-template<> struct Param< _jbooleanArray *, bool * > : ArrayPtrParam< _jtie_j_BoundedArray< _jbooleanArray, 0 >, bool > {};
-template<> struct Param< _jbyteArray *, char * > : ArrayPtrParam< _jtie_j_BoundedArray< _jbyteArray, 0 >, char > {};
-template<> struct Param< _jbyteArray *, int8_t * > : ArrayPtrParam< _jtie_j_BoundedArray< _jbyteArray, 0 >, int8_t > {};
-template<> struct Param< _jbyteArray *, uint8_t * > : ArrayPtrParam< _jtie_j_BoundedArray< _jbyteArray, 0 >, uint8_t > {};
-template<> struct Param< _jshortArray *, int16_t * > : ArrayPtrParam< _jtie_j_BoundedArray< _jshortArray, 0 >, int16_t > {};
-template<> struct Param< _jshortArray *, uint16_t * > : ArrayPtrParam< _jtie_j_BoundedArray< _jshortArray, 0 >, uint16_t > {};
-template<> struct Param< _jintArray *, int32_t * > : ArrayPtrParam< _jtie_j_BoundedArray< _jintArray, 0 >, int32_t > {};
-template<> struct Param< _jintArray *, uint32_t * > : ArrayPtrParam< _jtie_j_BoundedArray< _jintArray, 0 >, uint32_t > {};
-template<> struct Param< _jlongArray *, int64_t * > : ArrayPtrParam< _jtie_j_BoundedArray< _jlongArray, 0 >, int64_t > {};
-template<> struct Param< _jlongArray *, uint64_t * > : ArrayPtrParam< _jtie_j_BoundedArray< _jlongArray, 0 >, uint64_t > {};
-template<> struct Param< _jfloatArray *, float * > : ArrayPtrParam< _jtie_j_BoundedArray< _jfloatArray, 0 >, float > {};
-template<> struct Param< _jdoubleArray *, double * > : ArrayPtrParam< _jtie_j_BoundedArray< _jdoubleArray, 0 >, double > {};
-
-// const pointer parameters
-template<> struct Param< _jbooleanArray *, const bool * > : ArrayPtrParam< _jtie_j_BoundedArray< _jbooleanArray, 0 >, const bool > {};
-template<> struct Param< _jbyteArray *, const char * > : ArrayPtrParam< _jtie_j_BoundedArray< _jbyteArray, 0 >, const char > {};
-template<> struct Param< _jbyteArray *, const int8_t * > : ArrayPtrParam< _jtie_j_BoundedArray< _jbyteArray, 0 >, const int8_t > {};
-template<> struct Param< _jbyteArray *, const uint8_t * > : ArrayPtrParam< _jtie_j_BoundedArray< _jbyteArray, 0 >, const uint8_t > {};
-template<> struct Param< _jshortArray *, const int16_t * > : ArrayPtrParam< _jtie_j_BoundedArray< _jshortArray, 0 >, const int16_t > {};
-template<> struct Param< _jshortArray *, const uint16_t * > : ArrayPtrParam< _jtie_j_BoundedArray< _jshortArray, 0 >, const uint16_t > {};
-template<> struct Param< _jintArray *, const int32_t * > : ArrayPtrParam< _jtie_j_BoundedArray< _jintArray, 0 >, const int32_t > {};
-template<> struct Param< _jintArray *, const uint32_t * > : ArrayPtrParam< _jtie_j_BoundedArray< _jintArray, 0 >, const uint32_t > {};
-template<> struct Param< _jlongArray *, const int64_t * > : ArrayPtrParam< _jtie_j_BoundedArray< _jlongArray, 0 >, const int64_t > {};
-template<> struct Param< _jlongArray *, const uint64_t * > : ArrayPtrParam< _jtie_j_BoundedArray< _jlongArray, 0 >, const uint64_t > {};
-template<> struct Param< _jfloatArray *, const float * > : ArrayPtrParam< _jtie_j_BoundedArray< _jfloatArray, 0 >, const float > {};
-template<> struct Param< _jdoubleArray *, const double * > : ArrayPtrParam< _jtie_j_BoundedArray< _jdoubleArray, 0 >, const double > {};
-
-// non-const pointer results
-template<> struct Result< _jbooleanArray *, bool * > : ArrayPtrResult< _jtie_j_BoundedArray< _jbooleanArray, 0 >, bool > {};
-template<> struct Result< _jbyteArray *, char * > : ArrayPtrResult< _jtie_j_BoundedArray< _jbyteArray, 0 >, char > {};
-template<> struct Result< _jbyteArray *, int8_t * > : ArrayPtrResult< _jtie_j_BoundedArray< _jbyteArray, 0 >, int8_t > {};
-template<> struct Result< _jbyteArray *, uint8_t * > : ArrayPtrResult< _jtie_j_BoundedArray< _jbyteArray, 0 >, uint8_t > {};
-template<> struct Result< _jshortArray *, int16_t * > : ArrayPtrResult< _jtie_j_BoundedArray< _jshortArray, 0 >, int16_t > {};
-template<> struct Result< _jshortArray *, uint16_t * > : ArrayPtrResult< _jtie_j_BoundedArray< _jshortArray, 0 >, uint16_t > {};
-template<> struct Result< _jintArray *, int32_t * > : ArrayPtrResult< _jtie_j_BoundedArray< _jintArray, 0 >, int32_t > {};
-template<> struct Result< _jintArray *, uint32_t * > : ArrayPtrResult< _jtie_j_BoundedArray< _jintArray, 0 >, uint32_t > {};
-template<> struct Result< _jlongArray *, int64_t * > : ArrayPtrResult< _jtie_j_BoundedArray< _jlongArray, 0 >, int64_t > {};
-template<> struct Result< _jlongArray *, uint64_t * > : ArrayPtrResult< _jtie_j_BoundedArray< _jlongArray, 0 >, uint64_t > {};
-template<> struct Result< _jfloatArray *, float * > : ArrayPtrResult< _jtie_j_BoundedArray< _jfloatArray, 0 >, float > {};
-template<> struct Result< _jdoubleArray *, double * > : ArrayPtrResult< _jtie_j_BoundedArray< _jdoubleArray, 0 >, double > {};
-
-// const pointer results
-template<> struct Result< _jbooleanArray *, const bool * > : ArrayPtrResult< _jtie_j_BoundedArray< _jbooleanArray, 0 >, const bool > {};
-template<> struct Result< _jbyteArray *, const char * > : ArrayPtrResult< _jtie_j_BoundedArray< _jbyteArray, 0 >, const char > {};
-template<> struct Result< _jbyteArray *, const int8_t * > : ArrayPtrResult< _jtie_j_BoundedArray< _jbyteArray, 0 >, const int8_t > {};
-template<> struct Result< _jbyteArray *, const uint8_t * > : ArrayPtrResult< _jtie_j_BoundedArray< _jbyteArray, 0 >, const uint8_t > {};
-template<> struct Result< _jshortArray *, const int16_t * > : ArrayPtrResult< _jtie_j_BoundedArray< _jshortArray, 0 >, const int16_t > {};
-template<> struct Result< _jshortArray *, const uint16_t * > : ArrayPtrResult< _jtie_j_BoundedArray< _jshortArray, 0 >, const uint16_t > {};
-template<> struct Result< _jintArray *, const int32_t * > : ArrayPtrResult< _jtie_j_BoundedArray< _jintArray, 0 >, const int32_t > {};
-template<> struct Result< _jintArray *, const uint32_t * > : ArrayPtrResult< _jtie_j_BoundedArray< _jintArray, 0 >, const uint32_t > {};
-template<> struct Result< _jlongArray *, const int64_t * > : ArrayPtrResult< _jtie_j_BoundedArray< _jlongArray, 0 >, const int64_t > {};
-template<> struct Result< _jlongArray *, const uint64_t * > : ArrayPtrResult< _jtie_j_BoundedArray< _jlongArray, 0 >, const uint64_t > {};
-template<> struct Result< _jfloatArray *, const float * > : ArrayPtrResult< _jtie_j_BoundedArray< _jfloatArray, 0 >, const float > {};
-template<> struct Result< _jdoubleArray *, const double * > : ArrayPtrResult< _jtie_j_BoundedArray< _jdoubleArray, 0 >, const double > {};
+JTIE_SPECIALIZE_ARRAY_TYPE_MAPPING(_jbooleanArray, bool)
+
+JTIE_SPECIALIZE_ARRAY_TYPE_MAPPING(_jbyteArray, char)
+JTIE_SPECIALIZE_ARRAY_TYPE_MAPPING(_jbyteArray, signed char)
+JTIE_SPECIALIZE_ARRAY_TYPE_MAPPING(_jbyteArray, unsigned char)
+
+JTIE_SPECIALIZE_ARRAY_TYPE_MAPPING(_jfloatArray, float)
+JTIE_SPECIALIZE_ARRAY_TYPE_MAPPING(_jdoubleArray, double)
// ---------------------------------------------------------------------------
// Specializations for pointer to variable-width primitive type conversions
// ---------------------------------------------------------------------------
-// non-const pointer parameters
-#if (defined(JTIE_TSPECIALIZE_SHORT_ARRAY) && JTIE_TSPECIALIZE_SHORT_ARRAY > 0)
-template<> struct Param< JTIE_JNI_SHORT_ARRAY_T, signed short * > : ArrayPtrParam< _jtie_j_BoundedArray< JTIE_JNI_SHORT_ARRAY_T, 0 >, signed short > {};
-template<> struct Param< JTIE_JNI_SHORT_ARRAY_T, unsigned short * > : ArrayPtrParam< _jtie_j_BoundedArray< JTIE_JNI_SHORT_ARRAY_T, 0 >, unsigned short > {};
-#endif
-
-#if (defined(JTIE_TSPECIALIZE_INT_ARRAY) && JTIE_TSPECIALIZE_INT_ARRAY > 0)
-template<> struct Param< JTIE_JNI_INT_ARRAY_T, signed int * > : ArrayPtrParam< _jtie_j_BoundedArray< JTIE_JNI_INT_ARRAY_T, 0 >, signed int > {};
-template<> struct Param< JTIE_JNI_INT_ARRAY_T, unsigned int * > : ArrayPtrParam< _jtie_j_BoundedArray< JTIE_JNI_INT_ARRAY_T, 0 >, unsigned int > {};
-#endif
-
-#if (defined(JTIE_TSPECIALIZE_LONG_ARRAY) && JTIE_TSPECIALIZE_LONG_ARRAY > 0)
-template<> struct Param< JTIE_JNI_LONG_ARRAY_T, signed long * > : ArrayPtrParam< _jtie_j_BoundedArray< JTIE_JNI_LONG_ARRAY_T, 0 >, signed long > {};
-template<> struct Param< JTIE_JNI_LONG_ARRAY_T, unsigned long * > : ArrayPtrParam< _jtie_j_BoundedArray< JTIE_JNI_LONG_ARRAY_T, 0 >, unsigned long > {};
-#endif
-
-#if (defined(JTIE_TSPECIALIZE_LONGLONG_ARRAY) && JTIE_TSPECIALIZE_LONGLONG_ARRAY > 0)
-template<> struct Param< JTIE_JNI_LONGLONG_ARRAY_T, signed long long * > : ArrayPtrParam< _jtie_j_BoundedArray< JTIE_JNI_LONGLONG_ARRAY_T, 0 >, signed long long > {};
-template<> struct Param< JTIE_JNI_LONGLONG_ARRAY_T, unsigned long long * > : ArrayPtrParam< _jtie_j_BoundedArray< JTIE_JNI_LONGLONG_ARRAY_T, 0 >, unsigned long long > {};
-#endif
-
-#if (defined(JTIE_TSPECIALIZE_LONGDOUBLE_ARRAY) && JTIE_TSPECIALIZE_LONGDOUBLE_ARRAY > 0)
-template<> struct Param< JTIE_JNI_LONGDOUBLE_ARRAY_T, long double * > : ArrayPtrParam< _jtie_j_BoundedArray< JTIE_JNI_LONGDOUBLE_ARRAY_T, 0 >, long double > {};
-#endif
-
-// const pointer parameters
-#if (defined(JTIE_TSPECIALIZE_SHORT_ARRAY) && JTIE_TSPECIALIZE_SHORT_ARRAY > 0)
-template<> struct Param< JTIE_JNI_SHORT_ARRAY_T, const signed short * > : ArrayPtrParam< _jtie_j_BoundedArray< JTIE_JNI_SHORT_ARRAY_T, 0 >, const signed short > {};
-template<> struct Param< JTIE_JNI_SHORT_ARRAY_T, const unsigned short * > : ArrayPtrParam< _jtie_j_BoundedArray< JTIE_JNI_SHORT_ARRAY_T, 0 >, const unsigned short > {};
-#endif
-
-#if (defined(JTIE_TSPECIALIZE_INT_ARRAY) && JTIE_TSPECIALIZE_INT_ARRAY > 0)
-template<> struct Param< JTIE_JNI_INT_ARRAY_T, const signed int * > : ArrayPtrParam< _jtie_j_BoundedArray< JTIE_JNI_INT_ARRAY_T, 0 >, const signed int > {};
-template<> struct Param< JTIE_JNI_INT_ARRAY_T, const unsigned int * > : ArrayPtrParam< _jtie_j_BoundedArray< JTIE_JNI_INT_ARRAY_T, 0 >, const unsigned int > {};
-#endif
-
-#if (defined(JTIE_TSPECIALIZE_LONG_ARRAY) && JTIE_TSPECIALIZE_LONG_ARRAY > 0)
-template<> struct Param< JTIE_JNI_LONG_ARRAY_T, const signed long * > : ArrayPtrParam< _jtie_j_BoundedArray< JTIE_JNI_LONG_ARRAY_T, 0 >, const signed long > {};
-template<> struct Param< JTIE_JNI_LONG_ARRAY_T, const unsigned long * > : ArrayPtrParam< _jtie_j_BoundedArray< JTIE_JNI_LONG_ARRAY_T, 0 >, const unsigned long > {};
-#endif
-
-#if (defined(JTIE_TSPECIALIZE_LONGLONG_ARRAY) && JTIE_TSPECIALIZE_LONGLONG_ARRAY > 0)
-template<> struct Param< JTIE_JNI_LONGLONG_ARRAY_T, const signed long long * > : ArrayPtrParam< _jtie_j_BoundedArray< JTIE_JNI_LONGLONG_ARRAY_T, 0 >, const signed long long > {};
-template<> struct Param< JTIE_JNI_LONGLONG_ARRAY_T, const unsigned long long * > : ArrayPtrParam< _jtie_j_BoundedArray< JTIE_JNI_LONGLONG_ARRAY_T, 0 >, const unsigned long long > {};
-#endif
-
-#if (defined(JTIE_TSPECIALIZE_LONGDOUBLE_ARRAY) && JTIE_TSPECIALIZE_LONGDOUBLE_ARRAY > 0)
-template<> struct Param< JTIE_JNI_LONGDOUBLE_ARRAY_T, const long double * > : ArrayPtrParam< _jtie_j_BoundedArray< JTIE_JNI_LONGDOUBLE_ARRAY_T, 0 >, const long double > {};
-#endif
-
-// non-const pointer results
-#if (defined(JTIE_TSPECIALIZE_SHORT_ARRAY) && JTIE_TSPECIALIZE_SHORT_ARRAY > 0)
-template<> struct Result< JTIE_JNI_SHORT_ARRAY_T, signed short * > : ArrayPtrResult< _jtie_j_BoundedArray< JTIE_JNI_SHORT_ARRAY_T, 0 >, signed short > {};
-template<> struct Result< JTIE_JNI_SHORT_ARRAY_T, unsigned short * > : ArrayPtrResult< _jtie_j_BoundedArray< JTIE_JNI_SHORT_ARRAY_T, 0 >, unsigned short > {};
-#endif
-
-#if (defined(JTIE_TSPECIALIZE_INT_ARRAY) && JTIE_TSPECIALIZE_INT_ARRAY > 0)
-template<> struct Result< JTIE_JNI_INT_ARRAY_T, signed int * > : ArrayPtrResult< _jtie_j_BoundedArray< JTIE_JNI_INT_ARRAY_T, 0 >, signed int > {};
-template<> struct Result< JTIE_JNI_INT_ARRAY_T, unsigned int * > : ArrayPtrResult< _jtie_j_BoundedArray< JTIE_JNI_INT_ARRAY_T, 0 >, unsigned int > {};
-#endif
-
-#if (defined(JTIE_TSPECIALIZE_LONG_ARRAY) && JTIE_TSPECIALIZE_LONG_ARRAY > 0)
-template<> struct Result< JTIE_JNI_LONG_ARRAY_T, signed long * > : ArrayPtrResult< _jtie_j_BoundedArray< JTIE_JNI_LONG_ARRAY_T, 0 >, signed long > {};
-template<> struct Result< JTIE_JNI_LONG_ARRAY_T, unsigned long * > : ArrayPtrResult< _jtie_j_BoundedArray< JTIE_JNI_LONG_ARRAY_T, 0 >, unsigned long > {};
-#endif
-
-#if (defined(JTIE_TSPECIALIZE_LONGLONG_ARRAY) && JTIE_TSPECIALIZE_LONGLONG_ARRAY > 0)
-template<> struct Result< JTIE_JNI_LONGLONG_ARRAY_T, signed long long * > : ArrayPtrResult< _jtie_j_BoundedArray< JTIE_JNI_LONGLONG_ARRAY_T, 0 >, signed long long > {};
-template<> struct Result< JTIE_JNI_LONGLONG_ARRAY_T, unsigned long long * > : ArrayPtrResult< _jtie_j_BoundedArray< JTIE_JNI_LONGLONG_ARRAY_T, 0 >, unsigned long long > {};
-#endif
-
-#if (defined(JTIE_TSPECIALIZE_LONGDOUBLE_ARRAY) && JTIE_TSPECIALIZE_LONGDOUBLE_ARRAY > 0)
-template<> struct Result< JTIE_JNI_LONGDOUBLE_ARRAY_T, long double * > : ArrayPtrResult< _jtie_j_BoundedArray< JTIE_JNI_LONGDOUBLE_ARRAY_T, 0 >, long double > {};
-#endif
-
-// const pointer results
-#if (defined(JTIE_TSPECIALIZE_SHORT_ARRAY) && JTIE_TSPECIALIZE_SHORT_ARRAY > 0)
-template<> struct Result< JTIE_JNI_SHORT_ARRAY_T, const signed short * > : ArrayPtrResult< _jtie_j_BoundedArray< JTIE_JNI_SHORT_ARRAY_T, 0 >, const signed short > {};
-template<> struct Result< JTIE_JNI_SHORT_ARRAY_T, const unsigned short * > : ArrayPtrResult< _jtie_j_BoundedArray< JTIE_JNI_SHORT_ARRAY_T, 0 >, const unsigned short > {};
-#endif
-
-#if (defined(JTIE_TSPECIALIZE_INT_ARRAY) && JTIE_TSPECIALIZE_INT_ARRAY > 0)
-template<> struct Result< JTIE_JNI_INT_ARRAY_T, const signed int * > : ArrayPtrResult< _jtie_j_BoundedArray< JTIE_JNI_INT_ARRAY_T, 0 >, const signed int > {};
-template<> struct Result< JTIE_JNI_INT_ARRAY_T, const unsigned int * > : ArrayPtrResult< _jtie_j_BoundedArray< JTIE_JNI_INT_ARRAY_T, 0 >, const unsigned int > {};
-#endif
-
-#if (defined(JTIE_TSPECIALIZE_LONG_ARRAY) && JTIE_TSPECIALIZE_LONG_ARRAY > 0)
-template<> struct Result< JTIE_JNI_LONG_ARRAY_T, const signed long * > : ArrayPtrResult< _jtie_j_BoundedArray< JTIE_JNI_LONG_ARRAY_T, 0 >, const signed long > {};
-template<> struct Result< JTIE_JNI_LONG_ARRAY_T, const unsigned long * > : ArrayPtrResult< _jtie_j_BoundedArray< JTIE_JNI_LONG_ARRAY_T, 0 >, const unsigned long > {};
-#endif
-
-#if (defined(JTIE_TSPECIALIZE_LONGLONG_ARRAY) && JTIE_TSPECIALIZE_LONGLONG_ARRAY > 0)
-template<> struct Result< JTIE_JNI_LONGLONG_ARRAY_T, const signed long long * > : ArrayPtrResult< _jtie_j_BoundedArray< JTIE_JNI_LONGLONG_ARRAY_T, 0 >, const signed long long > {};
-template<> struct Result< JTIE_JNI_LONGLONG_ARRAY_T, const unsigned long long * > : ArrayPtrResult< _jtie_j_BoundedArray< JTIE_JNI_LONGLONG_ARRAY_T, 0 >, const unsigned long long > {};
-#endif
-
-#if (defined(JTIE_TSPECIALIZE_LONGDOUBLE_ARRAY) && JTIE_TSPECIALIZE_LONGDOUBLE_ARRAY > 0)
-template<> struct Result< JTIE_JNI_LONGDOUBLE_ARRAY_T, const long double * > : ArrayPtrResult< _jtie_j_BoundedArray< JTIE_JNI_LONGDOUBLE_ARRAY_T, 0 >, const long double > {};
-#endif
+// jshort in LP32, ILP32, LP64, ILP64, LLP64
+JTIE_SPECIALIZE_ARRAY_TYPE_MAPPING(_jshortArray, signed short)
+JTIE_SPECIALIZE_ARRAY_TYPE_MAPPING(_jshortArray, unsigned short)
+
+// jshort in LP32
+JTIE_SPECIALIZE_ARRAY_TYPE_MAPPING(_jshortArray, signed int)
+JTIE_SPECIALIZE_ARRAY_TYPE_MAPPING(_jshortArray, unsigned int)
+
+// jint in ILP32, LP64, LLP64
+JTIE_SPECIALIZE_ARRAY_TYPE_MAPPING(_jintArray, signed int)
+JTIE_SPECIALIZE_ARRAY_TYPE_MAPPING(_jintArray, unsigned int)
+
+// jint in LP32, ILP32, LLP64
+JTIE_SPECIALIZE_ARRAY_TYPE_MAPPING(_jintArray, signed long)
+JTIE_SPECIALIZE_ARRAY_TYPE_MAPPING(_jintArray, unsigned long)
+
+// jlong in ILP64
+JTIE_SPECIALIZE_ARRAY_TYPE_MAPPING(_jlongArray, signed int)
+JTIE_SPECIALIZE_ARRAY_TYPE_MAPPING(_jlongArray, unsigned int)
+
+// jlong in LP64, ILP64
+JTIE_SPECIALIZE_ARRAY_TYPE_MAPPING(_jlongArray, signed long)
+JTIE_SPECIALIZE_ARRAY_TYPE_MAPPING(_jlongArray, unsigned long)
+
+// jlong in LLP64
+JTIE_SPECIALIZE_ARRAY_TYPE_MAPPING(_jlongArray, signed long long)
+JTIE_SPECIALIZE_ARRAY_TYPE_MAPPING(_jlongArray, unsigned long long)
+
+// jdouble
+JTIE_SPECIALIZE_ARRAY_TYPE_MAPPING(_jdoubleArray, long double)
// ---------------------------------------------------------------------------
=== modified file 'storage/ndb/ndbjtie/jtie/include/jtie_tconv_refbybb_impl.hpp'
--- a/storage/ndb/ndbjtie/jtie/include/jtie_tconv_refbybb_impl.hpp 2009-09-18 20:40:07 +0000
+++ b/storage/ndb/ndbjtie/jtie/include/jtie_tconv_refbybb_impl.hpp 2009-11-07 06:25:30 +0000
@@ -106,14 +106,12 @@ struct ByteBufferRefResult {
// Specializations for ByteBuffer type conversions
// ---------------------------------------------------------------------------
-// for ByteBuffers mapped to references, require a minimum buffer capacity
-// of size of the reference's base type
+// specialize ByteBuffers mapped to references:
+// - params: require a minimum buffer capacity of the size of the base type
+// - results: allocate buffer with a capacity of the size of the base type
template< typename C >
struct Param< jtie_j_n_ByteBuffer, C & >
: ByteBufferRefParam< _jtie_j_n_BoundedByteBuffer< sizeof(C) >, C > {};
-
-// for ByteBuffers mapped to references, allocate buffer with a capacity
-// of the size of the reference's base type
template< typename C >
struct Result< jtie_j_n_ByteBuffer, C & >
: ByteBufferRefResult< _jtie_j_n_BoundedByteBuffer< sizeof(C) >, C > {};
=== modified file 'storage/ndb/ndbjtie/jtie/include/jtie_tconv_refbyval.hpp'
--- a/storage/ndb/ndbjtie/jtie/include/jtie_tconv_refbyval.hpp 2009-10-27 06:56:52 +0000
+++ b/storage/ndb/ndbjtie/jtie/include/jtie_tconv_refbyval.hpp 2009-11-07 04:40:48 +0000
@@ -26,7 +26,6 @@
#include <jni.h>
#include "jtie_tconv.hpp"
-#include "jtie_tconv_vwidth.hpp"
// ---------------------------------------------------------------------------
// Java value/array <-> C reference type conversions
@@ -46,26 +45,6 @@ typedef ttrait< jlong, uint64_t & > ttra
typedef ttrait< jfloat, float & > ttrait_float_r_v;
typedef ttrait< jdouble, double & > ttrait_double_r_v;
-#ifdef JTIE_JNI_SHORT_T
-typedef ttrait< JTIE_JNI_SHORT_T, signed short & > ttrait_short_r_v;
-typedef ttrait< JTIE_JNI_SHORT_T, unsigned short & > ttrait_ushort_r_v;
-#endif
-#ifdef JTIE_JNI_INT_T
-typedef ttrait< JTIE_JNI_INT_T, signed int & > ttrait_int_r_v;
-typedef ttrait< JTIE_JNI_INT_T, unsigned int & > ttrait_uint_r_v;
-#endif
-#ifdef JTIE_JNI_LONG_T
-typedef ttrait< JTIE_JNI_LONG_T, signed long & > ttrait_long_r_v;
-typedef ttrait< JTIE_JNI_LONG_T, unsigned long & > ttrait_ulong_r_v;
-#endif
-#ifdef JTIE_JNI_LONGLONG_T
-typedef ttrait< JTIE_JNI_LONGLONG_T, signed long long & > ttrait_longlong_r_v;
-typedef ttrait< JTIE_JNI_LONGLONG_T, unsigned long long & > ttrait_ulonglong_r_v;
-#endif
-#ifdef JTIE_JNI_LONGDOUBLE_T
-typedef ttrait< JTIE_JNI_LONGDOUBLE_T, long double & > ttrait_longdouble_r_v;
-#endif
-
// aliases for: <primitive-ctype>_<const-reference>_<value>
typedef ttrait< jboolean, const bool & > ttrait_bool_cr_v;
typedef ttrait< jbyte, const char & > ttrait_char_cr_v;
@@ -80,26 +59,6 @@ typedef ttrait< jlong, const uint64_t &
typedef ttrait< jfloat, const float & > ttrait_float_cr_v;
typedef ttrait< jdouble, const double & > ttrait_double_cr_v;
-#ifdef JTIE_JNI_SHORT_T
-typedef ttrait< JTIE_JNI_SHORT_T, const signed short & > ttrait_short_cr_v;
-typedef ttrait< JTIE_JNI_SHORT_T, const unsigned short & > ttrait_ushort_cr_v;
-#endif
-#ifdef JTIE_JNI_INT_T
-typedef ttrait< JTIE_JNI_INT_T, const signed int & > ttrait_int_cr_v;
-typedef ttrait< JTIE_JNI_INT_T, const unsigned int & > ttrait_uint_cr_v;
-#endif
-#ifdef JTIE_JNI_LONG_T
-typedef ttrait< JTIE_JNI_LONG_T, const signed long & > ttrait_long_cr_v;
-typedef ttrait< JTIE_JNI_LONG_T, const unsigned long & > ttrait_ulong_cr_v;
-#endif
-#ifdef JTIE_JNI_LONGLONG_T
-typedef ttrait< JTIE_JNI_LONGLONG_T, const signed long long & > ttrait_longlong_cr_v;
-typedef ttrait< JTIE_JNI_LONGLONG_T, const unsigned long long & > ttrait_ulonglong_cr_v;
-#endif
-#ifdef JTIE_JNI_LONGDOUBLE_T
-typedef ttrait< JTIE_JNI_LONGDOUBLE_T, const long double & > ttrait_longdouble_cr_v;
-#endif
-
// aliases for: <primitive-ctype>_<reference>_<array<size=1>>
typedef ttrait< jbooleanArray, bool & > ttrait_bool_r_a;
typedef ttrait< jbyteArray, char & > ttrait_char_r_a;
@@ -114,26 +73,6 @@ typedef ttrait< jlongArray, uint64_t & >
typedef ttrait< jfloatArray, float & > ttrait_float_r_a;
typedef ttrait< jdoubleArray, double & > ttrait_double_r_a;
-#ifdef JTIE_JNI_SHORT_ARRAY_T
-typedef ttrait< JTIE_JNI_SHORT_ARRAY_T *, signed short & > ttrait_short_r_a;
-typedef ttrait< JTIE_JNI_SHORT_ARRAY_T *, unsigned short & > ttrait_ushort_r_a;
-#endif
-#ifdef JTIE_JNI_INT_ARRAY_T
-typedef ttrait< JTIE_JNI_INT_ARRAY_T *, signed int & > ttrait_int_r_a;
-typedef ttrait< JTIE_JNI_INT_ARRAY_T *, unsigned int & > ttrait_uint_r_a;
-#endif
-#ifdef JTIE_JNI_LONG_ARRAY_T
-typedef ttrait< JTIE_JNI_LONG_ARRAY_T *, signed long & > ttrait_long_r_a;
-typedef ttrait< JTIE_JNI_LONG_ARRAY_T *, unsigned long & > ttrait_ulong_r_a;
-#endif
-#ifdef JTIE_JNI_LONGLONG_ARRAY_T
-typedef ttrait< JTIE_JNI_LONGLONG_ARRAY_T *, signed long long & > ttrait_longlong_r_a;
-typedef ttrait< JTIE_JNI_LONGLONG_ARRAY_T *, unsigned long long & > ttrait_ulonglong_r_a;
-#endif
-#ifdef JTIE_JNI_LONGDOUBLE_ARRAY_T
-typedef ttrait< JTIE_JNI_LONGDOUBLE_ARRAY_T *, long double & > ttrait_longdouble_r_a;
-#endif
-
// ---------------------------------------------------------------------------
#endif // jtie_tconv_refbyval_hpp
=== modified file 'storage/ndb/ndbjtie/jtie/include/jtie_tconv_refbyval_impl.hpp'
--- a/storage/ndb/ndbjtie/jtie/include/jtie_tconv_refbyval_impl.hpp 2009-11-04 17:28:51 +0000
+++ b/storage/ndb/ndbjtie/jtie/include/jtie_tconv_refbyval_impl.hpp 2009-11-07 06:25:30 +0000
@@ -113,169 +113,72 @@ struct ArrayRefResult {
// template instantiation ambiguities for non-primitive types. Therefore,
// we enumerate all specicializations for primitive type references.
+// specialize values/value-holders mapped to references:
+// - const params: map as value copy
+// - const results: map as value copy
+// - non-const params: map as value holder (array of length 1)
+// - non-const results: map as value copy (no use as value holders)
+#define JTIE_SPECIALIZE_REFERENCE_TYPE_MAPPING( JA, J, C ) \
+ template<> \
+ struct Param< J, const C & > \
+ : Param< J, C > {}; \
+ template<> \
+ struct Result< J, const C & > \
+ : Result< J, C > {}; \
+ template<> \
+ struct Param< JA *, C & > \
+ : ArrayRefParam< _jtie_j_BoundedArray< JA, 1 >, C > {}; \
+ template<> \
+ struct Result< J, C & > \
+ : Result< J, C > {}; \
+
// ---------------------------------------------------------------------------
// Specializations for reference to exact-width primitive type conversions
// ---------------------------------------------------------------------------
-// const reference parameters (map as value copy)
-template<> struct Param< jboolean, const bool & > : Param< jboolean, bool > {};
-template<> struct Param< jbyte, const char & > : Param< jbyte, char > {};
-template<> struct Param< jbyte, const int8_t & > : Param< jbyte, int8_t > {};
-template<> struct Param< jbyte, const uint8_t & > : Param< jbyte, uint8_t > {};
-template<> struct Param< jshort, const int16_t & > : Param< jshort, int16_t > {};
-template<> struct Param< jshort, const uint16_t & > : Param< jshort, uint16_t > {};
-template<> struct Param< jint, const int32_t & > : Param< jint, int32_t > {};
-template<> struct Param< jint, const uint32_t & > : Param< jint, uint32_t > {};
-template<> struct Param< jlong, const int64_t & > : Param< jlong, int64_t > {};
-template<> struct Param< jlong, const uint64_t & > : Param< jlong, uint64_t > {};
-template<> struct Param< jfloat, const float & > : Param< jfloat, float > {};
-template<> struct Param< jdouble, const double & > : Param< jdouble, double > {};
-
-// const reference results (map as value copy)
-template<> struct Result< jboolean, const bool & > : Result< jboolean, bool > {};
-template<> struct Result< jbyte, const char & > : Result< jbyte, char > {};
-template<> struct Result< jbyte, const int8_t & > : Result< jbyte, int8_t > {};
-template<> struct Result< jbyte, const uint8_t & > : Result< jbyte, uint8_t > {};
-template<> struct Result< jshort, const int16_t & > : Result< jshort, int16_t > {};
-template<> struct Result< jshort, const uint16_t & > : Result< jshort, uint16_t > {};
-template<> struct Result< jint, const int32_t & > : Result< jint, int32_t > {};
-template<> struct Result< jint, const uint32_t & > : Result< jint, uint32_t > {};
-template<> struct Result< jlong, const int64_t & > : Result< jlong, int64_t > {};
-template<> struct Result< jlong, const uint64_t & > : Result< jlong, uint64_t > {};
-template<> struct Result< jfloat, const float & > : Result< jfloat, float > {};
-template<> struct Result< jdouble, const double & > : Result< jdouble, double > {};
-
-// non-const reference parameters (map as value holders)
-template<> struct Param< _jbooleanArray *, bool & > : ArrayRefParam< _jtie_j_BoundedArray< _jbooleanArray, 1 >, bool > {};
-template<> struct Param< _jbyteArray *, char & > : ArrayRefParam< _jtie_j_BoundedArray< _jbyteArray, 1 >, char > {};
-template<> struct Param< _jbyteArray *, int8_t & > : ArrayRefParam< _jtie_j_BoundedArray< _jbyteArray, 1 >, int8_t > {};
-template<> struct Param< _jbyteArray *, uint8_t & > : ArrayRefParam< _jtie_j_BoundedArray< _jbyteArray, 1 >, uint8_t > {};
-template<> struct Param< _jshortArray *, int16_t & > : ArrayRefParam< _jtie_j_BoundedArray< _jshortArray, 1 >, int16_t > {};
-template<> struct Param< _jshortArray *, uint16_t & > : ArrayRefParam< _jtie_j_BoundedArray< _jshortArray, 1 >, uint16_t > {};
-template<> struct Param< _jintArray *, int32_t & > : ArrayRefParam< _jtie_j_BoundedArray< _jintArray, 1 >, int32_t > {};
-template<> struct Param< _jintArray *, uint32_t & > : ArrayRefParam< _jtie_j_BoundedArray< _jintArray, 1 >, uint32_t > {};
-template<> struct Param< _jlongArray *, int64_t & > : ArrayRefParam< _jtie_j_BoundedArray< _jlongArray, 1 >, int64_t > {};
-template<> struct Param< _jlongArray *, uint64_t & > : ArrayRefParam< _jtie_j_BoundedArray< _jlongArray, 1 >, uint64_t > {};
-template<> struct Param< _jfloatArray *, float & > : ArrayRefParam< _jtie_j_BoundedArray< _jfloatArray, 1 >, float > {};
-template<> struct Param< _jdoubleArray *, double & > : ArrayRefParam< _jtie_j_BoundedArray< _jdoubleArray, 1 >, double > {};
-
-// non-const reference results (map as value copy, no use as value holders)
-template<> struct Result< jboolean, bool & > : Result< jboolean, bool > {};
-template<> struct Result< jbyte, char & > : Result< jbyte, char > {};
-template<> struct Result< jbyte, int8_t & > : Result< jbyte, int8_t > {};
-template<> struct Result< jbyte, uint8_t & > : Result< jbyte, uint8_t > {};
-template<> struct Result< jshort, int16_t & > : Result< jshort, int16_t > {};
-template<> struct Result< jshort, uint16_t & > : Result< jshort, uint16_t > {};
-template<> struct Result< jint, int32_t & > : Result< jint, int32_t > {};
-template<> struct Result< jint, uint32_t & > : Result< jint, uint32_t > {};
-template<> struct Result< jlong, int64_t & > : Result< jlong, int64_t > {};
-template<> struct Result< jlong, uint64_t & > : Result< jlong, uint64_t > {};
-template<> struct Result< jfloat, float & > : Result< jfloat, float > {};
-template<> struct Result< jdouble, double & > : Result< jdouble, double > {};
+JTIE_SPECIALIZE_REFERENCE_TYPE_MAPPING(_jbooleanArray, jboolean, bool)
+
+JTIE_SPECIALIZE_REFERENCE_TYPE_MAPPING(_jbyteArray, jbyte, char)
+JTIE_SPECIALIZE_REFERENCE_TYPE_MAPPING(_jbyteArray, jbyte, signed char)
+JTIE_SPECIALIZE_REFERENCE_TYPE_MAPPING(_jbyteArray, jbyte, unsigned char)
+
+JTIE_SPECIALIZE_REFERENCE_TYPE_MAPPING(_jfloatArray, jfloat, float)
+JTIE_SPECIALIZE_REFERENCE_TYPE_MAPPING(_jdoubleArray, jdouble, double)
// ---------------------------------------------------------------------------
// Specializations for reference to variable-width primitive type conversions
// ---------------------------------------------------------------------------
-// const reference parameters (map as value copy)
-#if (defined(JTIE_TSPECIALIZE_SHORT) && JTIE_TSPECIALIZE_SHORT > 0)
-template<> struct Param< JTIE_JNI_SHORT_T, const signed short & > : Param< JTIE_JNI_SHORT_T, signed short > {};
-template<> struct Param< JTIE_JNI_SHORT_T, const unsigned short & > : Param< JTIE_JNI_SHORT_T, unsigned short > {};
-#endif
-
-#if (defined(JTIE_TSPECIALIZE_INT) && JTIE_TSPECIALIZE_INT > 0)
-template<> struct Param< JTIE_JNI_INT_T, const signed int & > : Param< JTIE_JNI_INT_T, signed int > {};
-template<> struct Param< JTIE_JNI_INT_T, const unsigned int & > : Param< JTIE_JNI_INT_T, unsigned int > {};
-#endif
-
-#if (defined(JTIE_TSPECIALIZE_LONG) && JTIE_TSPECIALIZE_LONG > 0)
-template<> struct Param< JTIE_JNI_LONG_T, const signed long & > : Param< JTIE_JNI_LONG_T, signed long > {};
-template<> struct Param< JTIE_JNI_LONG_T, const unsigned long & > : Param< JTIE_JNI_LONG_T, unsigned long > {};
-#endif
-
-#if (defined(JTIE_TSPECIALIZE_LONGLONG) && JTIE_TSPECIALIZE_LONGLONG > 0)
-template<> struct Param< JTIE_JNI_LONGLONG_T, const signed long long & > : Param< JTIE_JNI_LONGLONG_T, signed long long > {};
-template<> struct Param< JTIE_JNI_LONGLONG_T, const unsigned long long & > : Param< JTIE_JNI_LONGLONG_T, unsigned long long > {};
-#endif
-
-#if (defined(JTIE_TSPECIALIZE_LONGDOUBLE) && JTIE_TSPECIALIZE_LONGDOUBLE > 0)
-template<> struct Param< JTIE_JNI_LONGDOUBLE_T, const long double & > : Param< JTIE_JNI_LONGDOUBLE_T, long double > {};
-#endif
-
-// const reference results (map as value copy)
-#if (defined(JTIE_TSPECIALIZE_SHORT) && JTIE_TSPECIALIZE_SHORT > 0)
-template<> struct Result< JTIE_JNI_SHORT_T, const signed short & > : Result< JTIE_JNI_SHORT_T, signed short > {};
-template<> struct Result< JTIE_JNI_SHORT_T, const unsigned short & > : Result< JTIE_JNI_SHORT_T, unsigned short > {};
-#endif
-
-#if (defined(JTIE_TSPECIALIZE_INT) && JTIE_TSPECIALIZE_INT > 0)
-template<> struct Result< JTIE_JNI_INT_T, const signed int & > : Result< JTIE_JNI_INT_T, signed int > {};
-template<> struct Result< JTIE_JNI_INT_T, const unsigned int & > : Result< JTIE_JNI_INT_T, unsigned int > {};
-#endif
-
-#if (defined(JTIE_TSPECIALIZE_LONG) && JTIE_TSPECIALIZE_LONG > 0)
-template<> struct Result< JTIE_JNI_LONG_T, const signed long & > : Result< JTIE_JNI_LONG_T, signed long > {};
-template<> struct Result< JTIE_JNI_LONG_T, const unsigned long & > : Result< JTIE_JNI_LONG_T, unsigned long > {};
-#endif
-
-#if (defined(JTIE_TSPECIALIZE_LONGLONG) && JTIE_TSPECIALIZE_LONGLONG > 0)
-template<> struct Result< JTIE_JNI_LONGLONG_T, const signed long long & > : Result< JTIE_JNI_LONGLONG_T, signed long long > {};
-template<> struct Result< JTIE_JNI_LONGLONG_T, const unsigned long long & > : Result< JTIE_JNI_LONGLONG_T, unsigned long long > {};
-#endif
-
-#if (defined(JTIE_TSPECIALIZE_LONGDOUBLE) && JTIE_TSPECIALIZE_LONGDOUBLE > 0)
-template<> struct Result< JTIE_JNI_LONGDOUBLE_T, const long double & > : Result< JTIE_JNI_LONGDOUBLE_T, long double > {};
-#endif
-
-// non-const reference parameters (map as value holders)
-#if (defined(JTIE_TSPECIALIZE_SHORT_ARRAY) && JTIE_TSPECIALIZE_SHORT_ARRAY > 0)
-template<> struct Param< JTIE_JNI_SHORT_ARRAY_T, const signed short & > : ArrayRefParam< _jtie_j_BoundedArray< JTIE_JNI_SHORT_ARRAY_T, 1 >, signed short > {};
-template<> struct Param< JTIE_JNI_SHORT_ARRAY_T, const unsigned short & > : ArrayRefParam< _jtie_j_BoundedArray< JTIE_JNI_SHORT_ARRAY_T, 1 >, unsigned short > {};
-#endif
-
-#if (defined(JTIE_TSPECIALIZE_INT_ARRAY) && JTIE_TSPECIALIZE_INT_ARRAY > 0)
-template<> struct Param< JTIE_JNI_INT_ARRAY_T, const signed int & > : ArrayRefParam< _jtie_j_BoundedArray< JTIE_JNI_INT_ARRAY_T, 1 >, signed int > {};
-template<> struct Param< JTIE_JNI_INT_ARRAY_T, const unsigned int & > : ArrayRefParam< _jtie_j_BoundedArray< JTIE_JNI_INT_ARRAY_T, 1 >, unsigned int > {};
-#endif
-
-#if (defined(JTIE_TSPECIALIZE_LONG_ARRAY) && JTIE_TSPECIALIZE_LONG_ARRAY > 0)
-template<> struct Param< JTIE_JNI_LONG_ARRAY_T, const signed long & > : ArrayRefParam< _jtie_j_BoundedArray< JTIE_JNI_LONG_ARRAY_T, 1 >, signed long > {};
-template<> struct Param< JTIE_JNI_LONG_ARRAY_T, const unsigned long & > : ArrayRefParam< _jtie_j_BoundedArray< JTIE_JNI_LONG_ARRAY_T, 1 >, unsigned long > {};
-#endif
-
-#if (defined(JTIE_TSPECIALIZE_LONGLONG_ARRAY) && JTIE_TSPECIALIZE_LONGLONG_ARRAY > 0)
-template<> struct Param< JTIE_JNI_LONGLONG_ARRAY_T, const signed long long & > : ArrayRefParam< _jtie_j_BoundedArray< JTIE_JNI_LONGLONG_ARRAY_T, 1 >, signed long long > {};
-template<> struct Param< JTIE_JNI_LONGLONG_ARRAY_T, const unsigned long long & > : ArrayRefParam< _jtie_j_BoundedArray< JTIE_JNI_LONGLONG_ARRAY_T, 1 >, unsigned long long > {};
-#endif
-
-#if (defined(JTIE_TSPECIALIZE_LONGDOUBLE_ARRAY) && JTIE_TSPECIALIZE_LONGDOUBLE_ARRAY > 0)
-template<> struct Param< JTIE_JNI_LONGDOUBLE_ARRAY_T, const long double & > : ArrayRefParam< _jtie_j_BoundedArray< JTIE_JNI_LONGDOUBLE_ARRAY_T, 1 >, long double > {};
-#endif
-
-// non-const reference results (map as value copy, no use as value holders)
-#if (defined(JTIE_TSPECIALIZE_SHORT) && JTIE_TSPECIALIZE_SHORT > 0)
-template<> struct Result< JTIE_JNI_SHORT_T, signed short & > : Result< JTIE_JNI_SHORT_T, signed short > {};
-template<> struct Result< JTIE_JNI_SHORT_T, unsigned short & > : Result< JTIE_JNI_SHORT_T, unsigned short > {};
-#endif
-
-#if (defined(JTIE_TSPECIALIZE_INT) && JTIE_TSPECIALIZE_INT > 0)
-template<> struct Result< JTIE_JNI_INT_T, signed int & > : Result< JTIE_JNI_INT_T, signed int > {};
-template<> struct Result< JTIE_JNI_INT_T, unsigned int & > : Result< JTIE_JNI_INT_T, unsigned int > {};
-#endif
-
-#if (defined(JTIE_TSPECIALIZE_LONG) && JTIE_TSPECIALIZE_LONG > 0)
-template<> struct Result< JTIE_JNI_LONG_T, signed long & > : Result< JTIE_JNI_LONG_T, signed long > {};
-template<> struct Result< JTIE_JNI_LONG_T, unsigned long & > : Result< JTIE_JNI_LONG_T, unsigned long > {};
-#endif
-
-#if (defined(JTIE_TSPECIALIZE_LONGLONG) && JTIE_TSPECIALIZE_LONGLONG > 0)
-template<> struct Result< JTIE_JNI_LONGLONG_T, signed long long & > : Result< JTIE_JNI_LONGLONG_T, signed long long > {};
-template<> struct Result< JTIE_JNI_LONGLONG_T, unsigned long long & > : Result< JTIE_JNI_LONGLONG_T, unsigned long long > {};
-#endif
-
-#if (defined(JTIE_TSPECIALIZE_LONGDOUBLE) && JTIE_TSPECIALIZE_LONGDOUBLE > 0)
-template<> struct Result< JTIE_JNI_LONGDOUBLE_T, long double & > : Result< JTIE_JNI_LONGDOUBLE_T, long double > {};
-#endif
+// jshort in LP32, ILP32, LP64, ILP64, LLP64
+JTIE_SPECIALIZE_REFERENCE_TYPE_MAPPING(_jshortArray, jshort, signed short)
+JTIE_SPECIALIZE_REFERENCE_TYPE_MAPPING(_jshortArray, jshort, unsigned short)
+
+// jshort in LP32
+JTIE_SPECIALIZE_REFERENCE_TYPE_MAPPING(_jshortArray, jshort, signed int)
+JTIE_SPECIALIZE_REFERENCE_TYPE_MAPPING(_jshortArray, jshort, unsigned int)
+
+// jint in ILP32, LP64, LLP64
+JTIE_SPECIALIZE_REFERENCE_TYPE_MAPPING(_jintArray, jint, signed int)
+JTIE_SPECIALIZE_REFERENCE_TYPE_MAPPING(_jintArray, jint, unsigned int)
+
+// jint in LP32, ILP32, LLP64
+JTIE_SPECIALIZE_REFERENCE_TYPE_MAPPING(_jintArray, jint, signed long)
+JTIE_SPECIALIZE_REFERENCE_TYPE_MAPPING(_jintArray, jint, unsigned long)
+
+// jlong in ILP64
+JTIE_SPECIALIZE_REFERENCE_TYPE_MAPPING(_jlongArray, jlong, signed int)
+JTIE_SPECIALIZE_REFERENCE_TYPE_MAPPING(_jlongArray, jlong, unsigned int)
+
+// jlong in LP64, ILP64
+JTIE_SPECIALIZE_REFERENCE_TYPE_MAPPING(_jlongArray, jlong, signed long)
+JTIE_SPECIALIZE_REFERENCE_TYPE_MAPPING(_jlongArray, jlong, unsigned long)
+
+// jlong in LLP64
+JTIE_SPECIALIZE_REFERENCE_TYPE_MAPPING(_jlongArray, jlong, signed long long)
+JTIE_SPECIALIZE_REFERENCE_TYPE_MAPPING(_jlongArray, jlong, unsigned long long)
+
+// jdouble
+JTIE_SPECIALIZE_REFERENCE_TYPE_MAPPING(_jdoubleArray, jdouble, long double)
// ---------------------------------------------------------------------------
=== modified file 'storage/ndb/ndbjtie/jtie/include/jtie_tconv_string_impl.hpp'
--- a/storage/ndb/ndbjtie/jtie/include/jtie_tconv_string_impl.hpp 2009-09-18 20:40:07 +0000
+++ b/storage/ndb/ndbjtie/jtie/include/jtie_tconv_string_impl.hpp 2009-11-07 04:40:48 +0000
@@ -30,7 +30,7 @@
#include "helpers.hpp"
// ---------------------------------------------------------------------------
-// Specializations for Java String <-> const char * type conversion
+// Java String <-> const char * type conversion
// ---------------------------------------------------------------------------
// XXX subclass _jstring to distinguish UTF8 encoding from UCS2 and
@@ -42,11 +42,21 @@
// GetStringCritical()) are not NULL-terminated! Some OS (e.g., Windows)
// expect two trailing zero byte values to terminate Unicode strings.
+// Implements the mapping of Java String parameters.
+// declared as template to support other specializations (e.g. char *)
+template< typename J, typename C >
+struct ParamStringT;
+
+// Implements the mapping of Java String results.
+// declared as template to support other specializations (e.g. char *)
+template< typename J, typename C >
+struct ResultStringT;
+
template<>
-struct Param< jstring, const char * > {
+struct ParamStringT< jstring, const char * > {
static const char *
convert(cstatus & s, jstring j, JNIEnv * env) {
- TRACE("const char * Param.convert(cstatus &, jstring, JNIEnv *)");
+ TRACE("const char * ParamStringT.convert(cstatus &, jstring, JNIEnv *)");
s = -1; // init to error
const char * c = NULL;
@@ -70,7 +80,7 @@ struct Param< jstring, const char * > {
static void
release(const char * c, jstring j, JNIEnv * env) {
- TRACE("void Param.release(const char *, jstring, JNIEnv *)");
+ TRACE("void ParamStringT.release(const char *, jstring, JNIEnv *)");
if (c == NULL) {
assert(j == NULL);
} else {
@@ -82,10 +92,10 @@ struct Param< jstring, const char * > {
};
template<>
-struct Result< jstring, const char * > {
+struct ResultStringT< jstring, const char * > {
static jstring
convert(const char * c, JNIEnv * env) {
- TRACE("jstring Result.convert(const char *, JNIEnv *)");
+ TRACE("jstring ResultStringT.convert(const char *, JNIEnv *)");
if (c == NULL)
return NULL;
@@ -94,6 +104,25 @@ struct Result< jstring, const char * > {
}
};
+// ---------------------------------------------------------------------------
+// Specializations for Java String <-> const char * type conversion
+// ---------------------------------------------------------------------------
+
+// extend String specializations to const pointers
+template< typename C >
+struct Param< jstring, C * const >
+ : Param< jstring, C * > {};
+template< typename C >
+struct Result< jstring, C * const >
+ : Result< jstring, C * > {};
+
+// specialize Java Strings mapped to C strings:
+template<>
+struct Param< jstring, const char * >
+ : ParamStringT< jstring, const char * > {};
+template<>
+struct Result< jstring, const char * >
+ : ResultStringT< jstring, const char * > {};
// ---------------------------------------------------------------------------
// StringBuilder
=== modified file 'storage/ndb/ndbjtie/jtie/include/jtie_tconv_value.hpp'
--- a/storage/ndb/ndbjtie/jtie/include/jtie_tconv_value.hpp 2009-10-27 06:56:52 +0000
+++ b/storage/ndb/ndbjtie/jtie/include/jtie_tconv_value.hpp 2009-11-07 04:40:48 +0000
@@ -26,7 +26,6 @@
#include <jni.h>
#include "jtie_tconv.hpp"
-#include "jtie_tconv_vwidth.hpp"
// ---------------------------------------------------------------------------
// Java <-> C primitive type conversions
@@ -48,26 +47,6 @@ typedef ttrait< jlong, uint64_t > ttrait
typedef ttrait< jfloat, float > ttrait_float;
typedef ttrait< jdouble, double > ttrait_double;
-#ifdef JTIE_JNI_SHORT_T
-typedef ttrait< JTIE_JNI_SHORT_T, signed short > ttrait_short;
-typedef ttrait< JTIE_JNI_SHORT_T, unsigned short > ttrait_ushort;
-#endif
-#ifdef JTIE_JNI_INT_T
-typedef ttrait< JTIE_JNI_INT_T, signed int > ttrait_int;
-typedef ttrait< JTIE_JNI_INT_T, unsigned int > ttrait_uint;
-#endif
-#ifdef JTIE_JNI_LONG_T
-typedef ttrait< JTIE_JNI_LONG_T, signed long > ttrait_long;
-typedef ttrait< JTIE_JNI_LONG_T, unsigned long > ttrait_ulong;
-#endif
-#ifdef JTIE_JNI_LONGLONG_T
-typedef ttrait< JTIE_JNI_LONGLONG_T, signed long long > ttrait_longlong;
-typedef ttrait< JTIE_JNI_LONGLONG_T, unsigned long long > ttrait_ulonglong;
-#endif
-#ifdef JTIE_JNI_LONGDOUBLE_T
-typedef ttrait< JTIE_JNI_LONGDOUBLE_T, long double > ttrait_longdouble;
-#endif
-
// aliases for: <const-primitive-ctype>
typedef ttrait< jboolean, const bool > ttrait_bool_c;
typedef ttrait< jbyte, const char > ttrait_char_c;
@@ -84,30 +63,11 @@ typedef ttrait< jlong, const uint64_t >
typedef ttrait< jfloat, const float > ttrait_float_c;
typedef ttrait< jdouble, const double > ttrait_double_c;
-#ifdef JTIE_JNI_SHORT_T
-typedef ttrait< JTIE_JNI_SHORT_T, const signed short > ttrait_short_c;
-typedef ttrait< JTIE_JNI_SHORT_T, const unsigned short > ttrait_ushort_c;
-#endif
-#ifdef JTIE_JNI_INT_T
-typedef ttrait< JTIE_JNI_INT_T, const signed int > ttrait_int_c;
-typedef ttrait< JTIE_JNI_INT_T, const unsigned int > ttrait_uint_c;
-#endif
-#ifdef JTIE_JNI_LONG_T
-typedef ttrait< JTIE_JNI_LONG_T, const signed long > ttrait_long_c;
-typedef ttrait< JTIE_JNI_LONG_T, const unsigned long > ttrait_ulong_c;
-#endif
-#ifdef JTIE_JNI_LONGLONG_T
-typedef ttrait< JTIE_JNI_LONGLONG_T, const signed long long > ttrait_longlong_c;
-typedef ttrait< JTIE_JNI_LONGLONG_T, const unsigned long long > ttrait_ulonglong_c;
-#endif
-#ifdef JTIE_JNI_LONGDOUBLE_T
-typedef ttrait< JTIE_JNI_LONGDOUBLE_T, const long double > ttrait_longdouble_c;
-#endif
-
/**
* A helper class template that predicates the supported type conversions
* by presence of specialization.
*/
+// XXX move? used where?
template < typename J, typename C >
struct is_valid_primitive_type_mapping;
=== modified file 'storage/ndb/ndbjtie/jtie/include/jtie_tconv_value_impl.hpp'
--- a/storage/ndb/ndbjtie/jtie/include/jtie_tconv_value_impl.hpp 2009-11-04 17:28:51 +0000
+++ b/storage/ndb/ndbjtie/jtie/include/jtie_tconv_value_impl.hpp 2009-11-07 04:40:48 +0000
@@ -31,7 +31,7 @@
#include "helpers.hpp"
// ---------------------------------------------------------------------------
-// Java value <-> C value conversions
+// Java <-> C basic type conversions
// ---------------------------------------------------------------------------
// Implements primitive type parameter conversions.
@@ -42,6 +42,7 @@ struct ParamBasicT {
TRACE("C ParamBasicT.convert(cstatus &, J, JNIEnv *)");
(void)env;
s = 0;
+ // XXX assert(static_cast< J >(static_cast< C >(j)) == j);
return static_cast< C >(j); // may convert to unsigned type
}
@@ -66,6 +67,7 @@ struct ResultBasicT {
convert(C c, JNIEnv * env) {
TRACE("J ResultBasicT.convert(C, JNIEnv *)");
(void)env;
+ // XXX assert(static_cast< C >(static_cast< J >(c)) == c);
return static_cast< J >(c); // may convert to signed type
}
@@ -77,6 +79,34 @@ private:
}
};
+// ---------------------------------------------------------------------------
+// Specializations for basic type conversions
+// ---------------------------------------------------------------------------
+
+// Avoid mapping types by broad, generic rules, which easily results in
+// template instantiation ambiguities for non-primitive types. Therefore,
+// we enumerate all specicializations for primitive types.
+
+// Lessons learned:
+//
+// Cannot extend Param/Result specializations for const types by a generic
+// rule on the base class (no template match with this indirection)
+// template<> struct ParamBasicT< J, C const > : ParamBasicT< J, C > {};
+// template<> struct ResultBasicT< J, C const > : ResultBasicT< J, C > {};
+// but have to specialize Param/Result directly
+// template<> struct Param< J, C const > : ParamBasicT< J, C > {};
+// template<> struct Result< J, C const > : ResultBasicT< J, C > {};
+//
+// Specializations must be defined over intrinsic types, not aliases
+//
+// Datatype LP64 ILP64 LLP64 ILP32 LP32
+// char 8 8 8 8 8
+// short 16 16 16 16 16
+// int 32 64 32 32 16
+// long 64 64 32 32 32
+// long long 64
+// pointer 64 64 64 32 32
+
// extend set of valid primitive type mappings for const value specializations
template < typename J, typename C >
struct is_valid_primitive_type_mapping< const J, C > {};
@@ -85,19 +115,29 @@ struct is_valid_primitive_type_mapping<
template < typename J, typename C >
struct is_valid_primitive_type_mapping< const J, const C > {};
+// also provides specializations for 'const'
+// template clutter can be reduced a bit: const value types do not need extra
+// specializations of their implementation
+// ... : ParamBasicT< J, C const > {};
+// ... : ResultBasicT< J, C const > {};
+// but can be derived from their non-const specializations
+#define JTIE_SPECIALIZE_BASIC_TYPE_MAPPING( J, C ) \
+ template<> struct is_valid_primitive_type_mapping< J, C > {}; \
+ template<> struct Param< J, C > : ParamBasicT< J, C > {}; \
+ template<> struct Result< J, C > : ResultBasicT< J, C > {}; \
+ template<> struct Param< J, C const > : ParamBasicT< J, C > {}; \
+ template<> struct Result< J, C const > : ResultBasicT< J, C > {};
+
// ---------------------------------------------------------------------------
-// Specializations for jboolean <-> bool conversions
+// Specializations for boolean conversions
// ---------------------------------------------------------------------------
-// define valid primitive type mapping for boolean
-template <> struct is_valid_primitive_type_mapping< jboolean, bool > {};
-
// Implements boolean type parameter conversions.
template<>
-struct Param< jboolean, bool > {
+struct ParamBasicT< jboolean, bool > {
static bool
convert(cstatus & s, jboolean j, JNIEnv * env) {
- TRACE("bool Param.convert(cstatus &, jboolean, JNIEnv *)");
+ TRACE("bool ParamBasicT.convert(cstatus &, jboolean, JNIEnv *)");
(void)env;
s = 0;
// Java v C: jboolean is unsigned 8-bit, so, beware of truncation
@@ -106,129 +146,79 @@ struct Param< jboolean, bool > {
static void
release(bool c, jboolean j, JNIEnv * env) {
- TRACE("void Param.release(bool, jboolean, JNIEnv *)");
+ TRACE("void ParamBasicT.release(bool, jboolean, JNIEnv *)");
(void)c; (void)j; (void)env;
}
};
// Implements boolean type result conversions.
template<>
-struct Result< jboolean, bool > {
+struct ResultBasicT< jboolean, bool > {
static jboolean
convert(bool c, JNIEnv * env) {
- TRACE("jboolean Result.convert(bool, JNIEnv *)");
+ TRACE("jboolean ResultBasicT.convert(bool, JNIEnv *)");
(void)env;
// Java v C: jboolean is unsigned 8-bit, so, beware of truncation
- return (c ? JNI_TRUE : JNI_FALSE);
+ // on some platforms, JNI_TRUE/FALSE seems top be defined as int
+ return static_cast< jboolean >(c ? JNI_TRUE : JNI_FALSE);
}
};
-// specialize to empty unused Param/ResultBasicT for booleans
-template<> struct ParamBasicT< jboolean, bool > {};
-template<> struct ResultBasicT< jboolean, bool > {};
+JTIE_SPECIALIZE_BASIC_TYPE_MAPPING(jboolean, bool)
// ---------------------------------------------------------------------------
// Specializations for exact-width number type conversions
// ---------------------------------------------------------------------------
-// Avoid mapping types by broad, generic rules, which easily results in
-// template instantiation ambiguities for non-primitive types. Therefore,
-// we enumerate all specicializations for primitive types.
+JTIE_SPECIALIZE_BASIC_TYPE_MAPPING(jbyte, char)
+JTIE_SPECIALIZE_BASIC_TYPE_MAPPING(jbyte, signed char)
+JTIE_SPECIALIZE_BASIC_TYPE_MAPPING(jbyte, unsigned char)
-// define set of valid primitive type mappings
-template <> struct is_valid_primitive_type_mapping< jbyte, char > {};
-template <> struct is_valid_primitive_type_mapping< jbyte, int8_t > {};
-template <> struct is_valid_primitive_type_mapping< jbyte, uint8_t > {};
-template <> struct is_valid_primitive_type_mapping< jshort, int16_t > {};
-template <> struct is_valid_primitive_type_mapping< jshort, uint16_t > {};
-template <> struct is_valid_primitive_type_mapping< jint, int32_t > {};
-template <> struct is_valid_primitive_type_mapping< jint, uint32_t > {};
-template <> struct is_valid_primitive_type_mapping< jlong, int64_t > {};
-template <> struct is_valid_primitive_type_mapping< jlong, uint64_t > {};
-template <> struct is_valid_primitive_type_mapping< jfloat, float > {};
-template <> struct is_valid_primitive_type_mapping< jdouble, double > {};
-
-// non-const primitive parameter types
-template<> struct Param< jbyte, char > : ParamBasicT< jbyte, char > {};
-template<> struct Param< jbyte, int8_t > : ParamBasicT< jbyte, int8_t > {};
-template<> struct Param< jbyte, uint8_t > : ParamBasicT< jbyte, uint8_t > {};
-template<> struct Param< jshort, int16_t > : ParamBasicT< jshort, int16_t > {};
-template<> struct Param< jshort, uint16_t > : ParamBasicT< jshort, uint16_t > {};
-template<> struct Param< jint, int32_t > : ParamBasicT< jint, int32_t > {};
-template<> struct Param< jint, uint32_t > : ParamBasicT< jint, uint32_t > {};
-template<> struct Param< jlong, int64_t > : ParamBasicT< jlong, int64_t > {};
-template<> struct Param< jlong, uint64_t > : ParamBasicT< jlong, uint64_t > {};
-template<> struct Param< jfloat, float > : ParamBasicT< jfloat, float > {};
-template<> struct Param< jdouble, double > : ParamBasicT< jdouble, double > {};
-
-// non-const primitive result types
-template<> struct Result< jbyte, char > : ResultBasicT< jbyte, char > {};
-template<> struct Result< jbyte, int8_t > : ResultBasicT< jbyte, int8_t > {};
-template<> struct Result< jbyte, uint8_t > : ResultBasicT< jbyte, uint8_t > {};
-template<> struct Result< jshort, int16_t > : ResultBasicT< jshort, int16_t > {};
-template<> struct Result< jshort, uint16_t > : ResultBasicT< jshort, uint16_t > {};
-template<> struct Result< jint, int32_t > : ResultBasicT< jint, int32_t > {};
-template<> struct Result< jint, uint32_t > : ResultBasicT< jint, uint32_t > {};
-template<> struct Result< jlong, int64_t > : ResultBasicT< jlong, int64_t > {};
-template<> struct Result< jlong, uint64_t > : ResultBasicT< jlong, uint64_t > {};
-template<> struct Result< jfloat, float > : ResultBasicT< jfloat, float > {};
-template<> struct Result< jdouble, double > : ResultBasicT< jdouble, double > {};
+JTIE_SPECIALIZE_BASIC_TYPE_MAPPING(jfloat, float)
+JTIE_SPECIALIZE_BASIC_TYPE_MAPPING(jdouble, double)
// ---------------------------------------------------------------------------
// Specializations for variable-width number type conversions
// ---------------------------------------------------------------------------
-#if (defined(JTIE_TSPECIALIZE_SHORT) && JTIE_TSPECIALIZE_SHORT > 0)
-template <> struct is_valid_primitive_type_mapping< JTIE_JNI_SHORT_T, signed short > {};
-template <> struct is_valid_primitive_type_mapping< JTIE_JNI_SHORT_T, unsigned short > {};
-
-template<> struct Param< JTIE_JNI_SHORT_T, signed short > : ParamBasicT< JTIE_JNI_SHORT_T, signed short > {};
-template<> struct Param< JTIE_JNI_SHORT_T, unsigned short > : ParamBasicT< JTIE_JNI_SHORT_T, unsigned short > {};
-
-template<> struct Result< JTIE_JNI_SHORT_T, signed short > : ResultBasicT< JTIE_JNI_SHORT_T, signed short > {};
-template<> struct Result< JTIE_JNI_SHORT_T, unsigned short > : ResultBasicT< JTIE_JNI_SHORT_T, unsigned short > {};
-#endif
-
-#if (defined(JTIE_TSPECIALIZE_INT) && JTIE_TSPECIALIZE_INT > 0)
-template <> struct is_valid_primitive_type_mapping< JTIE_JNI_INT_T, signed int > {};
-template <> struct is_valid_primitive_type_mapping< JTIE_JNI_INT_T, unsigned int > {};
-
-template<> struct Param< JTIE_JNI_INT_T, signed int > : ParamBasicT< JTIE_JNI_INT_T, signed int > {};
-template<> struct Param< JTIE_JNI_INT_T, unsigned int > : ParamBasicT< JTIE_JNI_INT_T, unsigned int > {};
-
-template<> struct Result< JTIE_JNI_INT_T, signed int > : ResultBasicT< JTIE_JNI_INT_T, signed int > {};
-template<> struct Result< JTIE_JNI_INT_T, unsigned int > : ResultBasicT< JTIE_JNI_INT_T, unsigned int > {};
-#endif
-
-#if (defined(JTIE_TSPECIALIZE_LONG) && JTIE_TSPECIALIZE_LONG > 0)
-template <> struct is_valid_primitive_type_mapping< JTIE_JNI_LONG_T, signed long > {};
-template <> struct is_valid_primitive_type_mapping< JTIE_JNI_LONG_T, unsigned long > {};
-
-template<> struct Param< JTIE_JNI_LONG_T, signed long > : ParamBasicT< JTIE_JNI_LONG_T, signed long > {};
-template<> struct Param< JTIE_JNI_LONG_T, unsigned long > : ParamBasicT< JTIE_JNI_LONG_T, unsigned long > {};
-
-template<> struct Result< JTIE_JNI_LONG_T, signed long > : ResultBasicT< JTIE_JNI_LONG_T, signed long > {};
-template<> struct Result< JTIE_JNI_LONG_T, unsigned long > : ResultBasicT< JTIE_JNI_LONG_T, unsigned long > {};
-#endif
-
-#if (defined(JTIE_TSPECIALIZE_LONGLONG) && JTIE_TSPECIALIZE_LONGLONG > 0)
-template <> struct is_valid_primitive_type_mapping< JTIE_JNI_LONGLONG_T, signed long long > {};
-template <> struct is_valid_primitive_type_mapping< JTIE_JNI_LONGLONG_T, unsigned long long > {};
-
-template<> struct Param< JTIE_JNI_LONGLONG_T, signed long long > : ParamBasicT< JTIE_JNI_LONGLONG_T, signed long long > {};
-template<> struct Param< JTIE_JNI_LONGLONG_T, unsigned long long > : ParamBasicT< JTIE_JNI_LONGLONG_T, unsigned long long > {};
-
-template<> struct Result< JTIE_JNI_LONGLONG_T, signed long long > : ResultBasicT< JTIE_JNI_LONGLONG_T, signed long long > {};
-template<> struct Result< JTIE_JNI_LONGLONG_T, unsigned long long > : ResultBasicT< JTIE_JNI_LONGLONG_T, unsigned long long > {};
-#endif
-
-#if (defined(JTIE_TSPECIALIZE_LONGDOUBLE) && JTIE_TSPECIALIZE_LONGDOUBLE > 0)
-template <> struct is_valid_primitive_type_mapping< JTIE_JNI_LONGDOUBLE_T, long double > {};
-
-template<> struct Param< JTIE_JNI_LONGDOUBLE_T, long double > : ParamBasicT< JTIE_JNI_LONGDOUBLE_T, long double > {};
+// Datatype LP32 ILP32 LP64 ILP64 LLP64
+// char 8 8 8 8 8
+// short 16 16 16 16 16
+// int 16 32 32 64 32
+// long 32 32 64 64 32
+// long long 64
+// pointer 32 32 64 64 64
+
+// jshort in LP32, ILP32, LP64, ILP64, LLP64
+JTIE_SPECIALIZE_BASIC_TYPE_MAPPING(jshort, signed short)
+JTIE_SPECIALIZE_BASIC_TYPE_MAPPING(jshort, unsigned short)
+
+// jshort in LP32
+JTIE_SPECIALIZE_BASIC_TYPE_MAPPING(jshort, signed int)
+JTIE_SPECIALIZE_BASIC_TYPE_MAPPING(jshort, unsigned int)
+
+// jint in ILP32, LP64, LLP64
+JTIE_SPECIALIZE_BASIC_TYPE_MAPPING(jint, signed int)
+JTIE_SPECIALIZE_BASIC_TYPE_MAPPING(jint, unsigned int)
+
+// jint in LP32, ILP32, LLP64
+JTIE_SPECIALIZE_BASIC_TYPE_MAPPING(jint, signed long)
+JTIE_SPECIALIZE_BASIC_TYPE_MAPPING(jint, unsigned long)
+
+// jlong in ILP64
+JTIE_SPECIALIZE_BASIC_TYPE_MAPPING(jlong, signed int)
+JTIE_SPECIALIZE_BASIC_TYPE_MAPPING(jlong, unsigned int)
+
+// jlong in LP64, ILP64
+JTIE_SPECIALIZE_BASIC_TYPE_MAPPING(jlong, signed long)
+JTIE_SPECIALIZE_BASIC_TYPE_MAPPING(jlong, unsigned long)
+
+// jlong in LLP64
+JTIE_SPECIALIZE_BASIC_TYPE_MAPPING(jlong, signed long long)
+JTIE_SPECIALIZE_BASIC_TYPE_MAPPING(jlong, unsigned long long)
-template<> struct Result< JTIE_JNI_LONGDOUBLE_T, long double > : ResultBasicT< JTIE_JNI_LONGDOUBLE_T, long double > {};
-#endif
+// jdouble
+JTIE_SPECIALIZE_BASIC_TYPE_MAPPING(jdouble, long double)
// ---------------------------------------------------------------------------
=== modified file 'storage/ndb/ndbjtie/jtie/include/jtie_tconv_vwidth.hpp'
--- a/storage/ndb/ndbjtie/jtie/include/jtie_tconv_vwidth.hpp 2009-11-04 17:28:51 +0000
+++ b/storage/ndb/ndbjtie/jtie/include/jtie_tconv_vwidth.hpp 2009-11-07 04:40:48 +0000
@@ -32,46 +32,250 @@
// XXX assert bits_in_byte == 8, for we don't list char-types here
-#define JTIE_TSPECIALIZE_SHORT 0
-#define JTIE_TSPECIALIZE_INT 0
-#define JTIE_TSPECIALIZE_LONG 1
-#define JTIE_TSPECIALIZE_LONGLONG 0
-#define JTIE_TSPECIALIZE_LONGDOUBLE 1
-
#define JTIE_JNI_SHORT_T jshort
#define JTIE_JNI_INT_T jint
#define JTIE_JNI_LONG_T jint
#define JTIE_JNI_LONGLONG_T jlong
#define JTIE_JNI_LONGDOUBLE_T jdouble
+// XXX if #define JTIE_JNI_LONG_T jint
+//
+//calling f19()
+//--> jint Java_myjapi_MyJapiCtypes_f19(JNIEnv *, jclass, jint)
+//--> RT::JF_t gcall(JNIEnv *, jclass, P1T::JF_t)
+//--> T cast(S)
+//<-- T cast(S)
+//java: symbol lookup error: /home/mz/mysql/ndb-6.3-ndbjtie-automake/storage/ndb/ndbjtie/jtie/test/myjapi/.libs/libmyjapi.so.0.0.0: undefined symbol: _ZN5ParamIilE7convertERiiP7JNIEnv_
+
+// XXX if #define JTIE_TSPECIALIZE_LONGLONG 0
+//
+//calling f21()
+//--> jlong Java_myjapi_MyJapiCtypes_f21(JNIEnv *, jclass, jlong)
+//--> RT::JF_t gcall(JNIEnv *, jclass, P1T::JF_t)
+//--> T cast(S)
+//<-- T cast(S)
+//java: symbol lookup error: /home/mz/mysql/ndb-6.3-ndbjtie-automake/storage/ndb/ndbjtie/jtie/test/myjapi/.libs/libmyjapi.so.0.0.0: undefined symbol: _ZN5ParamIlxE7convertERilP7JNIEnv_
+
+// aliases for: <primitive-ctype>, <const-primitive-ctype>
+#ifdef JTIE_JNI_SHORT_T
+typedef ttrait< JTIE_JNI_SHORT_T, signed short > ttrait_short;
+typedef ttrait< JTIE_JNI_SHORT_T, unsigned short > ttrait_ushort;
+typedef ttrait< JTIE_JNI_SHORT_T, const signed short > ttrait_short_c;
+typedef ttrait< JTIE_JNI_SHORT_T, const unsigned short > ttrait_ushort_c;
+#endif
+#ifdef JTIE_JNI_INT_T
+typedef ttrait< JTIE_JNI_INT_T, signed int > ttrait_int;
+typedef ttrait< JTIE_JNI_INT_T, unsigned int > ttrait_uint;
+typedef ttrait< JTIE_JNI_INT_T, const signed int > ttrait_int_c;
+typedef ttrait< JTIE_JNI_INT_T, const unsigned int > ttrait_uint_c;
+#endif
+#ifdef JTIE_JNI_LONG_T
+typedef ttrait< JTIE_JNI_LONG_T, signed long > ttrait_long;
+typedef ttrait< JTIE_JNI_LONG_T, unsigned long > ttrait_ulong;
+typedef ttrait< JTIE_JNI_LONG_T, const signed long > ttrait_long_c;
+typedef ttrait< JTIE_JNI_LONG_T, const unsigned long > ttrait_ulong_c;
+#endif
+#ifdef JTIE_JNI_LONGLONG_T
+typedef ttrait< JTIE_JNI_LONGLONG_T, signed long long > ttrait_longlong;
+typedef ttrait< JTIE_JNI_LONGLONG_T, unsigned long long > ttrait_ulonglong;
+typedef ttrait< JTIE_JNI_LONGLONG_T, const signed long long > ttrait_longlong_c;
+typedef ttrait< JTIE_JNI_LONGLONG_T, const unsigned long long > ttrait_ulonglong_c;
+#endif
+#ifdef JTIE_JNI_LONGDOUBLE_T
+typedef ttrait< JTIE_JNI_LONGDOUBLE_T, long double > ttrait_longdouble;
+typedef ttrait< JTIE_JNI_LONGDOUBLE_T, const long double > ttrait_longdouble_c;
+#endif
+
+// ---------------------------------------------------------------------------
+
// XXX variable-width type array conversions not supported yet
// - default implementation would only support same-width types
// - no unit tests yet
#if 0
-#define JTIE_TSPECIALIZE_SHORT_ARRAY 0
-#define JTIE_TSPECIALIZE_INT_ARRAY 0
-#define JTIE_TSPECIALIZE_LONG_ARRAY 0
-#define JTIE_TSPECIALIZE_LONGLONG_ARRAY 0
-#define JTIE_TSPECIALIZE_LONGDOUBLE_ARRAY 0
-
#define JTIE_JNI_SHORT_ARRAY_T _jshortArray
#define JTIE_JNI_INT_ARRAY_T _jintArray
#define JTIE_JNI_LONG_ARRAY_T _jintArray
#define JTIE_JNI_LONGLONG_ARRAY_T _jlongArray
#define JTIE_JNI_LONGDOUBLE_ARRAY_T _jdoubleArray
-#define JTIE_JNI_GET_LONG_ARRAY_ELEMENTS GetIntArrayElements
-#define JTIE_JNI_RELEASE_LONG_ARRAY_ELEMENTS ReleaseIntArrayElements
-#define JTIE_JNI_NEW_LONG_ARRAY NewIntArray
-#define JTIE_JNI_SET_LONG_ARRAY_REGION SetIntArrayRegion
-
-#define JTIE_JNI_GET_LONGDOUBLE_ARRAY_ELEMENTS GetDoubleArrayElements
-#define JTIE_JNI_RELEASE_LONGDOUBLE_ARRAY_ELEMENTS ReleaseDoubleArrayElements
-#define JTIE_JNI_NEW_LONGDOUBLE_ARRAY NewDoubleArray
-#define JTIE_JNI_SET_LONGDOUBLE_ARRAY_REGION SetDoubleArrayRegion
+// aliases for: <primitive-ctype>_<pointer>_<Array<size=0>>
+
+#ifdef JTIE_JNI_SHORT_ARRAY_T
+typedef ttrait< JTIE_JNI_SHORT_ARRAY_T *, signed short * > ttrait_short_0p_a;
+typedef ttrait< JTIE_JNI_SHORT_ARRAY_T *, unsigned short * > ttrait_ushort_0p_a;
+#endif
+#ifdef JTIE_JNI_INT_ARRAY_T
+typedef ttrait< JTIE_JNI_INT_ARRAY_T *, signed int * > ttrait_int_0p_a;
+typedef ttrait< JTIE_JNI_INT_ARRAY_T *, unsigned int * > ttrait_uint_0p_a;
+#endif
+#ifdef JTIE_JNI_LONG_ARRAY_T
+typedef ttrait< JTIE_JNI_LONG_ARRAY_T *, signed long * > ttrait_long_0p_a;
+typedef ttrait< JTIE_JNI_LONG_ARRAY_T *, unsigned long * > ttrait_ulong_0p_a;
+#endif
+#ifdef JTIE_JNI_LONGLONG_ARRAY_T
+typedef ttrait< JTIE_JNI_LONGLONG_ARRAY_T *, signed long long * > ttrait_longlong_0p_a;
+typedef ttrait< JTIE_JNI_LONGLONG_ARRAY_T *, unsigned long long * > ttrait_ulonglong_0p_a;
+#endif
+#ifdef JTIE_JNI_LONGDOUBLE_ARRAY_T
+typedef ttrait< JTIE_JNI_LONGDOUBLE_ARRAY_T *, long double * > ttrait_longdouble_0p_a;
+#endif
+
+// aliases for: <const-primitive-ctype>_<pointer>_<Array<size=0>>
+
+#ifdef JTIE_JNI_SHORT_ARRAY_T
+typedef ttrait< JTIE_JNI_SHORT_ARRAY_T *, const signed short * > ttrait_short_0cp_a;
+typedef ttrait< JTIE_JNI_SHORT_ARRAY_T *, const unsigned short * > ttrait_ushort_0cp_a;
+#endif
+#ifdef JTIE_JNI_INT_ARRAY_T
+typedef ttrait< JTIE_JNI_INT_ARRAY_T *, const signed int * > ttrait_int_0cp_a;
+typedef ttrait< JTIE_JNI_INT_ARRAY_T *, const unsigned int * > ttrait_uint_0cp_a;
+#endif
+#ifdef JTIE_JNI_LONG_ARRAY_T
+typedef ttrait< JTIE_JNI_LONG_ARRAY_T *, const signed long * > ttrait_long_0cp_a;
+typedef ttrait< JTIE_JNI_LONG_ARRAY_T *, const unsigned long * > ttrait_ulong_0cp_a;
+#endif
+#ifdef JTIE_JNI_LONGLONG_ARRAY_T
+typedef ttrait< JTIE_JNI_LONGLONG_ARRAY_T *, const signed long long * > ttrait_longlong_0cp_a;
+typedef ttrait< JTIE_JNI_LONGLONG_ARRAY_T *, const unsigned long long * > ttrait_ulonglong_0cp_a;
+#endif
+#ifdef JTIE_JNI_LONGDOUBLE_ARRAY_T
+typedef ttrait< JTIE_JNI_LONGDOUBLE_ARRAY_T *, const long double * > ttrait_longdouble_0cp_a;
+#endif
+
+// aliases for: <primitive-ctype>_<pointer>_<Array<size=0>>
+
+#ifdef JTIE_JNI_SHORT_ARRAY_T
+typedef ttrait< JTIE_JNI_SHORT_ARRAY_T *, signed short * const > ttrait_short_0pc_a;
+typedef ttrait< JTIE_JNI_SHORT_ARRAY_T *, unsigned short * const > ttrait_ushort_0pc_a;
+#endif
+#ifdef JTIE_JNI_INT_ARRAY_T
+typedef ttrait< JTIE_JNI_INT_ARRAY_T *, signed int * const > ttrait_int_0pc_a;
+typedef ttrait< JTIE_JNI_INT_ARRAY_T *, unsigned int * const > ttrait_uint_0pc_a;
+#endif
+#ifdef JTIE_JNI_LONG_ARRAY_T
+typedef ttrait< JTIE_JNI_LONG_ARRAY_T *, signed long * const > ttrait_long_0pc_a;
+typedef ttrait< JTIE_JNI_LONG_ARRAY_T *, unsigned long * const > ttrait_ulong_0pc_a;
+#endif
+#ifdef JTIE_JNI_LONGLONG_ARRAY_T
+typedef ttrait< JTIE_JNI_LONGLONG_ARRAY_T *, signed long long * const > ttrait_longlong_0pc_a;
+typedef ttrait< JTIE_JNI_LONGLONG_ARRAY_T *, unsigned long long * const > ttrait_ulonglong_0pc_a;
+#endif
+#ifdef JTIE_JNI_LONGDOUBLE_ARRAY_T
+typedef ttrait< JTIE_JNI_LONGDOUBLE_ARRAY_T *, long double * const > ttrait_longdouble_0pc_a;
+#endif
+
+// aliases for: <const-primitive-ctype>_<pointer>_<Array<size=0>>
+
+#ifdef JTIE_JNI_SHORT_ARRAY_T
+typedef ttrait< JTIE_JNI_SHORT_ARRAY_T *, const signed short * const > ttrait_short_0cpc_a;
+typedef ttrait< JTIE_JNI_SHORT_ARRAY_T *, const unsigned short * const > ttrait_ushort_0cpc_a;
+#endif
+#ifdef JTIE_JNI_INT_ARRAY_T
+typedef ttrait< JTIE_JNI_INT_ARRAY_T *, const signed int * const > ttrait_int_0cpc_a;
+typedef ttrait< JTIE_JNI_INT_ARRAY_T *, const unsigned int * const > ttrait_uint_0cpc_a;
+#endif
+#ifdef JTIE_JNI_LONG_ARRAY_T
+typedef ttrait< JTIE_JNI_LONG_ARRAY_T *, const signed long * const > ttrait_long_0cpc_a;
+typedef ttrait< JTIE_JNI_LONG_ARRAY_T *, const unsigned long * const > ttrait_ulong_0cpc_a;
+#endif
+#ifdef JTIE_JNI_LONGLONG_ARRAY_T
+typedef ttrait< JTIE_JNI_LONGLONG_ARRAY_T *, const signed long long * const > ttrait_longlong_0cpc_a;
+typedef ttrait< JTIE_JNI_LONGLONG_ARRAY_T *, const unsigned long long * const > ttrait_ulonglong_0cpc_a;
+#endif
+#ifdef JTIE_JNI_LONGDOUBLE_ARRAY_T
+typedef ttrait< JTIE_JNI_LONGDOUBLE_ARRAY_T *, const long double * const > ttrait_longdouble_0cpc_a;
+#endif
+
+// aliases for: <primitive-ctype>_<pointer>_<Array<size=1>>
+
+#ifdef JTIE_JNI_SHORT_ARRAY_T
+typedef ttrait< JTIE_JNI_SHORT_ARRAY_T *, signed short *, _jtie_j_ArrayMapper< _jtie_j_BoundedArray< JTIE_JNI_SHORT_ARRAY_T, 1 > > * > ttrait_short_1p_a;
+typedef ttrait< JTIE_JNI_SHORT_ARRAY_T *, unsigned short *, _jtie_j_ArrayMapper< _jtie_j_BoundedArray< JTIE_JNI_SHORT_ARRAY_T, 1 > > * > ttrait_ushort_1p_a;
+#endif
+#ifdef JTIE_JNI_INT_ARRAY_T
+typedef ttrait< JTIE_JNI_INT_ARRAY_T *, signed int *, _jtie_j_ArrayMapper< _jtie_j_BoundedArray< JTIE_JNI_INT_ARRAY_T, 1 > > * > ttrait_int_1p_a;
+typedef ttrait< JTIE_JNI_INT_ARRAY_T *, unsigned int *, _jtie_j_ArrayMapper< _jtie_j_BoundedArray< JTIE_JNI_INT_ARRAY_T, 1 > > * > ttrait_uint_1p_a;
+#endif
+#ifdef JTIE_JNI_LONG_ARRAY_T
+typedef ttrait< JTIE_JNI_LONG_ARRAY_T *, signed long *, _jtie_j_ArrayMapper< _jtie_j_BoundedArray< JTIE_JNI_LONG_ARRAY_T, 1 > > * > ttrait_long_1p_a;
+typedef ttrait< JTIE_JNI_LONG_ARRAY_T *, unsigned long *, _jtie_j_ArrayMapper< _jtie_j_BoundedArray< JTIE_JNI_LONG_ARRAY_T, 1 > > * > ttrait_ulong_1p_a;
+#endif
+#ifdef JTIE_JNI_LONGLONG_ARRAY_T
+typedef ttrait< JTIE_JNI_LONGLONG_ARRAY_T *, signed long long *, _jtie_j_ArrayMapper< _jtie_j_BoundedArray< JTIE_JNI_LONGLONG_ARRAY_T, 1 > > * > ttrait_longlong_1p_a;
+typedef ttrait< JTIE_JNI_LONGLONG_ARRAY_T *, unsigned long long *, _jtie_j_ArrayMapper< _jtie_j_BoundedArray< JTIE_JNI_LONGLONG_ARRAY_T, 1 > > * > ttrait_ulonglong_1p_a;
+#endif
+#ifdef JTIE_JNI_LONGDOUBLE_ARRAY_T
+typedef ttrait< JTIE_JNI_LONGDOUBLE_ARRAY_T *, long double *, _jtie_j_ArrayMapper< _jtie_j_BoundedArray< JTIE_JNI_LONGDOUBLE_ARRAY_T, 1 > > * > ttrait_longdouble_1p_a;
+#endif
+
+// aliases for: <const-primitive-ctype>_<pointer>_<Array<size=1>>
+
+#ifdef JTIE_JNI_SHORT_ARRAY_T
+typedef ttrait< JTIE_JNI_SHORT_ARRAY_T *, const signed short *, _jtie_j_ArrayMapper< _jtie_j_BoundedArray< JTIE_JNI_SHORT_ARRAY_T, 1 > > * > ttrait_short_1cp_a;
+typedef ttrait< JTIE_JNI_SHORT_ARRAY_T *, const unsigned short *, _jtie_j_ArrayMapper< _jtie_j_BoundedArray< JTIE_JNI_SHORT_ARRAY_T, 1 > > * > ttrait_ushort_1cp_a;
+#endif
+#ifdef JTIE_JNI_INT_ARRAY_T
+typedef ttrait< JTIE_JNI_INT_ARRAY_T *, const signed int *, _jtie_j_ArrayMapper< _jtie_j_BoundedArray< JTIE_JNI_INT_ARRAY_T, 1 > > * > ttrait_int_1cp_a;
+typedef ttrait< JTIE_JNI_INT_ARRAY_T *, const unsigned int *, _jtie_j_ArrayMapper< _jtie_j_BoundedArray< JTIE_JNI_INT_ARRAY_T, 1 > > * > ttrait_uint_1cp_a;
+#endif
+#ifdef JTIE_JNI_LONG_ARRAY_T
+typedef ttrait< JTIE_JNI_LONG_ARRAY_T *, const signed long *, _jtie_j_ArrayMapper< _jtie_j_BoundedArray< JTIE_JNI_LONG_ARRAY_T, 1 > > * > ttrait_long_1cp_a;
+typedef ttrait< JTIE_JNI_LONG_ARRAY_T *, const unsigned long *, _jtie_j_ArrayMapper< _jtie_j_BoundedArray< JTIE_JNI_LONG_ARRAY_T, 1 > > * > ttrait_ulong_1cp_a;
+#endif
+#ifdef JTIE_JNI_LONGLONG_ARRAY_T
+typedef ttrait< JTIE_JNI_LONGLONG_ARRAY_T *, const signed long long *, _jtie_j_ArrayMapper< _jtie_j_BoundedArray< JTIE_JNI_LONGLONG_ARRAY_T, 1 > > * > ttrait_longlong_1cp_a;
+typedef ttrait< JTIE_JNI_LONGLONG_ARRAY_T *, const unsigned long long *, _jtie_j_ArrayMapper< _jtie_j_BoundedArray< JTIE_JNI_LONGLONG_ARRAY_T, 1 > > * > ttrait_ulonglong_1cp_a;
+#endif
+#ifdef JTIE_JNI_LONGDOUBLE_ARRAY_T
+typedef ttrait< JTIE_JNI_LONGDOUBLE_ARRAY_T *, const long double *, _jtie_j_ArrayMapper< _jtie_j_BoundedArray< JTIE_JNI_LONGDOUBLE_ARRAY_T, 1 > > * > ttrait_longdouble_1cp_a;
+#endif
+
+// aliases for: <primitive-ctype>_<const-pointer>_<Array<size=1>>
+
+#ifdef JTIE_JNI_SHORT_ARRAY_T
+typedef ttrait< JTIE_JNI_SHORT_ARRAY_T *, signed short *, _jtie_j_ArrayMapper< _jtie_j_BoundedArray< JTIE_JNI_SHORT_ARRAY_T, 1 > > * const > ttrait_short_1pc_a;
+typedef ttrait< JTIE_JNI_SHORT_ARRAY_T *, unsigned short *, _jtie_j_ArrayMapper< _jtie_j_BoundedArray< JTIE_JNI_SHORT_ARRAY_T, 1 > > * const > ttrait_ushort_1pc_a;
+#endif
+#ifdef JTIE_JNI_INT_ARRAY_T
+typedef ttrait< JTIE_JNI_INT_ARRAY_T *, signed int *, _jtie_j_ArrayMapper< _jtie_j_BoundedArray< JTIE_JNI_INT_ARRAY_T, 1 > > * const > ttrait_int_1pc_a;
+typedef ttrait< JTIE_JNI_INT_ARRAY_T *, unsigned int *, _jtie_j_ArrayMapper< _jtie_j_BoundedArray< JTIE_JNI_INT_ARRAY_T, 1 > > * const > ttrait_uint_1pc_a;
+#endif
+#ifdef JTIE_JNI_LONG_ARRAY_T
+typedef ttrait< JTIE_JNI_LONG_ARRAY_T *, signed long *, _jtie_j_ArrayMapper< _jtie_j_BoundedArray< JTIE_JNI_LONG_ARRAY_T, 1 > > * const > ttrait_long_1pc_a;
+typedef ttrait< JTIE_JNI_LONG_ARRAY_T *, unsigned long *, _jtie_j_ArrayMapper< _jtie_j_BoundedArray< JTIE_JNI_LONG_ARRAY_T, 1 > > * const > ttrait_ulong_1pc_a;
+#endif
+#ifdef JTIE_JNI_LONGLONG_ARRAY_T
+typedef ttrait< JTIE_JNI_LONGLONG_ARRAY_T *, signed long long *, _jtie_j_ArrayMapper< _jtie_j_BoundedArray< JTIE_JNI_LONGLONG_ARRAY_T, 1 > > * const > ttrait_longlong_1pc_a;
+typedef ttrait< JTIE_JNI_LONGLONG_ARRAY_T *, unsigned long long *, _jtie_j_ArrayMapper< _jtie_j_BoundedArray< JTIE_JNI_LONGLONG_ARRAY_T, 1 > > * const > ttrait_ulonglong_1pc_a;
+#endif
+#ifdef JTIE_JNI_LONGDOUBLE_ARRAY_T
+typedef ttrait< JTIE_JNI_LONGDOUBLE_ARRAY_T *, long double *, _jtie_j_ArrayMapper< _jtie_j_BoundedArray< JTIE_JNI_LONGDOUBLE_ARRAY_T, 1 > > * const > ttrait_longdouble_1pc_a;
+#endif
+// aliases for: <const-primitive-ctype>_<const-pointer>_<Array<size=1>>
+
+#ifdef JTIE_JNI_SHORT_ARRAY_T
+typedef ttrait< JTIE_JNI_SHORT_ARRAY_T *, const signed short *, _jtie_j_ArrayMapper< _jtie_j_BoundedArray< JTIE_JNI_SHORT_ARRAY_T, 1 > > * const > ttrait_short_1cpc_a;
+typedef ttrait< JTIE_JNI_SHORT_ARRAY_T *, const unsigned short *, _jtie_j_ArrayMapper< _jtie_j_BoundedArray< JTIE_JNI_SHORT_ARRAY_T, 1 > > * const > ttrait_ushort_1cpc_a;
+#endif
+#ifdef JTIE_JNI_INT_ARRAY_T
+typedef ttrait< JTIE_JNI_INT_ARRAY_T *, const signed int *, _jtie_j_ArrayMapper< _jtie_j_BoundedArray< JTIE_JNI_INT_ARRAY_T, 1 > > * const > ttrait_int_1cpc_a;
+typedef ttrait< JTIE_JNI_INT_ARRAY_T *, const unsigned int *, _jtie_j_ArrayMapper< _jtie_j_BoundedArray< JTIE_JNI_INT_ARRAY_T, 1 > > * const > ttrait_uint_1cpc_a;
#endif
+#ifdef JTIE_JNI_LONG_ARRAY_T
+typedef ttrait< JTIE_JNI_LONG_ARRAY_T *, const signed long *, _jtie_j_ArrayMapper< _jtie_j_BoundedArray< JTIE_JNI_LONG_ARRAY_T, 1 > > * const > ttrait_long_1cpc_a;
+typedef ttrait< JTIE_JNI_LONG_ARRAY_T *, const unsigned long *, _jtie_j_ArrayMapper< _jtie_j_BoundedArray< JTIE_JNI_LONG_ARRAY_T, 1 > > * const > ttrait_ulong_1cpc_a;
+#endif
+#ifdef JTIE_JNI_LONGLONG_ARRAY_T
+typedef ttrait< JTIE_JNI_LONGLONG_ARRAY_T *, const signed long long *, _jtie_j_ArrayMapper< _jtie_j_BoundedArray< JTIE_JNI_LONGLONG_ARRAY_T, 1 > > * const > ttrait_longlong_1cpc_a;
+typedef ttrait< JTIE_JNI_LONGLONG_ARRAY_T *, const unsigned long long *, _jtie_j_ArrayMapper< _jtie_j_BoundedArray< JTIE_JNI_LONGLONG_ARRAY_T, 1 > > * const > ttrait_ulonglong_1cpc_a;
+#endif
+#ifdef JTIE_JNI_LONGDOUBLE_ARRAY_T
+typedef ttrait< JTIE_JNI_LONGDOUBLE_ARRAY_T *, const long double *, _jtie_j_ArrayMapper< _jtie_j_BoundedArray< JTIE_JNI_LONGDOUBLE_ARRAY_T, 1 > > * const > ttrait_longdouble_1cpc_a;
+#endif
+
+#endif // XXX variable-width type array conversions not supported yet
// ---------------------------------------------------------------------------
=== modified file 'storage/ndb/ndbjtie/jtie/test/myjapi/Makefile.am'
--- a/storage/ndb/ndbjtie/jtie/test/myjapi/Makefile.am 2009-10-31 07:44:53 +0000
+++ b/storage/ndb/ndbjtie/jtie/test/myjapi/Makefile.am 2009-11-07 04:40:48 +0000
@@ -78,7 +78,8 @@ javah: $(MYJAPI_CLASSES)
## ----------------------------------------------------------------------
## automake flags (overridden by per-target flags, added before user flags)
-AM_CPPFLAGS = -I../../../utils -I../../include -I../myapi @JNI_INCLUDE_DIRS@
+AM_CPPFLAGS = -I../../../utils -I../../include -I../myapi @JNI_INCLUDE_DIRS@ \
+ -DJTIE_OBJECT_CLEAR_ADDRESS_UPON_DELETE
## build a shared library for testing
## ideally, this library is not installed suggesting the use of prefixes
=== modified file 'storage/ndb/ndbjtie/jtie/test/myjapi/myjapi_MyJapi.hpp'
--- a/storage/ndb/ndbjtie/jtie/test/myjapi/myjapi_MyJapi.hpp 2009-11-04 17:28:51 +0000
+++ b/storage/ndb/ndbjtie/jtie/test/myjapi/myjapi_MyJapi.hpp 2009-11-07 04:40:48 +0000
@@ -5107,6 +5107,7 @@ Java_myjapi_MyJapi_f651v0(JNIEnv * env,
return gcall< ttrait_bool_0cpc_a, f651 >(env, cls);
}
+
JNIEXPORT jbyteArray JNICALL
Java_myjapi_MyJapi_f652v0(JNIEnv * env, jclass cls)
{
=== modified file 'storage/ndb/ndbjtie/jtie/test/myjapi/myjapi_MyJapiCtypes.hpp'
--- a/storage/ndb/ndbjtie/jtie/test/myjapi/myjapi_MyJapiCtypes.hpp 2009-11-05 05:02:33 +0000
+++ b/storage/ndb/ndbjtie/jtie/test/myjapi/myjapi_MyJapiCtypes.hpp 2009-11-07 04:40:48 +0000
@@ -31,6 +31,7 @@
// libraries
#include "helpers.hpp"
#include "jtie.hpp"
+#include "jtie_tconv_vwidth.hpp"
// The API stub functions in this file have mangled names that adhere
// to the JVM specification. It is not necessary to include the
=== modified file 'storage/ndb/ndbjtie/jtie/test/myjapi/myjapi_lib.cpp'
--- a/storage/ndb/ndbjtie/jtie/test/myjapi/myjapi_lib.cpp 2009-10-27 06:56:52 +0000
+++ b/storage/ndb/ndbjtie/jtie/test/myjapi/myjapi_lib.cpp 2009-11-07 04:40:48 +0000
@@ -27,8 +27,8 @@
#include "jtie_lib.hpp"
// global myjapi library definitions
-#include "myjapi_MyJapi.hpp"
#include "myjapi_MyJapiCtypes.hpp"
+#include "myjapi_MyJapi.hpp"
#include "myjapi_A.hpp"
#include "myjapi_B.hpp"
#include "myjapi_CI.hpp"
=== modified file 'storage/ndb/ndbjtie/src/mysql_jtie.hpp'
--- a/storage/ndb/ndbjtie/src/mysql_jtie.hpp 2009-11-04 17:28:51 +0000
+++ b/storage/ndb/ndbjtie/src/mysql_jtie.hpp 2009-11-07 04:40:48 +0000
@@ -28,6 +28,7 @@
// libraries
#include "helpers.hpp"
#include "jtie.hpp"
+#include "jtie_tconv_vwidth.hpp"
// ---------------------------------------------------------------------------
// MySQL Client JTie Type Definitions
=== modified file 'storage/ndb/ndbjtie/src/ndbapi_jtie.hpp'
--- a/storage/ndb/ndbjtie/src/ndbapi_jtie.hpp 2009-11-04 17:28:51 +0000
+++ b/storage/ndb/ndbjtie/src/ndbapi_jtie.hpp 2009-11-07 04:40:48 +0000
@@ -29,6 +29,8 @@
// libraries
#include "helpers.hpp"
#include "jtie.hpp"
+#include "jtie_tconv_vwidth.hpp"
+#include "ndbjtie_defs.hpp"
// ---------------------------------------------------------------------------
// NDBAPI JTie Type Definitions
@@ -393,7 +395,7 @@ JNIEXPORT jint JNICALL
Java_com_mysql_ndbjtie_ndbapi_Ndb_pollEvents(JNIEnv * env, jobject obj, jint p0, jlongArray p1)
{
TRACE("jint Java_com_mysql_ndbjtie_ndbapi_Ndb_pollEvents(JNIEnv *, jobject, jint, jlongArray)");
- return gcall< ttrait_c_m_n_n_Ndb_t, ttrait_int, ttrait_int, ttrait_uint64_0p_a, &Ndb::pollEvents >(env, obj, p0, p1);
+ return gcall< ttrait_c_m_n_n_Ndb_t, ttrait_int, ttrait_int, ttrait_Uint64_0p_a, &Ndb::pollEvents >(env, obj, p0, p1);
}
/*
@@ -417,7 +419,7 @@ JNIEXPORT jboolean JNICALL
Java_com_mysql_ndbjtie_ndbapi_Ndb_isConsistent(JNIEnv * env, jobject obj, jlongArray p0)
{
TRACE("jboolean Java_com_mysql_ndbjtie_ndbapi_Ndb_isConsistent(JNIEnv *, jobject, jlongArray)");
- return gcall< ttrait_c_m_n_n_Ndb_t, ttrait_bool, ttrait_uint64_r_a, &Ndb::isConsistent >(env, obj, p0);
+ return gcall< ttrait_c_m_n_n_Ndb_t, ttrait_bool, ttrait_Uint64_r_a, &Ndb::isConsistent >(env, obj, p0);
}
/*
@@ -429,7 +431,7 @@ JNIEXPORT jboolean JNICALL
Java_com_mysql_ndbjtie_ndbapi_Ndb_isConsistentGCI(JNIEnv * env, jobject obj, jlong p0)
{
TRACE("jboolean Java_com_mysql_ndbjtie_ndbapi_Ndb_isConsistentGCI(JNIEnv *, jobject, jlong)");
- return gcall< ttrait_c_m_n_n_Ndb_t, ttrait_bool, ttrait_uint64, &Ndb::isConsistentGCI >(env, obj, p0);
+ return gcall< ttrait_c_m_n_n_Ndb_t, ttrait_bool, ttrait_Uint64, &Ndb::isConsistentGCI >(env, obj, p0);
}
/*
@@ -633,7 +635,7 @@ JNIEXPORT jint JNICALL
Java_com_mysql_ndbjtie_ndbapi_NdbBlob_getLength(JNIEnv * env, jobject obj, jlongArray p0)
{
TRACE("jint Java_com_mysql_ndbjtie_ndbapi_NdbBlob_getLength(JNIEnv *, jobject, jlongArray)");
- return gcall< ttrait_c_m_n_n_NdbBlob_t, ttrait_int, ttrait_uint64_r_a, &NdbBlob::getLength >(env, obj, p0);
+ return gcall< ttrait_c_m_n_n_NdbBlob_t, ttrait_int, ttrait_Uint64_r_a, &NdbBlob::getLength >(env, obj, p0);
}
/*
@@ -645,7 +647,7 @@ JNIEXPORT jint JNICALL
Java_com_mysql_ndbjtie_ndbapi_NdbBlob_truncate(JNIEnv * env, jobject obj, jlong p0)
{
TRACE("jint Java_com_mysql_ndbjtie_ndbapi_NdbBlob_truncate(JNIEnv *, jobject, jlong)");
- return gcall< ttrait_c_m_n_n_NdbBlob_t, ttrait_int, ttrait_uint64, &NdbBlob::truncate >(env, obj, p0);
+ return gcall< ttrait_c_m_n_n_NdbBlob_t, ttrait_int, ttrait_Uint64, &NdbBlob::truncate >(env, obj, p0);
}
/*
@@ -657,7 +659,7 @@ JNIEXPORT jint JNICALL
Java_com_mysql_ndbjtie_ndbapi_NdbBlob_getPos(JNIEnv * env, jobject obj, jlongArray p0)
{
TRACE("jint Java_com_mysql_ndbjtie_ndbapi_NdbBlob_getPos(JNIEnv *, jobject, jlongArray)");
- return gcall< ttrait_c_m_n_n_NdbBlob_t, ttrait_int, ttrait_uint64_r_a, &NdbBlob::getPos >(env, obj, p0);
+ return gcall< ttrait_c_m_n_n_NdbBlob_t, ttrait_int, ttrait_Uint64_r_a, &NdbBlob::getPos >(env, obj, p0);
}
/*
@@ -669,7 +671,7 @@ JNIEXPORT jint JNICALL
Java_com_mysql_ndbjtie_ndbapi_NdbBlob_setPos(JNIEnv * env, jobject obj, jlong p0)
{
TRACE("jint Java_com_mysql_ndbjtie_ndbapi_NdbBlob_setPos(JNIEnv *, jobject, jlong)");
- return gcall< ttrait_c_m_n_n_NdbBlob_t, ttrait_int, ttrait_uint64, &NdbBlob::setPos >(env, obj, p0);
+ return gcall< ttrait_c_m_n_n_NdbBlob_t, ttrait_int, ttrait_Uint64, &NdbBlob::setPos >(env, obj, p0);
}
/*
@@ -941,7 +943,7 @@ JNIEXPORT jlong JNICALL
Java_com_mysql_ndbjtie_ndbapi_NdbDictionary_00024AutoGrowSpecification_max_1size__(JNIEnv * env, jobject obj)
{
TRACE("jlong Java_com_mysql_ndbjtie_ndbapi_NdbDictionary_00024AutoGrowSpecification_max_1size__(JNIEnv *, jobject)");
- return gget< ttrait_c_m_n_n_NdbDictionary$AutoGrowSpecification_t, ttrait_uint64, &NdbDictionary::AutoGrowSpecification::max_size >(env, obj);
+ return gget< ttrait_c_m_n_n_NdbDictionary$AutoGrowSpecification_t, ttrait_Uint64, &NdbDictionary::AutoGrowSpecification::max_size >(env, obj);
}
/*
@@ -953,7 +955,7 @@ JNIEXPORT jlong JNICALL
Java_com_mysql_ndbjtie_ndbapi_NdbDictionary_00024AutoGrowSpecification_file_1size__(JNIEnv * env, jobject obj)
{
TRACE("jlong Java_com_mysql_ndbjtie_ndbapi_NdbDictionary_00024AutoGrowSpecification_file_1size__(JNIEnv *, jobject)");
- return gget< ttrait_c_m_n_n_NdbDictionary$AutoGrowSpecification_t, ttrait_uint64, &NdbDictionary::AutoGrowSpecification::file_size >(env, obj);
+ return gget< ttrait_c_m_n_n_NdbDictionary$AutoGrowSpecification_t, ttrait_Uint64, &NdbDictionary::AutoGrowSpecification::file_size >(env, obj);
}
/*
@@ -989,7 +991,7 @@ JNIEXPORT void JNICALL
Java_com_mysql_ndbjtie_ndbapi_NdbDictionary_00024AutoGrowSpecification_max_1size__J(JNIEnv * env, jobject obj, jlong p0)
{
TRACE("void Java_com_mysql_ndbjtie_ndbapi_NdbDictionary_00024AutoGrowSpecification_max_1size__J(JNIEnv *, jobject, jlong)");
- gset< ttrait_c_m_n_n_NdbDictionary$AutoGrowSpecification_t, ttrait_uint64, &NdbDictionary::AutoGrowSpecification::max_size >(env, obj, p0);
+ gset< ttrait_c_m_n_n_NdbDictionary$AutoGrowSpecification_t, ttrait_Uint64, &NdbDictionary::AutoGrowSpecification::max_size >(env, obj, p0);
}
/*
@@ -1001,7 +1003,7 @@ JNIEXPORT void JNICALL
Java_com_mysql_ndbjtie_ndbapi_NdbDictionary_00024AutoGrowSpecification_file_1size__J(JNIEnv * env, jobject obj, jlong p0)
{
TRACE("void Java_com_mysql_ndbjtie_ndbapi_NdbDictionary_00024AutoGrowSpecification_file_1size__J(JNIEnv *, jobject, jlong)");
- gset< ttrait_c_m_n_n_NdbDictionary$AutoGrowSpecification_t, ttrait_uint64, &NdbDictionary::AutoGrowSpecification::file_size >(env, obj, p0);
+ gset< ttrait_c_m_n_n_NdbDictionary$AutoGrowSpecification_t, ttrait_Uint64, &NdbDictionary::AutoGrowSpecification::file_size >(env, obj, p0);
}
/*
@@ -1489,7 +1491,7 @@ JNIEXPORT jlong JNICALL
Java_com_mysql_ndbjtie_ndbapi_NdbDictionary_00024Datafile_getSize(JNIEnv * env, jobject obj)
{
TRACE("jlong Java_com_mysql_ndbjtie_ndbapi_NdbDictionary_00024Datafile_getSize(JNIEnv *, jobject)");
- return gcall< ttrait_c_m_n_n_NdbDictionary$Datafile_ct, ttrait_uint64, &NdbDictionary::Datafile::getSize >(env, obj);
+ return gcall< ttrait_c_m_n_n_NdbDictionary$Datafile_ct, ttrait_Uint64, &NdbDictionary::Datafile::getSize >(env, obj);
}
/*
@@ -1501,7 +1503,7 @@ JNIEXPORT jlong JNICALL
Java_com_mysql_ndbjtie_ndbapi_NdbDictionary_00024Datafile_getFree(JNIEnv * env, jobject obj)
{
TRACE("jlong Java_com_mysql_ndbjtie_ndbapi_NdbDictionary_00024Datafile_getFree(JNIEnv *, jobject)");
- return gcall< ttrait_c_m_n_n_NdbDictionary$Datafile_ct, ttrait_uint64, &NdbDictionary::Datafile::getFree >(env, obj);
+ return gcall< ttrait_c_m_n_n_NdbDictionary$Datafile_ct, ttrait_Uint64, &NdbDictionary::Datafile::getFree >(env, obj);
}
/*
@@ -1621,7 +1623,7 @@ JNIEXPORT void JNICALL
Java_com_mysql_ndbjtie_ndbapi_NdbDictionary_00024Datafile_setSize(JNIEnv * env, jobject obj, jlong p0)
{
TRACE("void Java_com_mysql_ndbjtie_ndbapi_NdbDictionary_00024Datafile_setSize(JNIEnv *, jobject, jlong)");
- gcall< ttrait_c_m_n_n_NdbDictionary$Datafile_t, ttrait_uint64, &NdbDictionary::Datafile::setSize >(env, obj, p0);
+ gcall< ttrait_c_m_n_n_NdbDictionary$Datafile_t, ttrait_Uint64, &NdbDictionary::Datafile::setSize >(env, obj, p0);
}
/*
@@ -2903,7 +2905,7 @@ JNIEXPORT jlong JNICALL
Java_com_mysql_ndbjtie_ndbapi_NdbDictionary_00024LogfileGroup_getUndoFreeWords(JNIEnv * env, jobject obj)
{
TRACE("jlong Java_com_mysql_ndbjtie_ndbapi_NdbDictionary_00024LogfileGroup_getUndoFreeWords(JNIEnv *, jobject)");
- return gcall< ttrait_c_m_n_n_NdbDictionary$LogfileGroup_ct, ttrait_uint64, &NdbDictionary::LogfileGroup::getUndoFreeWords >(env, obj);
+ return gcall< ttrait_c_m_n_n_NdbDictionary$LogfileGroup_ct, ttrait_Uint64, &NdbDictionary::LogfileGroup::getUndoFreeWords >(env, obj);
}
/*
@@ -3719,7 +3721,7 @@ JNIEXPORT jlong JNICALL
Java_com_mysql_ndbjtie_ndbapi_NdbDictionary_00024Table_getMaxRows(JNIEnv * env, jobject obj)
{
TRACE("jlong Java_com_mysql_ndbjtie_ndbapi_NdbDictionary_00024Table_getMaxRows(JNIEnv *, jobject)");
- return gcall< ttrait_c_m_n_n_NdbDictionary$Table_ct, ttrait_uint64, &NdbDictionary::Table::getMaxRows >(env, obj);
+ return gcall< ttrait_c_m_n_n_NdbDictionary$Table_ct, ttrait_Uint64, &NdbDictionary::Table::getMaxRows >(env, obj);
}
/*
@@ -3731,7 +3733,7 @@ JNIEXPORT jlong JNICALL
Java_com_mysql_ndbjtie_ndbapi_NdbDictionary_00024Table_getMinRows(JNIEnv * env, jobject obj)
{
TRACE("jlong Java_com_mysql_ndbjtie_ndbapi_NdbDictionary_00024Table_getMinRows(JNIEnv *, jobject)");
- return gcall< ttrait_c_m_n_n_NdbDictionary$Table_ct, ttrait_uint64, &NdbDictionary::Table::getMinRows >(env, obj);
+ return gcall< ttrait_c_m_n_n_NdbDictionary$Table_ct, ttrait_Uint64, &NdbDictionary::Table::getMinRows >(env, obj);
}
/*
@@ -4067,7 +4069,7 @@ JNIEXPORT void JNICALL
Java_com_mysql_ndbjtie_ndbapi_NdbDictionary_00024Table_setMaxRows(JNIEnv * env, jobject obj, jlong p0)
{
TRACE("void Java_com_mysql_ndbjtie_ndbapi_NdbDictionary_00024Table_setMaxRows(JNIEnv *, jobject, jlong)");
- gcall< ttrait_c_m_n_n_NdbDictionary$Table_t, ttrait_uint64, &NdbDictionary::Table::setMaxRows >(env, obj, p0);
+ gcall< ttrait_c_m_n_n_NdbDictionary$Table_t, ttrait_Uint64, &NdbDictionary::Table::setMaxRows >(env, obj, p0);
}
/*
@@ -4079,7 +4081,7 @@ JNIEXPORT void JNICALL
Java_com_mysql_ndbjtie_ndbapi_NdbDictionary_00024Table_setMinRows(JNIEnv * env, jobject obj, jlong p0)
{
TRACE("void Java_com_mysql_ndbjtie_ndbapi_NdbDictionary_00024Table_setMinRows(JNIEnv *, jobject, jlong)");
- gcall< ttrait_c_m_n_n_NdbDictionary$Table_t, ttrait_uint64, &NdbDictionary::Table::setMinRows >(env, obj, p0);
+ gcall< ttrait_c_m_n_n_NdbDictionary$Table_t, ttrait_Uint64, &NdbDictionary::Table::setMinRows >(env, obj, p0);
}
/*
@@ -4363,7 +4365,7 @@ JNIEXPORT jlong JNICALL
Java_com_mysql_ndbjtie_ndbapi_NdbDictionary_00024Undofile_getSize(JNIEnv * env, jobject obj)
{
TRACE("jlong Java_com_mysql_ndbjtie_ndbapi_NdbDictionary_00024Undofile_getSize(JNIEnv *, jobject)");
- return gcall< ttrait_c_m_n_n_NdbDictionary$Undofile_ct, ttrait_uint64, &NdbDictionary::Undofile::getSize >(env, obj);
+ return gcall< ttrait_c_m_n_n_NdbDictionary$Undofile_ct, ttrait_Uint64, &NdbDictionary::Undofile::getSize >(env, obj);
}
/*
@@ -4483,7 +4485,7 @@ JNIEXPORT void JNICALL
Java_com_mysql_ndbjtie_ndbapi_NdbDictionary_00024Undofile_setSize(JNIEnv * env, jobject obj, jlong p0)
{
TRACE("void Java_com_mysql_ndbjtie_ndbapi_NdbDictionary_00024Undofile_setSize(JNIEnv *, jobject, jlong)");
- gcall< ttrait_c_m_n_n_NdbDictionary$Undofile_t, ttrait_uint64, &NdbDictionary::Undofile::setSize >(env, obj, p0);
+ gcall< ttrait_c_m_n_n_NdbDictionary$Undofile_t, ttrait_Uint64, &NdbDictionary::Undofile::setSize >(env, obj, p0);
}
/*
@@ -4731,7 +4733,7 @@ JNIEXPORT jlong JNICALL
Java_com_mysql_ndbjtie_ndbapi_NdbEventOperation_getGCI(JNIEnv * env, jobject obj)
{
TRACE("jlong Java_com_mysql_ndbjtie_ndbapi_NdbEventOperation_getGCI(JNIEnv *, jobject)");
- return gcall< ttrait_c_m_n_n_NdbEventOperation_ct, ttrait_uint64, &NdbEventOperation::getGCI >(env, obj);
+ return gcall< ttrait_c_m_n_n_NdbEventOperation_ct, ttrait_Uint64, &NdbEventOperation::getGCI >(env, obj);
}
/*
@@ -4755,7 +4757,7 @@ JNIEXPORT jlong JNICALL
Java_com_mysql_ndbjtie_ndbapi_NdbEventOperation_getLatestGCI(JNIEnv * env, jobject obj)
{
TRACE("jlong Java_com_mysql_ndbjtie_ndbapi_NdbEventOperation_getLatestGCI(JNIEnv *, jobject)");
- return gcall< ttrait_c_m_n_n_NdbEventOperation_ct, ttrait_uint64, &NdbEventOperation::getLatestGCI >(env, obj);
+ return gcall< ttrait_c_m_n_n_NdbEventOperation_ct, ttrait_Uint64, &NdbEventOperation::getLatestGCI >(env, obj);
}
/*
@@ -5323,7 +5325,7 @@ JNIEXPORT jint JNICALL
Java_com_mysql_ndbjtie_ndbapi_NdbInterpretedCode_load_1const_1u64(JNIEnv * env, jobject obj, jint p0, jlong p1)
{
TRACE("jint Java_com_mysql_ndbjtie_ndbapi_NdbInterpretedCode_load_1const_1u64(JNIEnv *, jobject, jint, jlong)");
- return gcall< ttrait_c_m_n_n_NdbInterpretedCode_t, ttrait_int, ttrait_uint32, ttrait_uint64, &NdbInterpretedCode::load_const_u64 >(env, obj, p0, p1);
+ return gcall< ttrait_c_m_n_n_NdbInterpretedCode_t, ttrait_int, ttrait_uint32, ttrait_Uint64, &NdbInterpretedCode::load_const_u64 >(env, obj, p0, p1);
}
/*
@@ -5707,7 +5709,7 @@ JNIEXPORT jint JNICALL
Java_com_mysql_ndbjtie_ndbapi_NdbInterpretedCode_add_1val__IJ(JNIEnv * env, jobject obj, jint p0, jlong p1)
{
TRACE("jint Java_com_mysql_ndbjtie_ndbapi_NdbInterpretedCode_add_1val__IJ(JNIEnv *, jobject, jint, jlong)");
- return gcall< ttrait_c_m_n_n_NdbInterpretedCode_t, ttrait_int, ttrait_uint32, ttrait_uint64, &NdbInterpretedCode::add_val >(env, obj, p0, p1);
+ return gcall< ttrait_c_m_n_n_NdbInterpretedCode_t, ttrait_int, ttrait_uint32, ttrait_Uint64, &NdbInterpretedCode::add_val >(env, obj, p0, p1);
}
/*
@@ -5731,7 +5733,7 @@ JNIEXPORT jint JNICALL
Java_com_mysql_ndbjtie_ndbapi_NdbInterpretedCode_sub_1val__IJ(JNIEnv * env, jobject obj, jint p0, jlong p1)
{
TRACE("jint Java_com_mysql_ndbjtie_ndbapi_NdbInterpretedCode_sub_1val__IJ(JNIEnv *, jobject, jint, jlong)");
- return gcall< ttrait_c_m_n_n_NdbInterpretedCode_t, ttrait_int, ttrait_uint32, ttrait_uint64, &NdbInterpretedCode::sub_val >(env, obj, p0, p1);
+ return gcall< ttrait_c_m_n_n_NdbInterpretedCode_t, ttrait_int, ttrait_uint32, ttrait_Uint64, &NdbInterpretedCode::sub_val >(env, obj, p0, p1);
}
/*
@@ -6000,7 +6002,7 @@ JNIEXPORT jint JNICALL
Java_com_mysql_ndbjtie_ndbapi_NdbOperation_equal__Ljava_lang_String_2J(JNIEnv * env, jobject obj, jstring p0, jlong p1)
{
TRACE("jint Java_com_mysql_ndbjtie_ndbapi_NdbOperation_equal__Ljava_lang_String_2J(JNIEnv *, jobject, jstring, jlong)");
- return gcall< ttrait_c_m_n_n_NdbOperation_t, ttrait_int, ttrait_utf8cstring, ttrait_int64, &NdbOperation::equal >(env, obj, p0, p1);
+ return gcall< ttrait_c_m_n_n_NdbOperation_t, ttrait_int, ttrait_utf8cstring, ttrait_Int64, &NdbOperation::equal >(env, obj, p0, p1);
}
/*
@@ -6036,7 +6038,7 @@ JNIEXPORT jint JNICALL
Java_com_mysql_ndbjtie_ndbapi_NdbOperation_equal__IJ(JNIEnv * env, jobject obj, jint p0, jlong p1)
{
TRACE("jint Java_com_mysql_ndbjtie_ndbapi_NdbOperation_equal__IJ(JNIEnv *, jobject, jint, jlong)");
- return gcall< ttrait_c_m_n_n_NdbOperation_t, ttrait_int, ttrait_uint32, ttrait_int64, &NdbOperation::equal >(env, obj, p0, p1);
+ return gcall< ttrait_c_m_n_n_NdbOperation_t, ttrait_int, ttrait_uint32, ttrait_Int64, &NdbOperation::equal >(env, obj, p0, p1);
}
/*
@@ -6108,7 +6110,7 @@ JNIEXPORT jint JNICALL
Java_com_mysql_ndbjtie_ndbapi_NdbOperation_setValue__Ljava_lang_String_2J(JNIEnv * env, jobject obj, jstring p0, jlong p1)
{
TRACE("jint Java_com_mysql_ndbjtie_ndbapi_NdbOperation_setValue__Ljava_lang_String_2J(JNIEnv *, jobject, jstring, jlong)");
- return gcall< ttrait_c_m_n_n_NdbOperation_t, ttrait_int, ttrait_utf8cstring, ttrait_int64, &NdbOperation::setValue >(env, obj, p0, p1);
+ return gcall< ttrait_c_m_n_n_NdbOperation_t, ttrait_int, ttrait_utf8cstring, ttrait_Int64, &NdbOperation::setValue >(env, obj, p0, p1);
}
/*
@@ -6168,7 +6170,7 @@ JNIEXPORT jint JNICALL
Java_com_mysql_ndbjtie_ndbapi_NdbOperation_setValue__IJ(JNIEnv * env, jobject obj, jint p0, jlong p1)
{
TRACE("jint Java_com_mysql_ndbjtie_ndbapi_NdbOperation_setValue__IJ(JNIEnv *, jobject, jint, jlong)");
- return gcall< ttrait_c_m_n_n_NdbOperation_t, ttrait_int, ttrait_uint32, ttrait_int64, &NdbOperation::setValue >(env, obj, p0, p1);
+ return gcall< ttrait_c_m_n_n_NdbOperation_t, ttrait_int, ttrait_uint32, ttrait_Int64, &NdbOperation::setValue >(env, obj, p0, p1);
}
/*
@@ -6320,7 +6322,7 @@ JNIEXPORT jlong JNICALL
Java_com_mysql_ndbjtie_ndbapi_NdbOperation_00024OperationOptions_optionsPresent__(JNIEnv * env, jobject obj)
{
TRACE("jlong Java_com_mysql_ndbjtie_ndbapi_NdbOperation_00024OperationOptions_optionsPresent__(JNIEnv *, jobject)");
- return gget< ttrait_c_m_n_n_NdbOperation$OperationOptions_t, ttrait_uint64, &NdbOperation::OperationOptions::optionsPresent >(env, obj);
+ return gget< ttrait_c_m_n_n_NdbOperation$OperationOptions_t, ttrait_Uint64, &NdbOperation::OperationOptions::optionsPresent >(env, obj);
}
/*
@@ -6404,7 +6406,7 @@ JNIEXPORT void JNICALL
Java_com_mysql_ndbjtie_ndbapi_NdbOperation_00024OperationOptions_optionsPresent__J(JNIEnv * env, jobject obj, jlong p0)
{
TRACE("void Java_com_mysql_ndbjtie_ndbapi_NdbOperation_00024OperationOptions_optionsPresent__J(JNIEnv *, jobject, jlong)");
- gset< ttrait_c_m_n_n_NdbOperation$OperationOptions_t, ttrait_uint64, &NdbOperation::OperationOptions::optionsPresent >(env, obj, p0);
+ gset< ttrait_c_m_n_n_NdbOperation$OperationOptions_t, ttrait_Uint64, &NdbOperation::OperationOptions::optionsPresent >(env, obj, p0);
}
/*
@@ -6609,14 +6611,14 @@ Java_com_mysql_ndbjtie_ndbapi_NdbRecAttr
/*
* Class: com_mysql_ndbjtie_ndbapi_NdbRecAttr
- * Method: int64_value
+ * Method: Int64_value
* Signature: ()J
*/
JNIEXPORT jlong JNICALL
-Java_com_mysql_ndbjtie_ndbapi_NdbRecAttr_int64_1value(JNIEnv * env, jobject obj)
+Java_com_mysql_ndbjtie_ndbapi_NdbRecAttr_Int64_1value(JNIEnv * env, jobject obj)
{
- TRACE("jlong Java_com_mysql_ndbjtie_ndbapi_NdbRecAttr_int64_1value(JNIEnv *, jobject)");
- return gcall< ttrait_c_m_n_n_NdbRecAttr_ct, ttrait_int64, &NdbRecAttr::int64_value >(env, obj);
+ TRACE("jlong Java_com_mysql_ndbjtie_ndbapi_NdbRecAttr_Int64_1value(JNIEnv *, jobject)");
+ return gcall< ttrait_c_m_n_n_NdbRecAttr_ct, ttrait_Int64, &NdbRecAttr::int64_value >(env, obj);
}
/*
@@ -6688,7 +6690,7 @@ JNIEXPORT jlong JNICALL
Java_com_mysql_ndbjtie_ndbapi_NdbRecAttr_u_164_1value(JNIEnv * env, jobject obj)
{
TRACE("jlong Java_com_mysql_ndbjtie_ndbapi_NdbRecAttr_u_164_1value(JNIEnv *, jobject)");
- return gcall< ttrait_c_m_n_n_NdbRecAttr_ct, ttrait_uint64, &NdbRecAttr::u_64_value >(env, obj);
+ return gcall< ttrait_c_m_n_n_NdbRecAttr_ct, ttrait_Uint64, &NdbRecAttr::u_64_value >(env, obj);
}
/*
@@ -7004,7 +7006,7 @@ JNIEXPORT jint JNICALL
Java_com_mysql_ndbjtie_ndbapi_NdbScanFilter_eq__IJ(JNIEnv * env, jobject obj, jint p0, jlong p1)
{
TRACE("jint Java_com_mysql_ndbjtie_ndbapi_NdbScanFilter_eq__IJ(JNIEnv *, jobject, jint, jlong)");
- return gcall< ttrait_c_m_n_n_NdbScanFilter_t, ttrait_int, ttrait_int, ttrait_uint64, &NdbScanFilter::eq >(env, obj, p0, p1);
+ return gcall< ttrait_c_m_n_n_NdbScanFilter_t, ttrait_int, ttrait_int, ttrait_Uint64, &NdbScanFilter::eq >(env, obj, p0, p1);
}
/*
@@ -7016,7 +7018,7 @@ JNIEXPORT jint JNICALL
Java_com_mysql_ndbjtie_ndbapi_NdbScanFilter_ne__IJ(JNIEnv * env, jobject obj, jint p0, jlong p1)
{
TRACE("jint Java_com_mysql_ndbjtie_ndbapi_NdbScanFilter_ne__IJ(JNIEnv *, jobject, jint, jlong)");
- return gcall< ttrait_c_m_n_n_NdbScanFilter_t, ttrait_int, ttrait_int, ttrait_uint64, &NdbScanFilter::ne >(env, obj, p0, p1);
+ return gcall< ttrait_c_m_n_n_NdbScanFilter_t, ttrait_int, ttrait_int, ttrait_Uint64, &NdbScanFilter::ne >(env, obj, p0, p1);
}
/*
@@ -7028,7 +7030,7 @@ JNIEXPORT jint JNICALL
Java_com_mysql_ndbjtie_ndbapi_NdbScanFilter_lt__IJ(JNIEnv * env, jobject obj, jint p0, jlong p1)
{
TRACE("jint Java_com_mysql_ndbjtie_ndbapi_NdbScanFilter_lt__IJ(JNIEnv *, jobject, jint, jlong)");
- return gcall< ttrait_c_m_n_n_NdbScanFilter_t, ttrait_int, ttrait_int, ttrait_uint64, &NdbScanFilter::lt >(env, obj, p0, p1);
+ return gcall< ttrait_c_m_n_n_NdbScanFilter_t, ttrait_int, ttrait_int, ttrait_Uint64, &NdbScanFilter::lt >(env, obj, p0, p1);
}
/*
@@ -7040,7 +7042,7 @@ JNIEXPORT jint JNICALL
Java_com_mysql_ndbjtie_ndbapi_NdbScanFilter_le__IJ(JNIEnv * env, jobject obj, jint p0, jlong p1)
{
TRACE("jint Java_com_mysql_ndbjtie_ndbapi_NdbScanFilter_le__IJ(JNIEnv *, jobject, jint, jlong)");
- return gcall< ttrait_c_m_n_n_NdbScanFilter_t, ttrait_int, ttrait_int, ttrait_uint64, &NdbScanFilter::le >(env, obj, p0, p1);
+ return gcall< ttrait_c_m_n_n_NdbScanFilter_t, ttrait_int, ttrait_int, ttrait_Uint64, &NdbScanFilter::le >(env, obj, p0, p1);
}
/*
@@ -7052,7 +7054,7 @@ JNIEXPORT jint JNICALL
Java_com_mysql_ndbjtie_ndbapi_NdbScanFilter_gt__IJ(JNIEnv * env, jobject obj, jint p0, jlong p1)
{
TRACE("jint Java_com_mysql_ndbjtie_ndbapi_NdbScanFilter_gt__IJ(JNIEnv *, jobject, jint, jlong)");
- return gcall< ttrait_c_m_n_n_NdbScanFilter_t, ttrait_int, ttrait_int, ttrait_uint64, &NdbScanFilter::gt >(env, obj, p0, p1);
+ return gcall< ttrait_c_m_n_n_NdbScanFilter_t, ttrait_int, ttrait_int, ttrait_Uint64, &NdbScanFilter::gt >(env, obj, p0, p1);
}
/*
@@ -7064,7 +7066,7 @@ JNIEXPORT jint JNICALL
Java_com_mysql_ndbjtie_ndbapi_NdbScanFilter_ge__IJ(JNIEnv * env, jobject obj, jint p0, jlong p1)
{
TRACE("jint Java_com_mysql_ndbjtie_ndbapi_NdbScanFilter_ge__IJ(JNIEnv *, jobject, jint, jlong)");
- return gcall< ttrait_c_m_n_n_NdbScanFilter_t, ttrait_int, ttrait_int, ttrait_uint64, &NdbScanFilter::ge >(env, obj, p0, p1);
+ return gcall< ttrait_c_m_n_n_NdbScanFilter_t, ttrait_int, ttrait_int, ttrait_Uint64, &NdbScanFilter::ge >(env, obj, p0, p1);
}
/*
@@ -7270,7 +7272,7 @@ JNIEXPORT jlong JNICALL
Java_com_mysql_ndbjtie_ndbapi_NdbScanOperation_00024ScanOptions_optionsPresent__(JNIEnv * env, jobject obj)
{
TRACE("jlong Java_com_mysql_ndbjtie_ndbapi_NdbScanOperation_00024ScanOptions_optionsPresent__(JNIEnv *, jobject)");
- return gget< ttrait_c_m_n_n_NdbScanOperation$ScanOptions_t, ttrait_uint64, &NdbScanOperation::ScanOptions::optionsPresent >(env, obj);
+ return gget< ttrait_c_m_n_n_NdbScanOperation$ScanOptions_t, ttrait_Uint64, &NdbScanOperation::ScanOptions::optionsPresent >(env, obj);
}
/*
@@ -7354,7 +7356,7 @@ JNIEXPORT void JNICALL
Java_com_mysql_ndbjtie_ndbapi_NdbScanOperation_00024ScanOptions_optionsPresent__J(JNIEnv * env, jobject obj, jlong p0)
{
TRACE("void Java_com_mysql_ndbjtie_ndbapi_NdbScanOperation_00024ScanOptions_optionsPresent__J(JNIEnv *, jobject, jlong)");
- gset< ttrait_c_m_n_n_NdbScanOperation$ScanOptions_t, ttrait_uint64, &NdbScanOperation::ScanOptions::optionsPresent >(env, obj, p0);
+ gset< ttrait_c_m_n_n_NdbScanOperation$ScanOptions_t, ttrait_Uint64, &NdbScanOperation::ScanOptions::optionsPresent >(env, obj, p0);
}
/*
@@ -7587,7 +7589,7 @@ JNIEXPORT jint JNICALL
Java_com_mysql_ndbjtie_ndbapi_NdbTransaction_getGCI___3J(JNIEnv * env, jobject obj, jlongArray p0)
{
TRACE("jint Java_com_mysql_ndbjtie_ndbapi_NdbTransaction_getGCI___3J(JNIEnv *, jobject, jlongArray)");
- return gcall< ttrait_c_m_n_n_NdbTransaction_t, ttrait_int, ttrait_int64_0p_a, &NdbTransaction::getGCI >(env, obj, p0);
+ return gcall< ttrait_c_m_n_n_NdbTransaction_t, ttrait_int, ttrait_Int64_0p_a, &NdbTransaction::getGCI >(env, obj, p0);
}
#endif // MMM! array support, error: no matching function for call to 'gcall(JNIEnv*&, _jobject*&, _jlongArray*&)'
@@ -7612,7 +7614,7 @@ JNIEXPORT jlong JNICALL
Java_com_mysql_ndbjtie_ndbapi_NdbTransaction_getTransactionId(JNIEnv * env, jobject obj)
{
TRACE("jlong Java_com_mysql_ndbjtie_ndbapi_NdbTransaction_getTransactionId(JNIEnv *, jobject)");
- return gcall< ttrait_c_m_n_n_NdbTransaction_t, ttrait_uint64, &NdbTransaction::getTransactionId >(env, obj);
+ return gcall< ttrait_c_m_n_n_NdbTransaction_t, ttrait_Uint64, &NdbTransaction::getTransactionId >(env, obj);
}
/*
=== added file 'storage/ndb/ndbjtie/src/ndbjtie_defs.hpp'
--- a/storage/ndb/ndbjtie/src/ndbjtie_defs.hpp 1970-01-01 00:00:00 +0000
+++ b/storage/ndb/ndbjtie/src/ndbjtie_defs.hpp 2009-11-06 08:34:00 +0000
@@ -0,0 +1,102 @@
+/*
+ Copyright (C) 2009 Sun Microsystems, Inc.
+ All rights reserved. Use is subject to license terms.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+*/
+/*
+ * ndbjtie_defs.hpp
+ */
+
+#ifndef ndbjtie_defs_hpp
+#define ndbjtie_defs_hpp
+
+// API to implement against
+#include "ndb_types.h"
+
+// libraries
+#include "helpers.hpp"
+#include "jtie.hpp"
+
+// ---------------------------------------------------------------------------
+// NDB JTie Type Definitions
+// ---------------------------------------------------------------------------
+
+//
+// Definitions for Int64/Uint64 mappings
+//
+
+// aliases for: <primitive-ctype>
+typedef ttrait< jlong, Int64 > ttrait_Int64;
+typedef ttrait< jlong, Uint64 > ttrait_Uint64;
+
+// aliases for: <const-primitive-ctype>
+typedef ttrait< jlong, const Int64 > ttrait_Int64_c;
+typedef ttrait< jlong, const Uint64 > ttrait_Uint64_c;
+
+//
+// Definitions for pointer to Int64/Uint64 mappings
+//
+
+// aliases for: <primitive-ctype>_<pointer>_<Array<size=0>>
+typedef ttrait< jlongArray, Int64 * > ttrait_Int64_0p_a;
+typedef ttrait< jlongArray, Uint64 * > ttrait_Uint64_0p_a;
+
+// aliases for: <const-primitive-ctype>_<pointer>_<Array<size=0>>
+typedef ttrait< jlongArray, const Int64 * > ttrait_Int64_0cp_a;
+typedef ttrait< jlongArray, const Uint64 * > ttrait_Uint64_0cp_a;
+
+// aliases for: <primitive-ctype>_<pointer>_<Array<size=0>>
+typedef ttrait< jlongArray, Int64 * const > ttrait_Int64_0pc_a;
+typedef ttrait< jlongArray, Uint64 * const > ttrait_Uint64_0pc_a;
+
+// aliases for: <const-primitive-ctype>_<pointer>_<Array<size=0>>
+typedef ttrait< jlongArray, const Int64 * const > ttrait_Int64_0cpc_a;
+typedef ttrait< jlongArray, const Uint64 * const > ttrait_Uint64_0cpc_a;
+
+// aliases for: <primitive-ctype>_<pointer>_<Array<size=1>>
+typedef ttrait< jlongArray, Int64 *, _jtie_j_ArrayMapper< _jtie_j_BoundedArray< _jlongArray, 1 > > * > ttrait_Int64_1p_a;
+typedef ttrait< jlongArray, Uint64 *, _jtie_j_ArrayMapper< _jtie_j_BoundedArray< _jlongArray, 1 > > * > ttrait_Uint64_1p_a;
+
+// aliases for: <const-primitive-ctype>_<pointer>_<Array<size=1>>
+typedef ttrait< jlongArray, const Int64 *, _jtie_j_ArrayMapper< _jtie_j_BoundedArray< _jlongArray, 1 > > * > ttrait_Int64_1cp_a;
+typedef ttrait< jlongArray, const Uint64 *, _jtie_j_ArrayMapper< _jtie_j_BoundedArray< _jlongArray, 1 > > * > ttrait_Uint64_1cp_a;
+
+// aliases for: <primitive-ctype>_<const-pointer>_<Array<size=1>>
+typedef ttrait< jlongArray, Int64 * const, _jtie_j_ArrayMapper< _jtie_j_BoundedArray<_jlongArray, 1 > > * > ttrait_Int64_1pc_a;
+typedef ttrait< jlongArray, Uint64 * const, _jtie_j_ArrayMapper< _jtie_j_BoundedArray<_jlongArray, 1 > > * > ttrait_Uint64_1pc_a;
+
+// aliases for: <const-primitive-ctype>_<const-pointer>_<Array<size=1>>
+typedef ttrait< jlongArray, const Int64 * const, _jtie_j_ArrayMapper< _jtie_j_BoundedArray<_jlongArray, 1 > > * > ttrait_Int64_1cpc_a;
+typedef ttrait< jlongArray, const Uint64 * const, _jtie_j_ArrayMapper< _jtie_j_BoundedArray<_jlongArray, 1 > > * > ttrait_Uint64_1cpc_a;
+
+//
+// Definitions for reference to Int64/Uint64 mappings
+//
+
+// aliases for: <primitive-ctype>_<reference>_<value>
+typedef ttrait< jlong, Int64 & > ttrait_Int64_r_v;
+typedef ttrait< jlong, Uint64 & > ttrait_Uint64_r_v;
+
+// aliases for: <primitive-ctype>_<const-reference>_<value>
+typedef ttrait< jlong, const Int64 & > ttrait_Int64_cr_v;
+typedef ttrait< jlong, const Uint64 & > ttrait_Uint64_cr_v;
+
+// aliases for: <primitive-ctype>_<reference>_<array<size=1>>
+typedef ttrait< jlongArray, Int64 & > ttrait_Int64_r_a;
+typedef ttrait< jlongArray, Uint64 & > ttrait_Uint64_r_a;
+
+// ---------------------------------------------------------------------------
+
+#endif // ndbjtie_defs_hpp
Attachment: [text/bzr-bundle] bzr/martin.zaun@sun.com-20091107062850-j6vhl4lo0mukx8vj.bundle
| Thread |
|---|
| • bzr push into mysql-5.1-telco-6.3-ndbjtie branch (martin.zaun:3100 to3101) | Martin Zaun | 7 Nov |