jaulib v1.3.6
Jau Support Library (C++, Java, ..)
Loading...
Searching...
No Matches
jau::jni::JNICriticalArray< T, U > Class Template Reference

#include <jni_mem.hpp>

Collaboration diagram for jau::jni::JNICriticalArray< T, U >:

Public Types

enum  Mode : jint { UPDATE_AND_RELEASE = 0 , UPDATE_NO_RELEASE = JNI_COMMIT , NO_UPDATE_AND_RELEASE = JNI_ABORT }
 

Public Member Functions

 JNICriticalArray (const JNICriticalArray &o)=delete
 
 JNICriticalArray (JNICriticalArray &&o)=delete
 
 JNICriticalArray (JNIEnv *env_val)
 
 ~JNICriticalArray ()
 Release the acquired primitive array, RAII style.
 
T * get (U jarray_val, Mode mode_val=UPDATE_AND_RELEASE)
 Acquired the primitive array.
 
bool getIsCopy () const
 Returns true if the primitive array had been acquired and the JVM utilizes a copy of the underlying java array.
 
JNICriticalArrayoperator= (const JNICriticalArray &o)=delete
 
JNICriticalArrayoperator= (JNICriticalArray &&o)=delete
 
void release ()
 Manual release of the acquired primitive array, usually one likes to simply do this via the destructor, RAII style.
 

Detailed Description

template<typename T, typename U>
class jau::jni::JNICriticalArray< T, U >

Definition at line 141 of file jni_mem.hpp.

Member Enumeration Documentation

◆ Mode

template<typename T, typename U>
enum jau::jni::JNICriticalArray::Mode : jint
Enumerator
UPDATE_AND_RELEASE 

Like default 0: If 'isCopy': Update the java array data with the copy and free the copy.

UPDATE_NO_RELEASE 

Like JNI_COMMIT: If 'isCopy': Update the java array data with the copy, but do not free the copy.

NO_UPDATE_AND_RELEASE 

Like default JNI_ABORT: If 'isCopy': Do not update the java array data with the copy, but free the copy.

Definition at line 143 of file jni_mem.hpp.

Constructor & Destructor Documentation

◆ JNICriticalArray() [1/3]

template<typename T, typename U>
jau::jni::JNICriticalArray< T, U >::JNICriticalArray ( JNIEnv * env_val)
inline

Definition at line 162 of file jni_mem.hpp.

Here is the caller graph for this function:

◆ JNICriticalArray() [2/3]

template<typename T, typename U>
jau::jni::JNICriticalArray< T, U >::JNICriticalArray ( const JNICriticalArray< T, U > & o)
delete

◆ JNICriticalArray() [3/3]

template<typename T, typename U>
jau::jni::JNICriticalArray< T, U >::JNICriticalArray ( JNICriticalArray< T, U > && o)
delete

◆ ~JNICriticalArray()

template<typename T, typename U>
jau::jni::JNICriticalArray< T, U >::~JNICriticalArray ( )
inline

Release the acquired primitive array, RAII style.

Definition at line 172 of file jni_mem.hpp.

Member Function Documentation

◆ operator=() [1/2]

template<typename T, typename U>
JNICriticalArray & jau::jni::JNICriticalArray< T, U >::operator= ( const JNICriticalArray< T, U > & o)
delete

◆ operator=() [2/2]

template<typename T, typename U>
JNICriticalArray & jau::jni::JNICriticalArray< T, U >::operator= ( JNICriticalArray< T, U > && o)
delete

◆ release()

template<typename T, typename U>
void jau::jni::JNICriticalArray< T, U >::release ( )
inline

Manual release of the acquired primitive array, usually one likes to simply do this via the destructor, RAII style.

Definition at line 180 of file jni_mem.hpp.

Here is the caller graph for this function:

◆ get()

template<typename T, typename U>
T * jau::jni::JNICriticalArray< T, U >::get ( U jarray_val,
Mode mode_val = UPDATE_AND_RELEASE )
inline

Acquired the primitive array.

Definition at line 192 of file jni_mem.hpp.

◆ getIsCopy()

template<typename T, typename U>
bool jau::jni::JNICriticalArray< T, U >::getIsCopy ( ) const
inline

Returns true if the primitive array had been acquired and the JVM utilizes a copy of the underlying java array.

Definition at line 210 of file jni_mem.hpp.


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