MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ObjectArrayConvImpl< J, C > Struct Template Reference

#include <jtie_tconv_array_impl.hpp>

Static Public Member Functions

static C * getArrayElements (JNIEnv *env, jobjectArray j, jboolean *isCopy)
static void releaseArrayElements (JNIEnv *env, jobjectArray j, const C *c, jint mode)
static jobjectArray newArray (JNIEnv *env, jsize len, const C *c)

Detailed Description

template<typename J, typename C>
struct ObjectArrayConvImpl< J, C >

Implements ArrayConv for Java Object array types.

Please, note that on balance this type of object array mapping, while having a few merits, has turned out inferior to other array mappings: It

  • comes with an unavoidable performance overhead (value-copy semantics)
  • displays different argument conversion semantics (pass-by-value for Java-to-C while pass-by-reference for C-to-Java) and
  • hence, complicates the usage and caller's object management (making it more error-prone to memory leaks or integrity errors), as well as
  • hampers the maintenance of this class due to fine points in the code.

The reason for the difficulties of this mapping stems from an asymmetry: The natural 1-1 mapping of Java 'MyClass[]' is C 'MyClass**' while C 'MyClass*', strictly speaking, has no Java Object array pendant, for lack of notion of (contigous arrays of) embedded Java Objects.

While assumed to work, this mapping has not been used and tested yet; we're keeping it, for it still meets best Java programmers' expectations for C object arrays to be mapped to Java Object[].

Definition at line 281 of file jtie_tconv_array_impl.hpp.


The documentation for this struct was generated from the following file: