dxFeed Graal Native SDK 3.17.0-rc1
Loading...
Searching...
No Matches
OnDemand (v4)

The v4 functions and type names of the group OnDemand. Every function returns DXFG_EXECUTE_SUCCESSFULLY or DXFG_EXECUTE_FAIL and writes its result to a DXFG_OUT parameter, see The v4 functions. More...

Data Structures

struct  dxfg_v4_on_demand_property_value_t
 The old or the new value of an on-demand service property, passed to dxfg_v4_OnDemandPropertyChangeListener_function. More...
struct  dxfg_v4_on_demand_property_change_listener_t
 The handle of a listener of the property changes of an on-demand service. More...

Typedefs

typedef dxfg_java_object_handler dxfg_v4_java_object_handler
 The handle of a Java object: the reference by which the C code refers to an object that lives in Java.
typedef dxfg_on_demand_service_t dxfg_v4_on_demand_service_t
 A handle of a Java OnDemandService object; release it with dxfg_JavaObjectHandler_release().
typedef enum dxfg_v4_on_demand_property_value_kind_t dxfg_v4_on_demand_property_value_kind_t
 The kind of the value of an on-demand service property (dxfg_v4_on_demand_property_value_t).
typedef struct dxfg_v4_on_demand_property_value_t dxfg_v4_on_demand_property_value_t
 The old or the new value of an on-demand service property, passed to dxfg_v4_OnDemandPropertyChangeListener_function.
typedef struct dxfg_v4_on_demand_property_change_listener_t dxfg_v4_on_demand_property_change_listener_t
 The handle of a listener of the property changes of an on-demand service.
typedef void(*) dxfg_v4_OnDemandPropertyChangeListener_function(graal_isolatethread_t *thread, const char *property_name, const dxfg_v4_on_demand_property_value_t *old_value, const dxfg_v4_on_demand_property_value_t *new_value, void *user_data)
 The callback of a listener of the property changes of an on-demand service.

Enumerations

enum  dxfg_v4_on_demand_property_value_kind_t {
  DXFG_V4_ON_DEMAND_PROPERTY_VALUE_NULL = 0 , DXFG_V4_ON_DEMAND_PROPERTY_VALUE_BOOLEAN = 1 , DXFG_V4_ON_DEMAND_PROPERTY_VALUE_DOUBLE = 2 , DXFG_V4_ON_DEMAND_PROPERTY_VALUE_TIME = 3 ,
  DXFG_V4_ON_DEMAND_PROPERTY_VALUE_OTHER = 4
}
 The kind of the value of an on-demand service property (dxfg_v4_on_demand_property_value_t). More...

Functions

int32_t dxfg_v4_OnDemandService_getInstance (graal_isolatethread_t *thread, DXFG_OUT dxfg_v4_on_demand_service_t **onDemandService)
 Returns the on-demand service of the default endpoint with the DXFG_ENDPOINT_ROLE_ON_DEMAND_FEED role.
int32_t dxfg_v4_OnDemandService_getInstanceByEndpoint (graal_isolatethread_t *thread, dxfg_v4_endpoint_t *endpoint, DXFG_OUT dxfg_v4_on_demand_service_t **onDemandService)
 Returns the on-demand service of the specified endpoint.
int32_t dxfg_v4_OnDemandService_getEndpoint (graal_isolatethread_t *thread, dxfg_v4_on_demand_service_t *service, DXFG_OUT dxfg_v4_endpoint_t **endpoint)
 Returns the endpoint that is associated with the service.
int32_t dxfg_v4_OnDemandService_isReplaySupported (graal_isolatethread_t *thread, dxfg_v4_on_demand_service_t *service, DXFG_OUT int32_t *replaySupported)
 Tells whether the on-demand historical data replay mode is supported.
int32_t dxfg_v4_OnDemandService_isReplay (graal_isolatethread_t *thread, dxfg_v4_on_demand_service_t *service, DXFG_OUT int32_t *replay)
 Tells whether the service is in the replay mode.
int32_t dxfg_v4_OnDemandService_isClear (graal_isolatethread_t *thread, dxfg_v4_on_demand_service_t *service, DXFG_OUT int32_t *clear)
 Tells whether the service is in the clear mode.
int32_t dxfg_v4_OnDemandService_getTime (graal_isolatethread_t *thread, dxfg_v4_on_demand_service_t *service, DXFG_OUT int64_t *time)
 Returns the current or the last replay time.
int32_t dxfg_v4_OnDemandService_getSpeed (graal_isolatethread_t *thread, dxfg_v4_on_demand_service_t *service, DXFG_OUT double *speed)
 Returns the replay speed.
int32_t dxfg_v4_OnDemandService_replay (graal_isolatethread_t *thread, dxfg_v4_on_demand_service_t *service, int64_t time)
 Turns the replay mode on from the specified time with the real-time speed (1).
int32_t dxfg_v4_OnDemandService_replayWithSpeed (graal_isolatethread_t *thread, dxfg_v4_on_demand_service_t *service, int64_t time, double speed)
 Turns the replay mode on from the specified time with the specified speed.
int32_t dxfg_v4_OnDemandService_pause (graal_isolatethread_t *thread, dxfg_v4_on_demand_service_t *service)
 Pauses the replay and keeps the data snapshot.
int32_t dxfg_v4_OnDemandService_stopAndResume (graal_isolatethread_t *thread, dxfg_v4_on_demand_service_t *service)
 Stops the replay and resumes the ordinary data feed.
int32_t dxfg_v4_OnDemandService_stopAndClear (graal_isolatethread_t *thread, dxfg_v4_on_demand_service_t *service)
 Stops the incoming data and clears it without resuming the data updates.
int32_t dxfg_v4_OnDemandService_setSpeed (graal_isolatethread_t *thread, dxfg_v4_on_demand_service_t *service, double speed)
 Changes the replay speed and continues the replay at the current time.
int32_t dxfg_v4_OnDemandPropertyChangeListener_new (graal_isolatethread_t *thread, dxfg_v4_OnDemandPropertyChangeListener_function function, void *user_data, DXFG_OUT dxfg_v4_on_demand_property_change_listener_t **listener)
 Creates a listener of the property changes of an on-demand service.
int32_t dxfg_v4_OnDemandService_addPropertyChangeListener (graal_isolatethread_t *thread, dxfg_v4_on_demand_service_t *service, dxfg_v4_on_demand_property_change_listener_t *listener)
 Adds a listener of the property changes to the on-demand service.
int32_t dxfg_v4_OnDemandService_removePropertyChangeListener (graal_isolatethread_t *thread, dxfg_v4_on_demand_service_t *service, dxfg_v4_on_demand_property_change_listener_t *listener)
 Removes a listener of the property changes from the on-demand service.

Detailed Description

The v4 functions and type names of the group OnDemand. Every function returns DXFG_EXECUTE_SUCCESSFULLY or DXFG_EXECUTE_FAIL and writes its result to a DXFG_OUT parameter, see The v4 functions.

Typedef Documentation

◆ dxfg_v4_java_object_handler

The handle of a Java object: the reference by which the C code refers to an object that lives in Java.

The handle is allocated by the SDK and owned by the caller: release it with dxfg_JavaObjectHandler_release(), which frees the structure and drops the reference to the Java object. As long as any handle of an object exists, the object is not garbage collected. Use dxfg_JavaObjectHandler_clone() to get another handle of the same object.

The typed handle structures (e.g. dxfg_executor_t, dxfg_time_zone_t) consist of this structure only (the field handler), so a pointer to a typed handle is passed to the functions that take a dxfg_java_object_handler * as &typed->handler (or by a cast).

Use dxfg_Object_toString() to get the string representation of the object, dxfg_Object_equals() to compare objects and dxfg_Object_hashCode() to get the hash code.

◆ dxfg_v4_on_demand_property_change_listener_t

typedef struct dxfg_v4_on_demand_property_change_listener_t dxfg_v4_on_demand_property_change_listener_t

The handle of a listener of the property changes of an on-demand service.

Created by dxfg_v4_OnDemandPropertyChangeListener_new(); release it with dxfg_v4_JavaObjectHandler_release().

Since
3.13.0

◆ dxfg_v4_on_demand_property_value_kind_t

The kind of the value of an on-demand service property (dxfg_v4_on_demand_property_value_t).

The value is an int32_t in the structure. New kinds may be added.

Since
3.13.0

◆ dxfg_v4_on_demand_property_value_t

typedef struct dxfg_v4_on_demand_property_value_t dxfg_v4_on_demand_property_value_t

The old or the new value of an on-demand service property, passed to dxfg_v4_OnDemandPropertyChangeListener_function.

kind tells which field holds the value; the other fields are 0.

Since
3.13.0

◆ dxfg_v4_on_demand_service_t

A handle of a Java OnDemandService object; release it with dxfg_JavaObjectHandler_release().

One service is associated with each endpoint that has the role DXFG_ENDPOINT_ROLE_FEED or DXFG_ENDPOINT_ROLE_ON_DEMAND_FEED: get it with dxfg_OnDemandService_getInstance() or dxfg_OnDemandService_getInstance2(). Releasing the handle does not stop the replay and does not close the endpoint.

Javadoc

◆ dxfg_v4_OnDemandPropertyChangeListener_function

typedef void(*) dxfg_v4_OnDemandPropertyChangeListener_function(graal_isolatethread_t *thread, const char *property_name, const dxfg_v4_on_demand_property_value_t *old_value, const dxfg_v4_on_demand_property_value_t *new_value, void *user_data)

The callback of a listener of the property changes of an on-demand service.

The service calls it once per changed property: replaySupported, replay, clear (booleans), speed (a double) and time (a time). It is called on a thread of the executor of the endpoint of the service, not on the thread that changed the service, with no lock of the SDK held: the callback may add and remove listeners. The changes of one service are reported one at a time.

The name and the values belong to the SDK and are valid only until the function returns.

Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]property_nameThe name of the property, a NUL-terminated UTF-8 string (NULL if the service reports a change of several properties at once, as a Java property change event without a name may do).
[in]old_valueThe old value of the property.
[in]new_valueThe new value of the property.
[in]user_dataThe user data passed to dxfg_v4_OnDemandPropertyChangeListener_new().
Since
3.13.0

Enumeration Type Documentation

◆ dxfg_v4_on_demand_property_value_kind_t

The kind of the value of an on-demand service property (dxfg_v4_on_demand_property_value_t).

The value is an int32_t in the structure. New kinds may be added.

Since
3.13.0
Enumerator
DXFG_V4_ON_DEMAND_PROPERTY_VALUE_NULL 

The value is null; no other field of the structure is set.

DXFG_V4_ON_DEMAND_PROPERTY_VALUE_BOOLEAN 

A boolean (the properties replaySupported, replay and clear) in boolean_value: 0 or 1.

DXFG_V4_ON_DEMAND_PROPERTY_VALUE_DOUBLE 

A double (the property speed) in double_value.

DXFG_V4_ON_DEMAND_PROPERTY_VALUE_TIME 

A time (the property time) in time_value, in milliseconds since 1970-01-01 00:00:00 UTC.

DXFG_V4_ON_DEMAND_PROPERTY_VALUE_OTHER 

A value of another type (a property that a later version of the service may add); no other field is set.

Function Documentation

◆ dxfg_v4_OnDemandPropertyChangeListener_new()

int32_t dxfg_v4_OnDemandPropertyChangeListener_new ( graal_isolatethread_t * thread,
dxfg_v4_OnDemandPropertyChangeListener_function function,
void * user_data,
DXFG_OUT dxfg_v4_on_demand_property_change_listener_t ** listener )

Creates a listener of the property changes of an on-demand service.

Add it to a service with dxfg_v4_OnDemandService_addPropertyChangeListener(). Releasing the last handle of the listener with dxfg_v4_JavaObjectHandler_release(), or dxfg_v4_NativeListener_deactivate() or dxfg_v4_NativeListener_deactivateAll(), stops the calls: after that the function is not called or running (except a call on the deactivating thread itself), and the user data can be freed.

Java: java.beans.PropertyChangeListener for OnDemandService.addPropertyChangeListener(PropertyChangeListener).

Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]functionThe function called for every property change; must not be NULL.
[in]user_dataThe user data passed to the function; the SDK does not use or free it.
[out]listenerThe pointer to the variable that receives the listener handle (release it with dxfg_v4_JavaObjectHandler_release()); must not be NULL. It is written on success only.
Returns
DXFG_EXECUTE_SUCCESSFULLY (0) on successful function execution or DXFG_EXECUTE_FAIL (-1) on error. Use dxfg_v4_get_and_clear_thread_exception() to determine if an exception was thrown.
Since
3.13.0

◆ dxfg_v4_OnDemandService_addPropertyChangeListener()

int32_t dxfg_v4_OnDemandService_addPropertyChangeListener ( graal_isolatethread_t * thread,
dxfg_v4_on_demand_service_t * service,
dxfg_v4_on_demand_property_change_listener_t * listener )

Adds a listener of the property changes to the on-demand service.

The service keeps the listener until dxfg_v4_OnDemandService_removePropertyChangeListener(); the caller may release its handle earlier, which stops the calls. A listener added twice is called twice per change.

Java: OnDemandService.addPropertyChangeListener(PropertyChangeListener).

Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]serviceThe service.
[in]listenerThe listener created by dxfg_v4_OnDemandPropertyChangeListener_new(); the caller keeps its ownership.
Returns
DXFG_EXECUTE_SUCCESSFULLY (0) on successful function execution or DXFG_EXECUTE_FAIL (-1) on error. Use dxfg_v4_get_and_clear_thread_exception() to determine if an exception was thrown.
Since
3.13.0

◆ dxfg_v4_OnDemandService_getEndpoint()

int32_t dxfg_v4_OnDemandService_getEndpoint ( graal_isolatethread_t * thread,
dxfg_v4_on_demand_service_t * service,
DXFG_OUT dxfg_v4_endpoint_t ** endpoint )

Returns the endpoint that is associated with the service.

Java: OnDemandService.getEndpoint().

Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]serviceThe service.
[out]endpointThe pointer to the variable that receives the endpoint (release the handle with dxfg_v4_JavaObjectHandler_release(); this does not close the endpoint); must not be NULL.
Returns
DXFG_EXECUTE_SUCCESSFULLY (0) on successful function execution or DXFG_EXECUTE_FAIL (-1) on error. Use dxfg_v4_get_and_clear_thread_exception() to determine if an exception was thrown.

◆ dxfg_v4_OnDemandService_getInstance()

int32_t dxfg_v4_OnDemandService_getInstance ( graal_isolatethread_t * thread,
DXFG_OUT dxfg_v4_on_demand_service_t ** onDemandService )

Returns the on-demand service of the default endpoint with the DXFG_ENDPOINT_ROLE_ON_DEMAND_FEED role.

The endpoint is the application-wide default endpoint of that role (dxfg_v4_OnDemandService_getEndpoint() returns it; dxfg_v4_DXEndpoint_createWithRole() creates a new endpoint instead), which is not connected to any other real-time or delayed data feed. It is created on the first call, is configured by the system properties and is closed by dxfg_v4_system_close_all_and_await_termination(). To switch another feed to the replay and back, use dxfg_v4_OnDemandService_getInstanceByEndpoint() with the endpoint of that feed.

The call fails if the on-demand implementation is not available in the library.

Java: OnDemandService.getInstance().

Parameters
[in]threadThe current GraalVM Isolate's thread.
[out]onDemandServiceThe pointer to the variable that receives the service (release the handle with dxfg_v4_JavaObjectHandler_release()); must not be NULL.
Returns
DXFG_EXECUTE_SUCCESSFULLY (0) on successful function execution or DXFG_EXECUTE_FAIL (-1) on error. Use dxfg_v4_get_and_clear_thread_exception() to determine if an exception was thrown.

◆ dxfg_v4_OnDemandService_getInstanceByEndpoint()

int32_t dxfg_v4_OnDemandService_getInstanceByEndpoint ( graal_isolatethread_t * thread,
dxfg_v4_endpoint_t * endpoint,
DXFG_OUT dxfg_v4_on_demand_service_t ** onDemandService )

Returns the on-demand service of the specified endpoint.

Each endpoint is associated with one service, so the calls for the same endpoint return handles of the same service. The endpoint must have the role DXFG_ENDPOINT_ROLE_FEED or DXFG_ENDPOINT_ROLE_ON_DEMAND_FEED, otherwise the call fails. It also fails if the on-demand implementation is not available in the library.

Java: OnDemandService.getInstance(DXEndpoint).

Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]endpointThe endpoint; the caller keeps its ownership.
[out]onDemandServiceThe pointer to the variable that receives the service (release the handle with dxfg_v4_JavaObjectHandler_release()); must not be NULL.
Returns
DXFG_EXECUTE_SUCCESSFULLY (0) on successful function execution or DXFG_EXECUTE_FAIL (-1) on error. Use dxfg_v4_get_and_clear_thread_exception() to determine if an exception was thrown.

◆ dxfg_v4_OnDemandService_getSpeed()

int32_t dxfg_v4_OnDemandService_getSpeed ( graal_isolatethread_t * thread,
dxfg_v4_on_demand_service_t * service,
DXFG_OUT double * speed )

Returns the replay speed.

The speed is measured with respect to the real-time playback speed: 1 is the real-time speed. It is 0 while the service is not in the replay mode.

Java: OnDemandService.getSpeed().

Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]serviceThe service.
[out]speedThe pointer to the variable that receives the replay speed; must not be NULL.
Returns
DXFG_EXECUTE_SUCCESSFULLY (0) on successful function execution or DXFG_EXECUTE_FAIL (-1) on error. Use dxfg_v4_get_and_clear_thread_exception() to determine if an exception was thrown.

◆ dxfg_v4_OnDemandService_getTime()

int32_t dxfg_v4_OnDemandService_getTime ( graal_isolatethread_t * thread,
dxfg_v4_on_demand_service_t * service,
DXFG_OUT int64_t * time )

Returns the current or the last replay time.

In the replay mode it is the time that is being replayed, otherwise the last time that was replayed. If the replay was never started, it is 0 (the Unix epoch).

Java: OnDemandService.getTime(), the result of Date.getTime().

Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]serviceThe service.
[out]timeThe pointer to the variable that receives the time in milliseconds since the Unix epoch (UTC); must not be NULL.
Returns
DXFG_EXECUTE_SUCCESSFULLY (0) on successful function execution or DXFG_EXECUTE_FAIL (-1) on error. Use dxfg_v4_get_and_clear_thread_exception() to determine if an exception was thrown.

◆ dxfg_v4_OnDemandService_isClear()

int32_t dxfg_v4_OnDemandService_isClear ( graal_isolatethread_t * thread,
dxfg_v4_on_demand_service_t * service,
DXFG_OUT int32_t * clear )

Tells whether the service is in the clear mode.

The clear mode is in effect after dxfg_v4_OnDemandService_stopAndClear() and before dxfg_v4_OnDemandService_stopAndResume(), dxfg_v4_OnDemandService_replay() or dxfg_v4_OnDemandService_replayWithSpeed().

Java: OnDemandService.isClear().

Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]serviceThe service.
[out]clearThe pointer to the variable that receives 1 if the service is in the clear mode, 0 if not; must not be NULL.
Returns
DXFG_EXECUTE_SUCCESSFULLY (0) on successful function execution or DXFG_EXECUTE_FAIL (-1) on error. Use dxfg_v4_get_and_clear_thread_exception() to determine if an exception was thrown.

◆ dxfg_v4_OnDemandService_isReplay()

int32_t dxfg_v4_OnDemandService_isReplay ( graal_isolatethread_t * thread,
dxfg_v4_on_demand_service_t * service,
DXFG_OUT int32_t * replay )

Tells whether the service is in the replay mode.

The replay mode is in effect after dxfg_v4_OnDemandService_replay() or dxfg_v4_OnDemandService_replayWithSpeed() and before dxfg_v4_OnDemandService_stopAndResume() or dxfg_v4_OnDemandService_stopAndClear().

Java: OnDemandService.isReplay().

Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]serviceThe service.
[out]replayThe pointer to the variable that receives 1 if the service is in the replay mode, 0 if not; must not be NULL.
Returns
DXFG_EXECUTE_SUCCESSFULLY (0) on successful function execution or DXFG_EXECUTE_FAIL (-1) on error. Use dxfg_v4_get_and_clear_thread_exception() to determine if an exception was thrown.

◆ dxfg_v4_OnDemandService_isReplaySupported()

int32_t dxfg_v4_OnDemandService_isReplaySupported ( graal_isolatethread_t * thread,
dxfg_v4_on_demand_service_t * service,
DXFG_OUT int32_t * replaySupported )

Tells whether the on-demand historical data replay mode is supported.

It is supported when the endpoint is connected to an address with the "(ondemand:<address>)" component that specifies an on-demand historical data provider. While it is not supported, the replay functions fail.

Java: OnDemandService.isReplaySupported().

Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]serviceThe service.
[out]replaySupportedThe pointer to the variable that receives 1 if the replay mode is supported, 0 if not; must not be NULL.
Returns
DXFG_EXECUTE_SUCCESSFULLY (0) on successful function execution or DXFG_EXECUTE_FAIL (-1) on error. Use dxfg_v4_get_and_clear_thread_exception() to determine if an exception was thrown.

◆ dxfg_v4_OnDemandService_pause()

int32_t dxfg_v4_OnDemandService_pause ( graal_isolatethread_t * thread,
dxfg_v4_on_demand_service_t * service )

Pauses the replay and keeps the data snapshot.

It is the same as dxfg_v4_OnDemandService_setSpeed() with the speed 0: the current replay time is captured and the replay stops at it. Outside the replay mode the call has no effect (and succeeds).

Java: OnDemandService.pause().

Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]serviceThe service.
Returns
DXFG_EXECUTE_SUCCESSFULLY (0) on successful function execution or DXFG_EXECUTE_FAIL (-1) on error. Use dxfg_v4_get_and_clear_thread_exception() to determine if an exception was thrown.

◆ dxfg_v4_OnDemandService_removePropertyChangeListener()

int32_t dxfg_v4_OnDemandService_removePropertyChangeListener ( graal_isolatethread_t * thread,
dxfg_v4_on_demand_service_t * service,
dxfg_v4_on_demand_property_change_listener_t * listener )

Removes a listener of the property changes from the on-demand service.

Removing a listener that was not added does nothing. A change that the service is reporting at that moment may still reach the listener; release its handle to stop the calls for sure. Remove the listener before releasing its last handle: a released handle cannot be passed here, and a listener that was released without being removed stays in the service (as a small Java object that is never called again).

Java: OnDemandService.removePropertyChangeListener(PropertyChangeListener).

Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]serviceThe service.
[in]listenerThe listener; the caller keeps its ownership.
Returns
DXFG_EXECUTE_SUCCESSFULLY (0) on successful function execution or DXFG_EXECUTE_FAIL (-1) on error. Use dxfg_v4_get_and_clear_thread_exception() to determine if an exception was thrown.
Since
3.13.0

◆ dxfg_v4_OnDemandService_replay()

int32_t dxfg_v4_OnDemandService_replay ( graal_isolatethread_t * thread,
dxfg_v4_on_demand_service_t * service,
int64_t time )

Turns the replay mode on from the specified time with the real-time speed (1).

The call is the same as dxfg_v4_OnDemandService_replayWithSpeed() with the speed 1. It fails if the replay mode is not supported (see dxfg_v4_OnDemandService_isReplaySupported()).

Java: OnDemandService.replay(Date).

Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]serviceThe service.
[in]timeThe time to start the replay from, in milliseconds since the Unix epoch (UTC).
Returns
DXFG_EXECUTE_SUCCESSFULLY (0) on successful function execution or DXFG_EXECUTE_FAIL (-1) on error. Use dxfg_v4_get_and_clear_thread_exception() to determine if an exception was thrown.

◆ dxfg_v4_OnDemandService_replayWithSpeed()

int32_t dxfg_v4_OnDemandService_replayWithSpeed ( graal_isolatethread_t * thread,
dxfg_v4_on_demand_service_t * service,
int64_t time,
double speed )

Turns the replay mode on from the specified time with the specified speed.

The feed is disconnected from the other data providers, pre-buffers the historical tick data and replays it as if it came from the data feeds now. After the call dxfg_v4_OnDemandService_isReplay() returns 1, dxfg_v4_OnDemandService_isClear() returns 0, dxfg_v4_OnDemandService_getTime() returns the time that is being replayed and dxfg_v4_OnDemandService_getSpeed() returns speed. The call fails if the replay mode is not supported (see dxfg_v4_OnDemandService_isReplaySupported()) or if the speed is negative.

Java: OnDemandService.replay(Date, double).

Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]serviceThe service.
[in]timeThe time to start the replay from, in milliseconds since the Unix epoch (UTC).
[in]speedThe speed to start the replay with: 1 is the real-time speed, more than 1 is faster, less than 1 is slower and 0 is a pause.
Returns
DXFG_EXECUTE_SUCCESSFULLY (0) on successful function execution or DXFG_EXECUTE_FAIL (-1) on error. Use dxfg_v4_get_and_clear_thread_exception() to determine if an exception was thrown.

◆ dxfg_v4_OnDemandService_setSpeed()

int32_t dxfg_v4_OnDemandService_setSpeed ( graal_isolatethread_t * thread,
dxfg_v4_on_demand_service_t * service,
double speed )

Changes the replay speed and continues the replay at the current time.

The speed is measured with respect to the real-time playback speed. The call fails if the speed is negative, or if the service is not in the replay mode and the speed is not 0.

Java: OnDemandService.setSpeed(double).

Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]serviceThe service.
[in]speedThe new replay speed: 1 is the real-time speed, more than 1 is faster, less than 1 is slower and 0 is a pause.
Returns
DXFG_EXECUTE_SUCCESSFULLY (0) on successful function execution or DXFG_EXECUTE_FAIL (-1) on error. Use dxfg_v4_get_and_clear_thread_exception() to determine if an exception was thrown.

◆ dxfg_v4_OnDemandService_stopAndClear()

int32_t dxfg_v4_OnDemandService_stopAndClear ( graal_isolatethread_t * thread,
dxfg_v4_on_demand_service_t * service )

Stops the incoming data and clears it without resuming the data updates.

The call works both in the replay mode and for the ordinary data feed: all the incoming data updates are suspended and the current data is cleared. After the call dxfg_v4_OnDemandService_isReplay() returns 0, dxfg_v4_OnDemandService_isClear() returns 1, dxfg_v4_OnDemandService_getTime() returns the last replayed time and dxfg_v4_OnDemandService_getSpeed() returns 0. The ordinary feed is resumed by dxfg_v4_OnDemandService_stopAndResume(), the replay is continued by dxfg_v4_OnDemandService_replay() or dxfg_v4_OnDemandService_replayWithSpeed().

Java: OnDemandService.stopAndClear().

Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]serviceThe service.
Returns
DXFG_EXECUTE_SUCCESSFULLY (0) on successful function execution or DXFG_EXECUTE_FAIL (-1) on error. Use dxfg_v4_get_and_clear_thread_exception() to determine if an exception was thrown.

◆ dxfg_v4_OnDemandService_stopAndResume()

int32_t dxfg_v4_OnDemandService_stopAndResume ( graal_isolatethread_t * thread,
dxfg_v4_on_demand_service_t * service )

Stops the replay and resumes the ordinary data feed.

The call has no effect if the service is neither in the replay mode nor in the clear mode. After the call dxfg_v4_OnDemandService_isReplay() and dxfg_v4_OnDemandService_isClear() return 0, dxfg_v4_OnDemandService_getTime() returns the last replayed time and dxfg_v4_OnDemandService_getSpeed() returns 0. An endpoint with the role DXFG_ENDPOINT_ROLE_ON_DEMAND_FEED has no ordinary feed, so for it the call works like dxfg_v4_OnDemandService_stopAndClear().

Java: OnDemandService.stopAndResume().

Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]serviceThe service.
Returns
DXFG_EXECUTE_SUCCESSFULLY (0) on successful function execution or DXFG_EXECUTE_FAIL (-1) on error. Use dxfg_v4_get_and_clear_thread_exception() to determine if an exception was thrown.