Direct-BT  2.3.1
Direct-BT - Direct Bluetooth Programming.
Public Types | Public Member Functions | List of all members
JNICriticalArray< T, U > Class Template Reference

#include <jni_mem.hpp>

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

Detailed Description

template<typename T, typename U>
class JNICriticalArray< T, U >

Definition at line 126 of file jni_mem.hpp.

Member Enumeration Documentation

◆ Mode

template<typename T , typename U >
enum 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 128 of file jni_mem.hpp.

Constructor & Destructor Documentation

◆ JNICriticalArray() [1/3]

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

Definition at line 147 of file jni_mem.hpp.

◆ JNICriticalArray() [2/3]

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

◆ JNICriticalArray() [3/3]

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

◆ ~JNICriticalArray()

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

Release the acquired primitive array, RAII style.

Definition at line 157 of file jni_mem.hpp.

Here is the call graph for this function:

Member Function Documentation

◆ get()

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

Acquired the primitive array.

Definition at line 177 of file jni_mem.hpp.

Here is the caller graph for this function:

◆ getIsCopy()

template<typename T , typename U >
bool 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 195 of file jni_mem.hpp.

◆ operator=() [1/2]

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

◆ operator=() [2/2]

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

◆ release()

template<typename T , typename U >
void 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 165 of file jni_mem.hpp.

Here is the caller graph for this function:

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