shared
 All Classes Functions Variables Typedefs Enumerations Enumerator Friends
Public Types | Public Member Functions | List of all members
ArrayPinHandler Class Reference

A subclass of CleanupHandler for pinning and releasing arrays. More...

#include <Common.hpp>

Inherits CleanupHandler< void * >.

Public Types

enum  jarray_type {
  DOUBLE, INT, BYTE, PRIMITIVE,
  STRING_UTF, STRING, STRING_PRIMITIVE, OBJECT
}
 An enumeration of Java array types. More...
 
enum  release_mode { READ_WRITE = 0, READ_ONLY = JNI_ABORT }
 An enumeration of array release modes. More...
 

Public Member Functions

 ArrayPinHandler (JNIEnv *env, const jarray array, jarray_type type, release_mode mode)
 Default constructor. More...
 
virtual void * get ()
 Gets the resource.
 

Detailed Description

A subclass of CleanupHandler for pinning and releasing arrays.

Member Enumeration Documentation

An enumeration of Java array types.

Enumerator
DOUBLE 

Indicates an array of doubles.

INT 

Indicates an array of ints.

BYTE 

Indicates an array of bytes.

PRIMITIVE 

Indicates a critical array.

STRING_UTF 

Indicates a string with UTF encoding.

STRING 

Indicates a string with Unicode encoding.

STRING_PRIMITIVE 

Indicates a critical string.

OBJECT 

Indicates an array of Objects.

An enumeration of array release modes.

Enumerator
READ_WRITE 

Indicates a read-write operation.

READ_ONLY 

Indicates a read-only operation.

Constructor & Destructor Documentation

ArrayPinHandler::ArrayPinHandler ( JNIEnv *  env,
const jarray  array,
ArrayPinHandler::jarray_type  type,
ArrayPinHandler::release_mode  mode 
)
explicit

Default constructor.

Parameters
envthe JNI environment.
arraythe array.
typethe array type.
modethe release mode.