Direct-BT v3.3.0-1-gc2d430c
Direct-BT - Direct Bluetooth Programming.
Public Member Functions | Protected Member Functions | List of all members
jau.direct_bt.DBTNativeDownlink Class Referenceabstract

Java counterpart to C++ jau::JavaUplink. More...

Inheritance diagram for jau.direct_bt.DBTNativeDownlink:
Collaboration diagram for jau.direct_bt.DBTNativeDownlink:

Public Member Functions

final void delete ()
 Deletes the nativeInstance in the following order. More...
 

Protected Member Functions

 DBTNativeDownlink ()
 
 DBTNativeDownlink (final long nativeInstance)
 
abstract void deleteImpl (long nativeInstance)
 Deletes the native instance. More...
 
void finalize ()
 
final void initDownlink (final long nativeInstance)
 
final boolean isNativeValid ()
 Returns true if native instance is valid, otherwise false. More...
 

Detailed Description

Java counterpart to C++ jau::JavaUplink.

Store the native std::shared_ptr<T> * long representation and handles the lifecycles of

Using a shared_ptr<T> ensures surviving of the native object when temporary copied within JNI methods w/o locking.

Definition at line 43 of file DBTNativeDownlink.java.

Constructor & Destructor Documentation

◆ DBTNativeDownlink() [1/2]

jau.direct_bt.DBTNativeDownlink.DBTNativeDownlink ( final long  nativeInstance)
protected
Parameters
nativeInstance

Definition at line 54 of file DBTNativeDownlink.java.

◆ DBTNativeDownlink() [2/2]

jau.direct_bt.DBTNativeDownlink.DBTNativeDownlink ( )
protected

Definition at line 60 of file DBTNativeDownlink.java.

Member Function Documentation

◆ initDownlink()

final void jau.direct_bt.DBTNativeDownlink.initDownlink ( final long  nativeInstance)
protected

Definition at line 65 of file DBTNativeDownlink.java.

Here is the caller graph for this function:

◆ isNativeValid()

final boolean jau.direct_bt.DBTNativeDownlink.isNativeValid ( )
protected

Returns true if native instance is valid, otherwise false.

Definition at line 79 of file DBTNativeDownlink.java.

Here is the caller graph for this function:

◆ finalize()

void jau.direct_bt.DBTNativeDownlink.finalize ( )
protected

Reimplemented in jau.direct_bt.DBTObject.

Definition at line 82 of file DBTNativeDownlink.java.

◆ delete()

final void jau.direct_bt.DBTNativeDownlink.delete ( )

Deletes the nativeInstance in the following order.

  1. Removes this java reference from the nativeInstance, i.e. std::shared_ptr<JavaAnon> via JavaUplink::setJavaObject()
  2. Deletes the nativeInstance via deleteImpl(long)
  3. Zeros the nativeInstance reference

Definition at line 95 of file DBTNativeDownlink.java.

Here is the caller graph for this function:

◆ deleteImpl()

abstract void jau.direct_bt.DBTNativeDownlink.deleteImpl ( long  nativeInstance)
abstractprotected

Deletes the native instance.

Called via delete() and at this point

  • this java reference has been removed from the native instance, i.e. JavaUplink's javaObjectRef = nullptr
  • the nativeInstance reference has been zeroed, but passed as argument for this final native deletion task.
Parameters
nativeInstancecopy of nativeInstance reference, which has been already zeroed.

Reimplemented in jau.direct_bt.DBTAdapter, jau.direct_bt.DBTDevice, jau.direct_bt.DBTGattChar, jau.direct_bt.DBTGattDesc, jau.direct_bt.DBTGattService, org.direct_bt.AdapterStatusListener, and org.direct_bt.BTGattCharListener.

Here is the caller graph for this function:

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