dxFeed Graal Native SDK 3.15.0-rc1
Loading...
Searching...
No Matches
dxfg_feed.h
Go to the documentation of this file.
1// Copyright (c) 2025 Devexperts LLC.
2// SPDX-License-Identifier: MPL-2.0
3
8
9#ifndef DXFG_FEED_H
10#define DXFG_FEED_H
11
12#ifdef __cplusplus
13extern "C" {
14# include <cstdint>
15#else
16# include <stdint.h>
17#endif
18
19#include "dxfg_common.h"
20
21#include "dxfg_events.h"
23#include "dxfg_javac.h"
24#include "graal_isolate.h"
25
45
47// Forward declarations: the types are described in dxfg_subscription.h and dxfg_javac.h.
50typedef struct dxfg_executor_t dxfg_executor_t;
52
65
78
79
91
103
104
115
131DXFG_DEPRECATED("use dxfg_v4_DXFeed_getInstance()")
133
150DXFG_DEPRECATED("use dxfg_v4_DXFeed_createSubscription()")
152
169DXFG_DEPRECATED("use dxfg_v4_DXFeed_createSubscriptionWithEventTypes()")
171
192DXFG_DEPRECATED("use dxfg_v4_DXFeed_createTimeSeriesSubscription()")
194
211DXFG_DEPRECATED("use dxfg_v4_DXFeed_createTimeSeriesSubscriptionWithEventTypes()")
213
231DXFG_DEPRECATED("use dxfg_v4_DXFeed_attachSubscription()")
233
250DXFG_DEPRECATED("use dxfg_v4_DXFeed_detachSubscription()")
252
269DXFG_DEPRECATED("use dxfg_v4_DXFeed_detachSubscriptionAndClear()")
271
296DXFG_DEPRECATED("use dxfg_v4_DXFeed_getLastEventIfSubscribed()")
298
326DXFG_DEPRECATED("use dxfg_v4_DXFeed_getIndexedEventsIfSubscribed()")
328
357DXFG_DEPRECATED("use dxfg_v4_DXFeed_getTimeSeriesIfSubscribed()")
359
381DXFG_DEPRECATED("use dxfg_v4_DXFeed_getLastEvent(), it does not write into the given event")
383
399DXFG_DEPRECATED("use dxfg_v4_DXFeed_getLastEvents(), it does not write into the given events")
401
428DXFG_DEPRECATED("use dxfg_v4_DXFeed_getLastEvent()")
430
450DXFG_DEPRECATED("use dxfg_v4_DXFeed_getLastEvents()")
452
479DXFG_DEPRECATED("use dxfg_v4_DXFeed_getLastEventPromise()")
481
503DXFG_DEPRECATED("use dxfg_v4_DXFeed_getLastEventsPromises()")
505
539DXFG_DEPRECATED("use dxfg_v4_DXFeed_getIndexedEventsPromise()")
541
575DXFG_DEPRECATED("use dxfg_v4_DXFeed_getTimeSeriesPromise()")
577
593DXFG_DEPRECATED("use dxfg_v4_DXFeedTimeSeriesSubscription_setFromTime()")
595
614typedef void (*dxfg_promise_handler_function)(graal_isolatethread_t *thread, dxfg_promise_t *promise, void *user_data);
615
628DXFG_DEPRECATED("use dxfg_v4_Promise_isDone()")
630
643DXFG_DEPRECATED("use dxfg_v4_Promise_hasResult()")
645
660DXFG_DEPRECATED("use dxfg_v4_Promise_hasException()")
662
675DXFG_DEPRECATED("use dxfg_v4_Promise_isCancelled()")
677
695DXFG_DEPRECATED("use dxfg_v4_Promise_EventType_getResult()")
697
715DXFG_DEPRECATED("use dxfg_v4_Promise_List_EventType_getResult()")
717
737DXFG_DEPRECATED("use dxfg_v4_Promise_getException()")
739
746#define DXFG_PROMISE_AWAIT_TIMED_OUT ((int32_t)1)
747
765DXFG_DEPRECATED("use dxfg_v4_Promise_await()")
767
786DXFG_DEPRECATED("use dxfg_v4_Promise_awaitWithTimeout()")
787int32_t dxfg_Promise_await2(graal_isolatethread_t *thread, dxfg_promise_t *promise, int32_t timeoutInMilliseconds);
788
808DXFG_DEPRECATED("use dxfg_v4_Promise_awaitWithoutException()")
809int32_t dxfg_Promise_awaitWithoutException(graal_isolatethread_t *thread, dxfg_promise_t *promise, int32_t timeoutInMilliseconds);
810
828DXFG_DEPRECATED("use dxfg_v4_Promise_cancel()")
830
850DXFG_DEPRECATED("use dxfg_v4_Promise_List_EventType_complete()")
852
873DXFG_DEPRECATED("use dxfg_v4_Promise_EventType_complete()")
875
894DXFG_DEPRECATED("use dxfg_v4_Promise_completeExceptionally()")
896
923DXFG_DEPRECATED("use dxfg_v4_Promise_whenDone()")
924int32_t dxfg_Promise_whenDone(graal_isolatethread_t *thread, dxfg_promise_t *promise, dxfg_promise_handler_function promise_handler_function, void *user_data);
925
950DXFG_DEPRECATED("use dxfg_v4_Promise_whenDoneAsync()")
951int32_t dxfg_Promise_whenDoneAsync(graal_isolatethread_t *thread, dxfg_promise_t *promise, dxfg_promise_handler_function promise_handler_function, void *user_data, dxfg_executor_t* executor);
952
970DXFG_DEPRECATED("use dxfg_v4_Promise_completed()")
972
992DXFG_DEPRECATED("use dxfg_v4_Promise_failed()")
994
1012DXFG_DEPRECATED("use dxfg_v4_Promises_allOf()")
1014
1015 // end of Feed
1017
1018#ifdef __cplusplus
1019}
1020#endif
1021
1022#endif // DXFG_FEED_H
dxFeed Graal Native SDK Exceptions functions and types declarations
dxFeed Graal Native SDK Common declarations
dxFeed Graal Native SDK Events functions and types declarations
dxfg_event_clazz_t
The class of an event: tells which structure an event (dxfg_event_type_t) is.
Definition dxfg_events.h:185
dxFeed Graal Native SDK Java functions and types declarations
The functions of GraalVM that create, attach to and tear down an isolate, the instance of the SDK in ...
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
#define DXFG_OUT
Definition dxfg_common.h:37
dxfg_promise_events_t * dxfg_DXFeed_getTimeSeriesPromise(graal_isolatethread_t *thread, dxfg_feed_t *feed, dxfg_event_clazz_t clazz, dxfg_symbol_t *symbol, int64_t fromTime, int64_t toTime)
Requests the time series events for the event class, symbol and time range and returns the promise of...
int32_t dxfg_Promise_isCancelled(graal_isolatethread_t *thread, dxfg_promise_t *promise)
Tells whether the promise was cancelled.
void(*) dxfg_promise_handler_function(graal_isolatethread_t *thread, dxfg_promise_t *promise, void *user_data)
The function that is called when a promise is done.
Definition dxfg_feed.h:614
int32_t dxfg_Promise_await(graal_isolatethread_t *thread, dxfg_promise_t *promise)
Waits for the promise to complete.
dxfg_event_type_t * dxfg_DXFeed_getLastEventIfSubscribed(graal_isolatethread_t *thread, dxfg_feed_t *feed, dxfg_event_clazz_t eventClazz, dxfg_symbol_t *symbol)
Returns the last event for the event class and symbol if there is a subscription for them.
int32_t dxfg_DXFeedTimeSeriesSubscription_setFromTime(graal_isolatethread_t *thread, dxfg_time_series_subscription_t *sub, int64_t fromTime)
Sets the earliest time from which the time series subscription receives the events.
int32_t dxfg_Promise_awaitWithoutException(graal_isolatethread_t *thread, dxfg_promise_t *promise, int32_t timeoutInMilliseconds)
Waits for the promise to complete or the timeout to elapse, and reports the timeout without an except...
dxfg_time_series_subscription_t * dxfg_DXFeed_createTimeSeriesSubscription(graal_isolatethread_t *thread, dxfg_feed_t *feed, dxfg_event_clazz_t eventClazz)
Creates a time series subscription for the events of one class and attaches it to the feed.
dxfg_subscription_t * dxfg_DXFeed_createSubscription2(graal_isolatethread_t *thread, dxfg_feed_t *feed, dxfg_event_clazz_list_t *eventClazzes)
Creates a subscription for the events of several classes and attaches it to the feed.
dxfg_exception_t * dxfg_Promise_getException(graal_isolatethread_t *thread, dxfg_promise_t *promise)
Returns the exception of the promise.
dxfg_promise_t * dxfg_Promise_failed(graal_isolatethread_t *thread, dxfg_promise_t *promise, dxfg_exception_t *exception)
Creates a promise that is already failed, with the given exception.
int32_t dxfg_DXFeed_getLastEvents(graal_isolatethread_t *thread, dxfg_feed_t *feed, dxfg_event_type_list *events)
The bulk version of dxfg_DXFeed_getLastEvent(): fills every event of the list.
dxfg_promise_list * dxfg_DXFeed_getLastEventsPromises(graal_isolatethread_t *thread, dxfg_feed_t *feed, dxfg_event_clazz_t eventClazz, dxfg_symbol_list *symbols)
The bulk version of dxfg_DXFeed_getLastEventPromise(): requests the last events for one event class a...
int32_t dxfg_DXFeed_attachSubscription(graal_isolatethread_t *thread, dxfg_feed_t *feed, dxfg_subscription_t *sub)
Attaches the subscription to the feed.
dxfg_promise_t * dxfg_Promises_allOf(graal_isolatethread_t *thread, dxfg_promise_list *promises)
Creates a promise that is done when all the given promises are done.
int32_t dxfg_DXFeed_detachSubscription(graal_isolatethread_t *thread, dxfg_feed_t *feed, dxfg_subscription_t *sub)
Detaches the subscription from the feed.
dxfg_promise_events_t * dxfg_DXFeed_getIndexedEventsPromise(graal_isolatethread_t *thread, dxfg_feed_t *feed, dxfg_event_clazz_t eventClazz, dxfg_symbol_t *symbol, dxfg_indexed_event_source_t *source)
Requests the indexed events for the event class, symbol and source and returns the promise of the res...
int32_t dxfg_Promise_whenDone(graal_isolatethread_t *thread, dxfg_promise_t *promise, dxfg_promise_handler_function promise_handler_function, void *user_data)
Adds a handler that is called when the promise is done.
int32_t dxfg_Promise_whenDoneAsync(graal_isolatethread_t *thread, dxfg_promise_t *promise, dxfg_promise_handler_function promise_handler_function, void *user_data, dxfg_executor_t *executor)
Adds a handler that is called by the given executor when the promise is done.
dxfg_event_type_list * dxfg_DXFeed_getTimeSeriesIfSubscribed(graal_isolatethread_t *thread, dxfg_feed_t *feed, dxfg_event_clazz_t eventClazz, dxfg_symbol_t *symbol, int64_t from_time, int64_t to_time)
Returns the time series events for the event class, symbol and time range if there is a subscription ...
dxfg_promise_event_t * dxfg_DXFeed_getLastEventPromise(graal_isolatethread_t *thread, dxfg_feed_t *feed, dxfg_event_clazz_t eventClazz, dxfg_symbol_t *symbol)
Requests the last event for the event class and symbol and returns the promise of the result.
dxfg_event_type_list * dxfg_DXFeed_getIndexedEventsIfSubscribed(graal_isolatethread_t *thread, dxfg_feed_t *feed, dxfg_event_clazz_t eventClazz, dxfg_symbol_t *symbol, const char *source)
Returns the indexed events for the event class, symbol and source if there is a subscription for them...
int32_t dxfg_Promise_hasResult(graal_isolatethread_t *thread, dxfg_promise_t *promise)
Tells whether the promise has completed normally, with a result.
int32_t dxfg_Promise_await2(graal_isolatethread_t *thread, dxfg_promise_t *promise, int32_t timeoutInMilliseconds)
Waits for the promise to complete or the timeout to elapse.
int32_t dxfg_DXFeed_getLastEvents2(graal_isolatethread_t *thread, dxfg_feed_t *feed, const dxfg_event_type_list *events, DXFG_OUT dxfg_event_type_list **lastEvents)
The bulk version of dxfg_DXFeed_getLastEvent2(): gets a new list with the last event for every event ...
int32_t dxfg_Promise_isDone(graal_isolatethread_t *thread, dxfg_promise_t *promise)
Tells whether the promise is done: completed with a result, completed exceptionally or cancelled.
int32_t dxfg_Promise_hasException(graal_isolatethread_t *thread, dxfg_promise_t *promise)
Tells whether the promise has completed exceptionally or was cancelled.
dxfg_event_type_list * dxfg_Promise_List_EventType_getResult(graal_isolatethread_t *thread, dxfg_promise_events_t *promise)
Returns the result of a promise of a list of events.
int32_t dxfg_DXFeed_getLastEvent(graal_isolatethread_t *thread, dxfg_feed_t *feed, dxfg_event_type_t *event)
Fills the given event with the last event for its type and symbol.
int32_t dxfg_Promise_cancel(graal_isolatethread_t *thread, dxfg_promise_t *promise)
Cancels the promise.
int32_t dxfg_Promise_List_EventType_complete(graal_isolatethread_t *thread, dxfg_promise_t *promise, dxfg_event_type_list *events)
Completes the promise of a list of events normally, with the given list.
int32_t dxfg_DXFeed_getLastEvent2(graal_isolatethread_t *thread, dxfg_feed_t *feed, const dxfg_event_type_t *event, DXFG_OUT dxfg_event_type_t **lastEvent)
Gets the last event for the type and symbol of the given event.
dxfg_subscription_t * dxfg_DXFeed_createSubscription(graal_isolatethread_t *thread, dxfg_feed_t *feed, dxfg_event_clazz_t eventClazz)
Creates a subscription for the events of one class and attaches it to the feed.
int32_t dxfg_Promise_completeExceptionally(graal_isolatethread_t *thread, dxfg_promise_t *promise, dxfg_exception_t *exception)
Completes the promise exceptionally, with the given exception.
dxfg_event_type_t * dxfg_Promise_EventType_getResult(graal_isolatethread_t *thread, dxfg_promise_event_t *promise)
Returns the result of a promise of an event.
int32_t dxfg_Promise_EventType_complete(graal_isolatethread_t *thread, dxfg_promise_t *promise, dxfg_event_type_t *event)
Completes the promise of an event normally, with the given event.
dxfg_time_series_subscription_t * dxfg_DXFeed_createTimeSeriesSubscription2(graal_isolatethread_t *thread, dxfg_feed_t *feed, dxfg_event_clazz_list_t *eventClazzes)
Creates a time series subscription for the events of several classes and attaches it to the feed.
int32_t dxfg_DXFeed_detachSubscriptionAndClear(graal_isolatethread_t *thread, dxfg_feed_t *feed, dxfg_subscription_t *sub)
Detaches the subscription from the feed and clears the data that was delivered to the subscription.
dxfg_promise_t * dxfg_Promise_completed(graal_isolatethread_t *thread, dxfg_promise_t *promise, dxfg_java_object_handler *handler)
Creates a promise that is already completed normally, with the given Java object as the result.
dxfg_feed_t * dxfg_DXFeed_getInstance(graal_isolatethread_t *thread)
Returns the feed of the default endpoint of the process.
A list of event classes.
Definition dxfg_events.h:1227
A list of events.
Definition dxfg_events.h:1215
The base structure of every event: the first field of all the event structures.
Definition dxfg_events.h:234
An exception that was thrown by the Java side: the class, the message, the stack trace and the cause.
Definition dxfg_catch_exception.h:83
A handle of a Java Executor object; release it with dxfg_JavaObjectHandler_release().
Definition dxfg_javac.h:126
A handle of a Java DXFeed object; release it with dxfg_JavaObjectHandler_release().
Definition dxfg_feed.h:61
dxfg_java_object_handler handler
Definition dxfg_feed.h:63
The source of indexed events.
Definition dxfg_events.h:42
A list of handles of Java objects.
Definition dxfg_javac.h:95
The handle of a Java object: the reference by which the C code refers to an object that lives in Java...
Definition dxfg_javac.h:60
A handle of a Java Promise object whose result is an event; release it with dxfg_JavaObjectHandler_re...
Definition dxfg_feed.h:110
dxfg_promise_t handler
Definition dxfg_feed.h:113
A handle of a Java Promise object whose result is a list of events; release it with dxfg_JavaObjectHa...
Definition dxfg_feed.h:99
dxfg_promise_t base
Definition dxfg_feed.h:101
A list of promise handles.
Definition dxfg_feed.h:87
dxfg_java_object_handler_list list
Definition dxfg_feed.h:89
A handle of a Java Promise object; release it with dxfg_JavaObjectHandler_release().
Definition dxfg_feed.h:74
dxfg_java_object_handler handler
Definition dxfg_feed.h:76
A handle of a Java DXFeedSubscription object; release it with dxfg_JavaObjectHandler_release().
Definition dxfg_subscription.h:68
A list of symbols.
Definition dxfg_events.h:166
The base structure of every symbol: the first field of all the symbol structures.
Definition dxfg_events.h:89
A handle of a Java DXFeedTimeSeriesSubscription object; release it with dxfg_JavaObjectHandler_releas...
Definition dxfg_subscription.h:83