dxFeed Graal Native SDK 3.13.0
Loading...
Searching...
No Matches
AdditionalUnderlyings' functions

Functions

int32_t dxfg_AdditionalUnderlyings_EMPTY (graal_isolatethread_t *thread, DXFG_OUT dxfg_additional_underlyings_t **emptyAdditionalUnderlyings)
int32_t dxfg_AdditionalUnderlyings_valueOf (graal_isolatethread_t *thread, const char *text, DXFG_OUT dxfg_additional_underlyings_t **additionalUnderlyings)
int32_t dxfg_AdditionalUnderlyings_valueOf2 (graal_isolatethread_t *thread, const dxfg_string_to_double_map_entry_t *mapEntries, int32_t size, DXFG_OUT dxfg_additional_underlyings_t **additionalUnderlyings)
int32_t dxfg_AdditionalUnderlyings_getSPC (graal_isolatethread_t *thread, const char *text, const char *symbol, DXFG_OUT double *spc)
int32_t dxfg_AdditionalUnderlyings_getText (graal_isolatethread_t *thread, dxfg_additional_underlyings_t *additionalUnderlyings, DXFG_OUT char **text)
int32_t dxfg_AdditionalUnderlyings_getMap (graal_isolatethread_t *thread, dxfg_additional_underlyings_t *additionalUnderlyings, DXFG_OUT dxfg_string_to_double_map_entry_t **mapEntries, DXFG_OUT int32_t *size)
int32_t dxfg_AdditionalUnderlyings_getSPC2 (graal_isolatethread_t *thread, dxfg_additional_underlyings_t *additionalUnderlyings, const char *symbol, DXFG_OUT double *spc)

Detailed Description

Function Documentation

◆ dxfg_AdditionalUnderlyings_EMPTY()

int32_t dxfg_AdditionalUnderlyings_EMPTY ( graal_isolatethread_t * thread,
DXFG_OUT dxfg_additional_underlyings_t ** emptyAdditionalUnderlyings )

Returns an empty additional underlyings (https://docs.dxfeed.com/dxfeed/api/com/dxfeed/glossary/AdditionalUnderlyings.html#EMPTY it has empty text and empty map). The handle of this instance will be written to the passed pointer.

Sample:

dxfg_additional_underlyings_t* additional_underlyings = {};
int32_t result = dxfg_AdditionalUnderlyings_EMPTY(isolate_thread, &additional_underlyings);
if (result == DXFG_EXECUTE_SUCCESSFULLY) {
// Do some work with additionalUnderlyings
// Release
dxfg_JavaObjectHandler_release(isolate_thread, &additional_underlyings->handler);
} else {
// Use the dxfg_get_and_clear_thread_exception_t to print the stack trace.
}
int32_t dxfg_AdditionalUnderlyings_EMPTY(graal_isolatethread_t *thread, DXFG_OUT dxfg_additional_underlyings_t **emptyAdditionalUnderlyings)
#define DXFG_EXECUTE_SUCCESSFULLY
Definition dxfg_common.h:72
int32_t dxfg_JavaObjectHandler_release(graal_isolatethread_t *thread, dxfg_java_object_handler *handler)
Definition dxfg_glossary.h:47
dxfg_java_object_handler handler
Definition dxfg_glossary.h:49
Deprecated
Use dxfg_v4_AdditionalUnderlyings_EMPTY().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[out]emptyAdditionalUnderlyingsThe pointer to result's handle (an empty additional underlyings https://docs.dxfeed.com/dxfeed/api/com/dxfeed/glossary/AdditionalUnderlyings.html#EMPTY)
Returns
DXFG_EXECUTE_SUCCESSFULLY (0) on successful function execution or DXFG_EXECUTE_FAIL (-1) on error. Use dxfg_get_and_clear_thread_exception_t() to determine if an exception was thrown. Use dxfg_JavaObjectHandler_release() to free the additional underlyings handle.

◆ dxfg_AdditionalUnderlyings_getMap()

int32_t dxfg_AdditionalUnderlyings_getMap ( graal_isolatethread_t * thread,
dxfg_additional_underlyings_t * additionalUnderlyings,
DXFG_OUT dxfg_string_to_double_map_entry_t ** mapEntries,
DXFG_OUT int32_t * size )

Returns internal representation of additional underlyings as a map from underlying symbol to its SPC.

Sample:

int32_t size = {};
int32_t result = dxfg_AdditionalUnderlyings_getMap(isolate_thread, additional_underlyings, &map_entries, &size);
if (result == DXFG_EXECUTE_SUCCESSFULLY) {
puts(" map entries:");
for (int i = 0; i < size; i++) {
printf(" [%d]: key = '%s', value = %g\n", i, map_entries[i].key, map_entries[i].value);
}
dxfg_free_string_to_double_map_entries(isolate_thread, map_entries, size);
} else {
// Use the dxfg_get_and_clear_thread_exception_t to print the stack trace.
}
int32_t dxfg_AdditionalUnderlyings_getMap(graal_isolatethread_t *thread, dxfg_additional_underlyings_t *additionalUnderlyings, DXFG_OUT dxfg_string_to_double_map_entry_t **mapEntries, DXFG_OUT int32_t *size)
int32_t dxfg_free_string_to_double_map_entries(graal_isolatethread_t *thread, dxfg_string_to_double_map_entry_t *mapEntries, int32_t size)
Frees an array of string to double map entries that a function of the SDK returned.
A map entry that consists of a string and a double: an element of an array that represents a map from...
Definition dxfg_common.h:90
Deprecated
Use dxfg_v4_AdditionalUnderlyings_getMap().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]additionalUnderlyingsThe additional underlyings handle.
[out]mapEntriesA pointer to the array of map entries ([string, double] pair).
[out]sizeA pointer to the array size.
Returns
DXFG_EXECUTE_SUCCESSFULLY (0) on successful function execution or DXFG_EXECUTE_FAIL (-1) on error. Use dxfg_get_and_clear_thread_exception_t() to determine if an exception was thrown. Use dxfg_free_string_to_double_map_entries() to free the array of map entries.
See also
https://docs.dxfeed.com/dxfeed/api/com/dxfeed/glossary/AdditionalUnderlyings.html#getMap&ndash;

◆ dxfg_AdditionalUnderlyings_getSPC()

int32_t dxfg_AdditionalUnderlyings_getSPC ( graal_isolatethread_t * thread,
const char * text,
const char * symbol,
DXFG_OUT double * spc )

Returns SPC for specified underlying symbol or 0 is specified symbol is not found. The spc will be written to the passed pointer.

Sample:

double spc = 0.0;
int32_t result = dxfg_AdditionalUnderlyings_getSPC(isolate_thread, "FIS 53; US$ 45.46", "US$", &spc);
if (result == DXFG_EXECUTE_SUCCESSFULLY) {
printf("spc = %g\n", spc); // spc = 45.46
} else {
// Use the dxfg_get_and_clear_thread_exception_t to print the stack trace.
}
int32_t dxfg_AdditionalUnderlyings_getSPC(graal_isolatethread_t *thread, const char *text, const char *symbol, DXFG_OUT double *spc)
Deprecated
Use dxfg_v4_AdditionalUnderlyings_getSPCFromText().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]textThe textual representation of the additional underlyings.
[in]symbolThe symbol by which spc will be obtained.
[out]spcThe pointer to spc.
Returns
DXFG_EXECUTE_SUCCESSFULLY (0) on successful function execution or DXFG_EXECUTE_FAIL (-1) on error. Use dxfg_get_and_clear_thread_exception_t() to determine if an exception was thrown.
See also
https://docs.dxfeed.com/dxfeed/api/com/dxfeed/glossary/AdditionalUnderlyings.html#getSPC-java.lang.String-java.lang.String-

◆ dxfg_AdditionalUnderlyings_getSPC2()

int32_t dxfg_AdditionalUnderlyings_getSPC2 ( graal_isolatethread_t * thread,
dxfg_additional_underlyings_t * additionalUnderlyings,
const char * symbol,
DXFG_OUT double * spc )

Returns SPC for specified underlying symbol or 0 is specified symbol is not found. The spc will be written to the passed pointer.

Sample:

double spc = 0.0;
int32_t result = dxfg_AdditionalUnderlyings_getSPC2(isolate_thread, additional_underlyings, "US$", &spc);
if (result == DXFG_EXECUTE_SUCCESSFULLY) {
printf("spc = %g\n", spc);
} else {
// Use the dxfg_get_and_clear_thread_exception_t to print the stack trace.
}
int32_t dxfg_AdditionalUnderlyings_getSPC2(graal_isolatethread_t *thread, dxfg_additional_underlyings_t *additionalUnderlyings, const char *symbol, DXFG_OUT double *spc)
Deprecated
Use dxfg_v4_AdditionalUnderlyings_getSPC().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]additionalUnderlyingsThe additional underlyings handle.
[in]symbolThe symbol by which spc will be obtained.
[out]spcThe pointer to spc.
Returns
DXFG_EXECUTE_SUCCESSFULLY (0) on successful function execution or DXFG_EXECUTE_FAIL (-1) on error. Use dxfg_get_and_clear_thread_exception_t() to determine if an exception was thrown.
See also
https://docs.dxfeed.com/dxfeed/api/com/dxfeed/glossary/AdditionalUnderlyings.html#getSPC-java.lang.String-

◆ dxfg_AdditionalUnderlyings_getText()

int32_t dxfg_AdditionalUnderlyings_getText ( graal_isolatethread_t * thread,
dxfg_additional_underlyings_t * additionalUnderlyings,
DXFG_OUT char ** text )

Returns textual representation of additional underlyings in the format:

TEXT ::= "" | LIST
LIST ::= AU | AU "; " LIST
AU ::= UNDERLYING " " SPC

Where UNDERLYING is a symbol of underlying instrument and SPC is a number of shares per contract of that underlying. All additional underlyings are listed in the alphabetical order of underlying symbol. In cases when option settles with additional cash the underlying symbol will specify cash symbol and SPC will specify amount of cash. The textual info will be written to the passed pointer.

Sample:

char *text = {};
int32_t result = dxfg_AdditionalUnderlyings_getText(isolate_thread, additional_underlyings, &text);
if (result == DXFG_EXECUTE_SUCCESSFULLY) {
printf(" text = %s\n", text);
dxfg_String_release(isolate_thread, text);
} else {
// Use the dxfg_get_and_clear_thread_exception_t to print the stack trace.
}
int32_t dxfg_AdditionalUnderlyings_getText(graal_isolatethread_t *thread, dxfg_additional_underlyings_t *additionalUnderlyings, DXFG_OUT char **text)
int32_t dxfg_String_release(graal_isolatethread_t *thread, const char *string)
Deprecated
Use dxfg_v4_AdditionalUnderlyings_getText().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]additionalUnderlyingsThe additional underlyings handle.
[out]textA pointer to the textual representation of the additional underlyings.
Returns
DXFG_EXECUTE_SUCCESSFULLY (0) on successful function execution or DXFG_EXECUTE_FAIL (-1) on error. Use dxfg_get_and_clear_thread_exception_t() to determine if an exception was thrown. Use dxfg_String_release() to free the textual representation.
See also
https://docs.dxfeed.com/dxfeed/api/com/dxfeed/glossary/AdditionalUnderlyings.html#getText&ndash;

◆ dxfg_AdditionalUnderlyings_valueOf()

int32_t dxfg_AdditionalUnderlyings_valueOf ( graal_isolatethread_t * thread,
const char * text,
DXFG_OUT dxfg_additional_underlyings_t ** additionalUnderlyings )

Returns an instance of additional underlyings for specified textual representation. The handle of this instance will be written to the passed pointer.

See dxfg_AdditionalUnderlyings_getText() for format specification.

Sample:

dxfg_additional_underlyings_t* additional_underlyings = {};
int32_t result = dxfg_AdditionalUnderlyings_valueOf(isolate_thread, "FIS 53; US$ 45.46", &additional_underlyings);
if (result == DXFG_EXECUTE_SUCCESSFULLY) {
// Do some work with additionalUnderlyings
// Release
dxfg_JavaObjectHandler_release(isolate_thread, &additional_underlyings->handler);
} else {
// Use the dxfg_get_and_clear_thread_exception_t to print the stack trace.
}
int32_t dxfg_AdditionalUnderlyings_valueOf(graal_isolatethread_t *thread, const char *text, DXFG_OUT dxfg_additional_underlyings_t **additionalUnderlyings)
Deprecated
Use dxfg_v4_AdditionalUnderlyings_valueOf().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]textThe textual representation.
[out]additionalUnderlyingsThe pointer to result's handle (additional underlyings for specified textual representation)
Returns
DXFG_EXECUTE_SUCCESSFULLY (0) on successful function execution or DXFG_EXECUTE_FAIL (-1) on error. Use dxfg_get_and_clear_thread_exception_t() to determine if an exception was thrown. Use dxfg_JavaObjectHandler_release() to free the additional underlyings handle.
See also
https://docs.dxfeed.com/dxfeed/api/com/dxfeed/glossary/AdditionalUnderlyings.html#valueOf-java.lang.String-

◆ dxfg_AdditionalUnderlyings_valueOf2()

int32_t dxfg_AdditionalUnderlyings_valueOf2 ( graal_isolatethread_t * thread,
const dxfg_string_to_double_map_entry_t * mapEntries,
int32_t size,
DXFG_OUT dxfg_additional_underlyings_t ** additionalUnderlyings )

Returns an instance of additional underlyings for specified internal representation. The handle of this instance will be written to the passed pointer.

Sample:

dxfg_string_to_double_map_entry_t map_entries[] = {{"FIS", 53}, {"US$", 45.46}, {"ABC", 123}};
dxfg_additional_underlyings_t* additional_underlyings = {};
int32_t result = dxfg_AdditionalUnderlyings_valueOf2(isolate_thread, map_entries,
sizeof(map_entries) / sizeof(map_entries[0]),
&additional_underlyings);
if (result == DXFG_EXECUTE_SUCCESSFULLY) {
// Do some work with additionalUnderlyings
// Release
dxfg_JavaObjectHandler_release(isolate_thread, &additional_underlyings->handler);
} else {
// Use the dxfg_get_and_clear_thread_exception_t to print the stack trace.
}
int32_t dxfg_AdditionalUnderlyings_valueOf2(graal_isolatethread_t *thread, const dxfg_string_to_double_map_entry_t *mapEntries, int32_t size, DXFG_OUT dxfg_additional_underlyings_t **additionalUnderlyings)
Deprecated
Use dxfg_v4_AdditionalUnderlyings_valueOfMap().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]mapEntriesThe array of map entries ([string, double] pair).
[in]sizeA size of the array.
[out]additionalUnderlyingsThe pointer to result's handle (additional underlyings for specified internal representation)
Returns
DXFG_EXECUTE_SUCCESSFULLY (0) on successful function execution or DXFG_EXECUTE_FAIL (-1) on error. Use dxfg_get_and_clear_thread_exception_t() to determine if an exception was thrown. Use dxfg_JavaObjectHandler_release() to free the additional underlyings handle.
See also
https://docs.dxfeed.com/dxfeed/api/com/dxfeed/glossary/AdditionalUnderlyings.html#valueOf-java.util.Map-