dxFeed Graal CXX API v8.1.0
Loading...
Searching...
No Matches
JavaObjectHandleState Class Referencefinal

Type-erased ownership state shared by Java object and Java object-list handle wrappers. More...

#include <JavaObjectHandle.hpp>

Public Member Functions

 JavaObjectHandleState (void *handle, Deleter deleter) noexcept
 Creates an ownership state for a native handle.
 
 ~JavaObjectHandleState () noexcept
 Releases the owned handle, if any, and unregisters the state.
 
void moveFrom (JavaObjectHandleState &other) noexcept
 Transfers ownership from another state and releases the handle previously owned by this state.
 
void reset (void *handle=nullptr) noexcept
 Replaces the owned handle, releasing the previous one.
 
void * get () const noexcept
 Returns the currently owned native handle.
 

Friends

class JavaObjectHandleRegistry
 

Detailed Description

Type-erased ownership state shared by Java object and Java object-list handle wrappers.

A non-null state registers itself for isolate shutdown and unregisters itself when reset or destroyed.

Constructor & Destructor Documentation

◆ JavaObjectHandleState()

JavaObjectHandleState::JavaObjectHandleState ( void * handle,
Deleter deleter )
noexcept

Creates an ownership state for a native handle.

Parameters
handleThe native handle, or nullptr for an empty state.
deleterThe function used to release a non-null handle.

References JavaObjectHandleState().

Referenced by JavaObjectHandleState().

Member Function Documentation

◆ get()

void * JavaObjectHandleState::get ( ) const
inlinenodiscardnoexcept

Returns the currently owned native handle.

Returns
The native handle, or nullptr when the state is empty.

◆ moveFrom()

void JavaObjectHandleState::moveFrom ( JavaObjectHandleState & other)
noexcept

Transfers ownership from another state and releases the handle previously owned by this state.

Parameters
otherThe state from which ownership is transferred.

◆ reset()

void JavaObjectHandleState::reset ( void * handle = nullptr)
noexcept

Replaces the owned handle, releasing the previous one.

Parameters
handleThe new native handle, or nullptr to make the state empty.

Referenced by ~JavaObjectHandleState().