dxFeed Graal Native SDK 3.12.0
Loading...
Searching...
No Matches
graal_isolate_dynamic.h File Reference

The functions of graal_isolate.h as pointer types (graal_create_isolate_fn_t, etc.), for a program that loads the library of the SDK at run time (dlopen and dlsym, LoadLibrary and GetProcAddress) instead of linking it. More...

Go to the source code of this file.

Data Structures

struct  __graal_create_isolate_params_t
 The parameters of graal_create_isolate(). More...

Macros

#define NO_PROTECTION_DOMAIN   0
 The values of graal_create_isolate_params_t.pkey (protection domains, internal: leave it 0).
#define NEW_PROTECTION_DOMAIN   -1
 See NO_PROTECTION_DOMAIN.

Typedefs

typedef int(*) graal_create_isolate_fn_t(graal_create_isolate_params_t *params, graal_isolate_t **isolate, graal_isolatethread_t **thread)
 The type of graal_isolate.h's graal_create_isolate() (dlsym(library, "graal_create_isolate")).
typedef int(*) graal_attach_thread_fn_t(graal_isolate_t *isolate, graal_isolatethread_t **thread)
 The type of graal_isolate.h's graal_attach_thread() (dlsym(library, "graal_attach_thread")).
typedef graal_isolatethread_t *(*) graal_get_current_thread_fn_t(graal_isolate_t *isolate)
 The type of graal_isolate.h's graal_get_current_thread() (dlsym(library, "graal_get_current_thread")).
typedef graal_isolate_t *(*) graal_get_isolate_fn_t(graal_isolatethread_t *thread)
 The type of graal_isolate.h's graal_get_isolate() (dlsym(library, "graal_get_isolate")).
typedef int(*) graal_detach_thread_fn_t(graal_isolatethread_t *thread)
 The type of graal_isolate.h's graal_detach_thread() (dlsym(library, "graal_detach_thread")).
typedef int(*) graal_tear_down_isolate_fn_t(graal_isolatethread_t *thread)
 The type of graal_isolate.h's graal_tear_down_isolate() (dlsym(library, "graal_tear_down_isolate")).
typedef int(*) graal_detach_all_threads_and_tear_down_isolate_fn_t(graal_isolatethread_t *thread)
 The type of graal_isolate.h's graal_detach_all_threads_and_tear_down_isolate() (dlsym(library, "graal_detach_all_threads_and_tear_down_isolate")).

Enumerations

enum  { __graal_create_isolate_params_version = 5 }
 The version of graal_create_isolate_params_t that this header declares (its version field). More...

Detailed Description

The functions of graal_isolate.h as pointer types (graal_create_isolate_fn_t, etc.), for a program that loads the library of the SDK at run time (dlopen and dlsym, LoadLibrary and GetProcAddress) instead of linking it.

native-image generates this header for the library of the SDK; the build of the SDK fails if the declarations here differ from the ones that its GraalVM generates (see graal_isolate.h). It has the same include guard as graal_isolate.h and the same types, so only the one included first counts: include this one first to get the pointer types (dxfg_api.h, which includes graal_isolate.h, can still be included after it; its functions are declared for linking, a program that loads them at run time declares their pointer types itself). See graal_isolate.h for the functions and the isolate arguments.

#include <dlfcn.h>
void *library = dlopen("libDxFeedGraalNativeSdk.so", RTLD_NOW); // .dylib on macOS
graal_create_isolate_fn_t create_isolate = (graal_create_isolate_fn_t) dlsym(library, "graal_create_isolate");
graal_tear_down_isolate_fn_t tear_down_isolate =
(graal_tear_down_isolate_fn_t) dlsym(library, "graal_tear_down_isolate");
graal_isolate_t *isolate = NULL;
graal_isolatethread_t *thread = NULL;
if (create_isolate(NULL, &isolate, &thread) == 0) {
// ... the SDK functions, loaded the same way ...
tear_down_isolate(thread);
}
struct __graal_isolate_t graal_isolate_t
An isolate: the instance of the SDK (its heap and Java state) in the process.
Definition graal_isolate.h:51
struct __graal_isolatethread_t graal_isolatethread_t
The state of one thread attached to an isolate: the first parameter (thread) of the SDK functions.
Definition graal_isolate.h:60
The functions of graal_isolate.h as pointer types (graal_create_isolate_fn_t, etc....
int(*) graal_tear_down_isolate_fn_t(graal_isolatethread_t *thread)
The type of graal_isolate.h's graal_tear_down_isolate() (dlsym(library, "graal_tear_down_isolate")).
Definition graal_isolate_dynamic.h:162
int(*) graal_create_isolate_fn_t(graal_create_isolate_params_t *params, graal_isolate_t **isolate, graal_isolatethread_t **thread)
The type of graal_isolate.h's graal_create_isolate() (dlsym(library, "graal_create_isolate")).
Definition graal_isolate_dynamic.h:146

On Windows: LoadLibraryA("DxFeedGraalNativeSdk.dll") and GetProcAddress.

Macro Definition Documentation

◆ NEW_PROTECTION_DOMAIN

#define NEW_PROTECTION_DOMAIN   -1

◆ NO_PROTECTION_DOMAIN

#define NO_PROTECTION_DOMAIN   0

The values of graal_create_isolate_params_t.pkey (protection domains, internal: leave it 0).

Typedef Documentation

◆ graal_attach_thread_fn_t

typedef int(*) graal_attach_thread_fn_t(graal_isolate_t *isolate, graal_isolatethread_t **thread)

The type of graal_isolate.h's graal_attach_thread() (dlsym(library, "graal_attach_thread")).

◆ graal_create_isolate_fn_t

typedef int(*) graal_create_isolate_fn_t(graal_create_isolate_params_t *params, graal_isolate_t **isolate, graal_isolatethread_t **thread)

The type of graal_isolate.h's graal_create_isolate() (dlsym(library, "graal_create_isolate")).

◆ graal_detach_all_threads_and_tear_down_isolate_fn_t

typedef int(*) graal_detach_all_threads_and_tear_down_isolate_fn_t(graal_isolatethread_t *thread)

◆ graal_detach_thread_fn_t

typedef int(*) graal_detach_thread_fn_t(graal_isolatethread_t *thread)

The type of graal_isolate.h's graal_detach_thread() (dlsym(library, "graal_detach_thread")).

◆ graal_get_current_thread_fn_t

typedef graal_isolatethread_t *(*) graal_get_current_thread_fn_t(graal_isolate_t *isolate)

◆ graal_get_isolate_fn_t

typedef graal_isolate_t *(*) graal_get_isolate_fn_t(graal_isolatethread_t *thread)

The type of graal_isolate.h's graal_get_isolate() (dlsym(library, "graal_get_isolate")).

◆ graal_tear_down_isolate_fn_t

typedef int(*) graal_tear_down_isolate_fn_t(graal_isolatethread_t *thread)

Enumeration Type Documentation

◆ anonymous enum

anonymous enum

The version of graal_create_isolate_params_t that this header declares (its version field).

Enumerator
__graal_create_isolate_params_version