|
dxFeed Graal Native SDK 3.16.0
|
The filter of the subscriptions and the events by named categories of QD filter expressions. More...
Data Structures | |
| struct | dxfg_v4_feed_filter_builder_t |
| The handle of a builder of a feed filter (dxfg_v4_DXFeedFilter_newBuilder()). More... | |
| struct | dxfg_v4_feed_filter_t |
| The handle of a feed filter (dxfg_v4_DXFeedFilter_Builder_build()). More... | |
| struct | dxfg_v4_feed_filter_tracker_t |
| The handle of the tracker of the updates of a feed filter (dxfg_v4_DXFeedFilter_getTracker()). More... | |
| struct | dxfg_v4_feed_filter_listener_t |
| The handle of a listener of the updates of a feed filter (dxfg_v4_DXFeedFilterListener_new()). More... | |
Typedefs | |
| typedef struct dxfg_v4_feed_filter_builder_t | dxfg_v4_feed_filter_builder_t |
| The handle of a builder of a feed filter (dxfg_v4_DXFeedFilter_newBuilder()). | |
| typedef struct dxfg_v4_feed_filter_t | dxfg_v4_feed_filter_t |
| The handle of a feed filter (dxfg_v4_DXFeedFilter_Builder_build()). | |
| typedef struct dxfg_v4_feed_filter_tracker_t | dxfg_v4_feed_filter_tracker_t |
| The handle of the tracker of the updates of a feed filter (dxfg_v4_DXFeedFilter_getTracker()). | |
| typedef struct dxfg_v4_feed_filter_listener_t | dxfg_v4_feed_filter_listener_t |
| The handle of a listener of the updates of a feed filter (dxfg_v4_DXFeedFilterListener_new()). | |
| typedef void(*) | dxfg_v4_feed_filter_listener_func(graal_isolatethread_t *thread, void *user_data) |
| The function of a listener of the updates of a feed filter (dxfg_v4_DXFeedFilterListener_new()). | |
Functions | |
| int32_t | dxfg_v4_DXFeedFilter_newBuilder (graal_isolatethread_t *thread, dxfg_v4_endpoint_t *endpoint, DXFG_OUT dxfg_v4_feed_filter_builder_t **builder) |
| Creates a new builder of a feed filter for the endpoint, without categories. | |
| int32_t | dxfg_v4_DXFeedFilter_Builder_withCategory (graal_isolatethread_t *thread, dxfg_v4_feed_filter_builder_t *builder, const char *categoryName, const char *filterExpression) |
| Adds a category to the builder: a name and its QD filter expression. | |
| int32_t | dxfg_v4_DXFeedFilter_Builder_withCategories (graal_isolatethread_t *thread, dxfg_v4_feed_filter_builder_t *builder, const dxfg_v4_string_list *categoryNames, const dxfg_v4_string_list *filterExpressions) |
| Adds categories to the builder: the names and the QD filter expressions of two lists of the same size, in the order of the lists. | |
| int32_t | dxfg_v4_DXFeedFilter_Builder_build (graal_isolatethread_t *thread, dxfg_v4_feed_filter_builder_t *builder, DXFG_OUT dxfg_v4_feed_filter_t **filter) |
| Builds a filter of the categories of the builder. | |
| int32_t | dxfg_v4_DXFeedFilter_accept (graal_isolatethread_t *thread, dxfg_v4_feed_filter_t *filter, dxfg_v4_event_clazz_t eventType, dxfg_v4_symbol_t *symbol, DXFG_OUT int32_t *accepted) |
| Checks whether a subscription (an event type and a symbol) passes any category of the filter. | |
| int32_t | dxfg_v4_DXFeedFilter_acceptEvent (graal_isolatethread_t *thread, dxfg_v4_feed_filter_t *filter, dxfg_v4_event_type_t *event, DXFG_OUT int32_t *accepted) |
| Checks whether an event passes any category of the filter, by the type and the symbol of the event. | |
| int32_t | dxfg_v4_DXFeedFilter_getCategory (graal_isolatethread_t *thread, dxfg_v4_feed_filter_t *filter, dxfg_v4_event_clazz_t eventType, dxfg_v4_symbol_t *symbol, DXFG_OUT const char **category) |
| Returns the name of the first category of the filter that a subscription (an event type and a symbol) passes, in the order the categories were added. | |
| int32_t | dxfg_v4_DXFeedFilter_getEventCategory (graal_isolatethread_t *thread, dxfg_v4_feed_filter_t *filter, dxfg_v4_event_type_t *event, DXFG_OUT const char **category) |
| Returns the name of the first category of the filter that an event passes, in the order the categories were added. | |
| int32_t | dxfg_v4_DXFeedFilter_isDynamic (graal_isolatethread_t *thread, dxfg_v4_feed_filter_t *filter, DXFG_OUT int32_t *dynamic) |
| Checks whether the filter is dynamic: whether it gets new versions, which its tracker reports (dxfg_v4_DXFeedFilter_getTracker()). | |
| int32_t | dxfg_v4_DXFeedFilter_getTracker (graal_isolatethread_t *thread, dxfg_v4_feed_filter_t *filter, DXFG_OUT dxfg_v4_feed_filter_tracker_t **tracker) |
| Returns the tracker of the filter: the holder of its latest version, the same for all the versions. | |
| int32_t | dxfg_v4_DXFeedFilterTracker_getCurrentFilter (graal_isolatethread_t *thread, dxfg_v4_feed_filter_tracker_t *tracker, DXFG_OUT dxfg_v4_feed_filter_t **filter) |
| Returns the latest version of the filter of the tracker. | |
| int32_t | dxfg_v4_DXFeedFilterTracker_addListener (graal_isolatethread_t *thread, dxfg_v4_feed_filter_tracker_t *tracker, dxfg_v4_feed_filter_listener_t *listener) |
| Adds a listener to the tracker: it is called after each later update of the filter. | |
| int32_t | dxfg_v4_DXFeedFilterTracker_removeListener (graal_isolatethread_t *thread, dxfg_v4_feed_filter_tracker_t *tracker, dxfg_v4_feed_filter_listener_t *listener) |
| Removes a listener from the tracker. | |
| int32_t | dxfg_v4_DXFeedFilterListener_new (graal_isolatethread_t *thread, dxfg_v4_feed_filter_listener_func user_func, void *user_data, DXFG_OUT dxfg_v4_feed_filter_listener_t **listener) |
| Creates a new listener of the updates of a feed filter. | |
The filter of the subscriptions and the events by named categories of QD filter expressions.
A builder (dxfg_v4_DXFeedFilter_newBuilder()) takes the categories of a filter, each one a name and a QD filter expression (e.g. IBM,AAPL, A*, range-A-M-, ipf[file.ipf,update=10m]), and builds the filter (dxfg_v4_DXFeedFilter_Builder_build()). The filter tells whether a subscription (an event type and a symbol) or an event passes any of its categories, and which category is the first one that it passes, in the order the categories were added.
A filter does not change. A dynamic filter (dxfg_v4_DXFeedFilter_isDynamic()), e.g. one with an ipf[...] expression with an update period, gets a new version on each update: its tracker (dxfg_v4_DXFeedFilter_getTracker()) returns the latest version (dxfg_v4_DXFeedFilterTracker_getCurrentFilter()) and calls its listeners (dxfg_v4_DXFeedFilterListener_new()) after each update.
Each function that returns a handle returns a new one, which the caller releases with dxfg_v4_JavaObjectHandler_release(). The builder, the filter, the tracker and the listener can be released in any order.
All the functions and types of the group are experimental (see The v4 functions): the Java API they call is @Experimental in QD and may change. DXFG_V4_FEATURE_FEED_FILTER reports them.
Java: com.dxfeed.api.DXFeedFilter, DXFeedFilter.Builder, DXFeedFilterTracker, DXFeedFilterListener.
| typedef struct dxfg_v4_feed_filter_builder_t dxfg_v4_feed_filter_builder_t |
The handle of a builder of a feed filter (dxfg_v4_DXFeedFilter_newBuilder()).
| typedef void(*) dxfg_v4_feed_filter_listener_func(graal_isolatethread_t *thread, void *user_data) |
The function of a listener of the updates of a feed filter (dxfg_v4_DXFeedFilterListener_new()).
It is called after the filter of a tracker to which the listener is added has been updated; the tracker returns the new version with dxfg_v4_DXFeedFilterTracker_getCurrentFilter(). Fast updates may come as one call. It is called on a thread of the SDK that updates the filter (e.g. the thread that reloads the IPF of an ipf[...] expression), never on the thread that adds the listener. The function may call any function of the SDK on that thread, including dxfg_v4_DXFeedFilterTracker_addListener() and dxfg_v4_DXFeedFilterTracker_removeListener() of its own tracker and the release of its own listener; it should return quickly, since the next update waits for it.
| [in] | thread | The current GraalVM Isolate's thread (the thread of the SDK that calls the function). |
| [in] | user_data | The user data given to dxfg_v4_DXFeedFilterListener_new(). |
| typedef struct dxfg_v4_feed_filter_listener_t dxfg_v4_feed_filter_listener_t |
The handle of a listener of the updates of a feed filter (dxfg_v4_DXFeedFilterListener_new()).
| typedef struct dxfg_v4_feed_filter_t dxfg_v4_feed_filter_t |
The handle of a feed filter (dxfg_v4_DXFeedFilter_Builder_build()).
| typedef struct dxfg_v4_feed_filter_tracker_t dxfg_v4_feed_filter_tracker_t |
The handle of the tracker of the updates of a feed filter (dxfg_v4_DXFeedFilter_getTracker()).
| int32_t dxfg_v4_DXFeedFilter_accept | ( | graal_isolatethread_t * | thread, |
| dxfg_v4_feed_filter_t * | filter, | ||
| dxfg_v4_event_clazz_t | eventType, | ||
| dxfg_v4_symbol_t * | symbol, | ||
| DXFG_OUT int32_t * | accepted ) |
Checks whether a subscription (an event type and a symbol) passes any category of the filter.
Java: DXFeedFilter.accept(Class, Object).
| [in] | thread | The current GraalVM Isolate's thread. |
| [in] | filter | The filter; must not be NULL. |
| [in] | eventType | The event type of the subscription. |
| [in] | symbol | The subscription symbol (a string, a candle, an indexed event subscription or a time series subscription symbol); must not be NULL. |
| [out] | accepted | The pointer to the variable that receives 1 if the subscription passes, 0 otherwise; must not be NULL. It is written on success only. |
| int32_t dxfg_v4_DXFeedFilter_acceptEvent | ( | graal_isolatethread_t * | thread, |
| dxfg_v4_feed_filter_t * | filter, | ||
| dxfg_v4_event_type_t * | event, | ||
| DXFG_OUT int32_t * | accepted ) |
Checks whether an event passes any category of the filter, by the type and the symbol of the event.
Java: DXFeedFilter.acceptEvent(EventType).
| [in] | thread | The current GraalVM Isolate's thread. |
| [in] | filter | The filter; must not be NULL. |
| [in] | event | The event; must not be NULL. |
| [out] | accepted | The pointer to the variable that receives 1 if the event passes, 0 otherwise; must not be NULL. It is written on success only. |
| int32_t dxfg_v4_DXFeedFilter_Builder_build | ( | graal_isolatethread_t * | thread, |
| dxfg_v4_feed_filter_builder_t * | builder, | ||
| DXFG_OUT dxfg_v4_feed_filter_t ** | filter ) |
Builds a filter of the categories of the builder.
The builder stays usable: more categories can be added and another filter built.
Java: DXFeedFilter.Builder.build().
| [in] | thread | The current GraalVM Isolate's thread. |
| [in] | builder | The builder; must not be NULL. |
| [out] | filter | The pointer to the variable that receives the filter (release it with dxfg_v4_JavaObjectHandler_release()); must not be NULL. It is written on success only. |
| int32_t dxfg_v4_DXFeedFilter_Builder_withCategories | ( | graal_isolatethread_t * | thread, |
| dxfg_v4_feed_filter_builder_t * | builder, | ||
| const dxfg_v4_string_list * | categoryNames, | ||
| const dxfg_v4_string_list * | filterExpressions ) |
Adds categories to the builder: the names and the QD filter expressions of two lists of the same size, in the order of the lists.
The lists are checked as a whole before the builder changes: on an error no category is added. Empty lists add nothing. The lists stay the caller's.
Java: DXFeedFilter.Builder.withCategories(Map) with a LinkedHashMap.
| [in] | thread | The current GraalVM Isolate's thread. |
| [in] | builder | The builder; must not be NULL. |
| [in] | categoryNames | The names of the categories: non-empty UTF-8 strings, different from each other and from the names that the builder already has; must not be NULL. |
| [in] | filterExpressions | The QD filter expressions of the categories, one for each name: non-empty UTF-8 strings; must not be NULL. |
| int32_t dxfg_v4_DXFeedFilter_Builder_withCategory | ( | graal_isolatethread_t * | thread, |
| dxfg_v4_feed_filter_builder_t * | builder, | ||
| const char * | categoryName, | ||
| const char * | filterExpression ) |
Adds a category to the builder: a name and its QD filter expression.
The categories are evaluated in the order they are added; the first one that matches gives the category. The expression is checked at dxfg_v4_DXFeedFilter_Builder_build(), not here.
Java: DXFeedFilter.Builder.withCategory(String, String).
| [in] | thread | The current GraalVM Isolate's thread. |
| [in] | builder | The builder; must not be NULL. |
| [in] | categoryName | The name of the category, a non-empty UTF-8 string that the builder does not have yet. |
| [in] | filterExpression | The QD filter expression of the category, a non-empty UTF-8 string. |
| int32_t dxfg_v4_DXFeedFilter_getCategory | ( | graal_isolatethread_t * | thread, |
| dxfg_v4_feed_filter_t * | filter, | ||
| dxfg_v4_event_clazz_t | eventType, | ||
| dxfg_v4_symbol_t * | symbol, | ||
| DXFG_OUT const char ** | category ) |
Returns the name of the first category of the filter that a subscription (an event type and a symbol) passes, in the order the categories were added.
Java: DXFeedFilter.getCategory(Class, Object).
| [in] | thread | The current GraalVM Isolate's thread. |
| [in] | filter | The filter; must not be NULL. |
| [in] | eventType | The event type of the subscription. |
| [in] | symbol | The subscription symbol (see dxfg_v4_DXFeedFilter_accept()); must not be NULL. |
| [out] | category | The pointer to the variable that receives the name of the category (release it with dxfg_v4_String_release()), or NULL if the subscription passes no category (it is not an error); must not be NULL. It is written on success only. |
| int32_t dxfg_v4_DXFeedFilter_getEventCategory | ( | graal_isolatethread_t * | thread, |
| dxfg_v4_feed_filter_t * | filter, | ||
| dxfg_v4_event_type_t * | event, | ||
| DXFG_OUT const char ** | category ) |
Returns the name of the first category of the filter that an event passes, in the order the categories were added.
Java: DXFeedFilter.getEventCategory(EventType).
| [in] | thread | The current GraalVM Isolate's thread. |
| [in] | filter | The filter; must not be NULL. |
| [in] | event | The event; must not be NULL. |
| [out] | category | The pointer to the variable that receives the name of the category (release it with dxfg_v4_String_release()), or NULL if the event passes no category (it is not an error); must not be NULL. It is written on success only. |
| int32_t dxfg_v4_DXFeedFilter_getTracker | ( | graal_isolatethread_t * | thread, |
| dxfg_v4_feed_filter_t * | filter, | ||
| DXFG_OUT dxfg_v4_feed_filter_tracker_t ** | tracker ) |
Returns the tracker of the filter: the holder of its latest version, the same for all the versions.
Each call returns a new handle of the same tracker.
Java: DXFeedFilter.getTracker().
| [in] | thread | The current GraalVM Isolate's thread. |
| [in] | filter | The filter; must not be NULL. |
| [out] | tracker | The pointer to the variable that receives the tracker (release it with dxfg_v4_JavaObjectHandler_release()); must not be NULL. It is written on success only. |
| int32_t dxfg_v4_DXFeedFilter_isDynamic | ( | graal_isolatethread_t * | thread, |
| dxfg_v4_feed_filter_t * | filter, | ||
| DXFG_OUT int32_t * | dynamic ) |
Checks whether the filter is dynamic: whether it gets new versions, which its tracker reports (dxfg_v4_DXFeedFilter_getTracker()).
Java: DXFeedFilter.isDynamic().
| [in] | thread | The current GraalVM Isolate's thread. |
| [in] | filter | The filter; must not be NULL. |
| [out] | dynamic | The pointer to the variable that receives 1 if the filter is dynamic, 0 otherwise; must not be NULL. It is written on success only. |
| int32_t dxfg_v4_DXFeedFilter_newBuilder | ( | graal_isolatethread_t * | thread, |
| dxfg_v4_endpoint_t * | endpoint, | ||
| DXFG_OUT dxfg_v4_feed_filter_builder_t ** | builder ) |
Creates a new builder of a feed filter for the endpoint, without categories.
The expressions of the categories are parsed with the data scheme of the endpoint at dxfg_v4_DXFeedFilter_Builder_build(). A builder is not thread-safe: use it on one thread at a time.
Java: DXFeedFilter.newBuilder(DXEndpoint).
| [in] | thread | The current GraalVM Isolate's thread. |
| [in] | endpoint | The endpoint; must not be NULL. |
| [out] | builder | The pointer to the variable that receives the builder (release it with dxfg_v4_JavaObjectHandler_release()); must not be NULL. It is written on success only. |
| int32_t dxfg_v4_DXFeedFilterListener_new | ( | graal_isolatethread_t * | thread, |
| dxfg_v4_feed_filter_listener_func | user_func, | ||
| void * | user_data, | ||
| DXFG_OUT dxfg_v4_feed_filter_listener_t ** | listener ) |
Creates a new listener of the updates of a feed filter.
The listener does nothing until it is added to a tracker with dxfg_v4_DXFeedFilterTracker_addListener(). The function is called as described at dxfg_v4_feed_filter_listener_func, with the user data only: it gets no handles.
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 of the function: after the release returns the function is not running (except on the releasing thread itself, when the function releases its own listener) and is not called anymore, so the user data can be freed. A released listener that is still added removes itself from the tracker at its next update; until then the tracker keeps following the updates (e.g. reloads the IPF file), so remove the listener before the release to stop at once.
Java: DXFeedFilterListener.filterUpdated(DXFeedFilterTracker).
| [in] | thread | The current GraalVM Isolate's thread. |
| [in] | user_func | The function to call after the updates; must not be NULL. |
| [in] | user_data | The user data to pass to the function; the SDK does not use it. It must stay valid until the listener is deactivated. |
| [out] | listener | The pointer to the variable that receives the listener (release its handle with dxfg_v4_JavaObjectHandler_release()); must not be NULL. It is written on success only. |
| int32_t dxfg_v4_DXFeedFilterTracker_addListener | ( | graal_isolatethread_t * | thread, |
| dxfg_v4_feed_filter_tracker_t * | tracker, | ||
| dxfg_v4_feed_filter_listener_t * | listener ) |
Adds a listener to the tracker: it is called after each later update of the filter.
The tracker of a filter that is not dynamic ignores the listener. The listener stays added until it is removed; a listener whose last handle is released is not called anymore and removes itself at the next update.
Java: DXFeedFilterTracker.addListener(DXFeedFilterListener).
| [in] | thread | The current GraalVM Isolate's thread. |
| [in] | tracker | The tracker; must not be NULL. |
| [in] | listener | The listener; must not be NULL. |
| int32_t dxfg_v4_DXFeedFilterTracker_getCurrentFilter | ( | graal_isolatethread_t * | thread, |
| dxfg_v4_feed_filter_tracker_t * | tracker, | ||
| DXFG_OUT dxfg_v4_feed_filter_t ** | filter ) |
Returns the latest version of the filter of the tracker.
The tracker follows the updates only while it has a listener (dxfg_v4_DXFeedFilterTracker_addListener()); without one it may return an older version. Each call returns a new handle.
Java: DXFeedFilterTracker.getCurrentFilter().
| [in] | thread | The current GraalVM Isolate's thread. |
| [in] | tracker | The tracker; must not be NULL. |
| [out] | filter | The pointer to the variable that receives the filter (release it with dxfg_v4_JavaObjectHandler_release()); must not be NULL. It is written on success only. |
| int32_t dxfg_v4_DXFeedFilterTracker_removeListener | ( | graal_isolatethread_t * | thread, |
| dxfg_v4_feed_filter_tracker_t * | tracker, | ||
| dxfg_v4_feed_filter_listener_t * | listener ) |
Removes a listener from the tracker.
A call of the listener that has already started on another thread may still run after the function returns; releasing the last handle of the listener waits for it (see dxfg_v4_DXFeedFilterListener_new()).
Java: DXFeedFilterTracker.removeListener(DXFeedFilterListener).
| [in] | thread | The current GraalVM Isolate's thread. |
| [in] | tracker | The tracker; must not be NULL. |
| [in] | listener | The listener; must not be NULL. |