dxFeed Graal CXX API v5.0.0
Loading...
Searching...
No Matches
Conf.hpp
1// Copyright (c) 2025 Devexperts LLC.
2// SPDX-License-Identifier: MPL-2.0
3
4#pragma once
5
6#ifdef _WIN32
7# ifndef NOMINMAX
8# define NOMINMAX
9# endif
10# ifndef WIN32_LEAN_AND_MEAN
11# define WIN32_LEAN_AND_MEAN
12# endif
13#endif
14
15#ifdef _WINNT_
16# error Please, include windows.h or winnt.h after dxFeed Graal CXX API headers
17#endif
18
19#ifndef DXFCXX_VERSION
20# define DXFCXX_VERSION "0.0.0"
21#endif
22
23#if defined(_MSC_VER)
24# ifndef DXFCXX_DISABLE_MSC_WARNINGS_PUSH
25# define DXFCXX_DISABLE_MSC_WARNINGS_PUSH(...) __pragma(warning(push)) __pragma(warning(disable : __VA_ARGS__))
26# define DXFCXX_DISABLE_MSC_WARNINGS_POP() __pragma(warning(pop))
27# endif
28#else
29# ifndef DXFCXX_DISABLE_MSC_WARNINGS_PUSH
30# define DXFCXX_DISABLE_MSC_WARNINGS_PUSH(warnings)
31# define DXFCXX_DISABLE_MSC_WARNINGS_POP()
32# endif
33#endif
34
35#if defined(__GNUC__) && !defined(__clang__) && !defined(__INTEL_COMPILER) && !defined(__NVCOMPILER)
36# ifndef DXFCXX_DO_PRAGMA
37# define DXFCXX_DO_PRAGMA(x) _Pragma(#x)
38# endif
39# ifndef DXFCXX_DISABLE_GCC_WARNINGS_PUSH
40# define DXFCXX_DISABLE_GCC_WARNINGS_PUSH(...)
41 DXFCXX_DO_PRAGMA(GCC diagnostic push) DXFCXX_DO_PRAGMA(GCC diagnostic ignored __VA_ARGS__)
42# define DXFCXX_DISABLE_GCC_WARNINGS(...) DXFCXX_DO_PRAGMA(GCC diagnostic ignored __VA_ARGS__)
43# define DXFCXX_DISABLE_GCC_WARNINGS_POP() DXFCXX_DO_PRAGMA(GCC diagnostic pop)
44# endif
45#else
46# ifndef DXFCXX_DISABLE_GCC_WARNINGS_PUSH
47# define DXFCXX_DISABLE_GCC_WARNINGS_PUSH(warnings)
48# define DXFCXX_DISABLE_GCC_WARNINGS(warnings)
49# define DXFCXX_DISABLE_GCC_WARNINGS_POP()
50# endif
51#endif
52
53#if !defined(_MSC_VER) && defined(__clang__) && !defined(__INTEL_COMPILER) && !defined(__NVCOMPILER)
54# ifndef DXFCXX_DO_PRAGMA
55# define DXFCXX_DO_PRAGMA(x) _Pragma(#x)
56# endif
57# ifndef DXFCXX_DISABLE_CLANG_WARNINGS_PUSH
58# define DXFCXX_DISABLE_CLANG_WARNINGS_PUSH(...)
59 DXFCXX_DO_PRAGMA(GCC diagnostic push) DXFCXX_DO_PRAGMA(GCC diagnostic ignored __VA_ARGS__)
60# define DXFCXX_DISABLE_CLANG_WARNINGS(...) DXFCXX_DO_PRAGMA(GCC diagnostic ignored __VA_ARGS__)
61# define DXFCXX_DISABLE_CLANG_WARNINGS_POP() DXFCXX_DO_PRAGMA(GCC diagnostic pop)
62# endif
63#else
64# ifndef DXFCXX_DISABLE_CLANG_WARNINGS_PUSH
65# define DXFCXX_DISABLE_CLANG_WARNINGS_PUSH(warnings)
66# define DXFCXX_DISABLE_CLANG_WARNINGS(warnings)
67# define DXFCXX_DISABLE_CLANG_WARNINGS_POP()
68# endif
69#endif
70
71#ifndef DXFCPP_EXPORT
72# if defined(DXFCPP_USE_DLLS) && defined(_MSC_VER)
73# if defined(LIBDXFCPP_EXPORTS)
74# define DXFCPP_EXPORT __declspec(dllexport)
75# define DXFCPP_EXPORT_TEMPLATE_DECLARE
76# define DXFCPP_EXPORT_TEMPLATE_DEFINE __declspec(dllexport)
77# else
78# define DXFCPP_EXPORT __declspec(dllimport)
79# define DXFCPP_EXPORT_TEMPLATE_DECLARE
80# define DXFCPP_EXPORT_TEMPLATE_DEFINE __declspec(dllimport)
81# endif // defined(LIBDXFCPP_EXPORTS)
82# elif defined(DXFCPP_USE_DLLS) && defined(LIBDXFCPP_EXPORTS)
83# define DXFCPP_EXPORT __attribute__((visibility("default")))
84# define DXFCPP_EXPORT_TEMPLATE_DECLARE __attribute__((visibility("default")))
85# define DXFCPP_EXPORT_TEMPLATE_DEFINE
86# else
87# define DXFCPP_EXPORT
88# define DXFCPP_EXPORT_TEMPLATE_DECLARE
89# define DXFCPP_EXPORT_TEMPLATE_DEFINE
90# endif
91#endif
92
93#ifndef DXFCPP_BEGIN_NAMESPACE
94# define DXFCPP_BEGIN_NAMESPACE
95 namespace dxfcpp {
96 inline namespace v5 {
97# define DXFCPP_END_NAMESPACE
98 }
99 }
100#endif
101
102// #ifdef __has_include
103// # if __has_include(<ciso646> )
104// # include <ciso646>
105// # elif __has_include(<iso646.h>)
106// # include <iso646.h>
107// # endif
108// #else
109// # include <ciso646>
110// #endif
111
113
114#if defined(__clang__)
115constexpr bool isClangFlavouredCompiler = true;
116#else
117constexpr bool isClangFlavouredCompiler = false;
118#endif
119
120#ifdef _LIBCPP_VERSION
121constexpr bool isLibCPP = true;
122constexpr bool isLibCXX = false;
123constexpr bool isMSSTL = false;
124constexpr bool isUnknownSTL = false;
125#elif __GLIBCXX__ // Note: only version 6.1 or newer define this in ciso646
126constexpr bool isLibCPP = false;
127constexpr bool isLibCXX = true;
128constexpr bool isMSSTL = false;
129constexpr bool isUnknownSTL = false;
130#elif _CPPLIB_VER // Note: used by Visual Studio
131constexpr bool isLibCPP = false;
132constexpr bool isLibCXX = false;
133constexpr bool isMSSTL = true;
134constexpr bool isUnknownSTL = false;
135#else
136constexpr bool isLibCPP = false;
137constexpr bool isLibCXX = false;
138constexpr bool isMSSTL = false;
139constexpr bool isUnknownSTL = true;
140#endif
141
142#ifndef DXFCPP_CXX20_CONSTEXPR_STRING
143# if defined(__cpp_lib_constexpr_string) &&
144 ((defined(__GNUC__) && __GNUC__ >= 12) || (defined(__clang_major__) && __clang_major__ >= 15) ||
145 (defined(_MSC_VER) && _MSC_VER >= 1929))
146# define DXFCPP_CXX20_CONSTEXPR_STRING constexpr
147# else
148# define DXFCPP_CXX20_CONSTEXPR_STRING
149# endif
150#endif
151
#define DXFCXX_DISABLE_MSC_WARNINGS_POP()
Definition Conf.hpp:31
#define DXFCPP_END_NAMESPACE
Definition Conf.hpp:97
#define DXFCPP_BEGIN_NAMESPACE
Definition Conf.hpp:94
#define DXFCXX_DISABLE_MSC_WARNINGS_PUSH(warnings)
Definition Conf.hpp:30
DXFCPP_EXPORT dxfc_error_code_t dxfc_dxendpoint_builder_with_name(dxfc_dxendpoint_builder_t builderHandle, const char *name)
Changes the name used to distinguish multiple endpoints in the same process (GraalVM Isolate) in logs...
Definition DXEndpoint.cpp:680
DXFCPP_EXPORT dxfc_error_code_t dxfc_dxendpoint_builder_with_properties(dxfc_dxendpoint_builder_t builder, const dxfc_dxendpoint_property_t **properties, size_t size)
Sets all supported properties from the provided properties object.
Definition DXEndpoint.cpp:713
DXFCPP_EXPORT dxfc_error_code_t dxfc_dxendpoint_password(dxfc_dxendpoint_t endpoint, const char *password)
Changes password for this endpoint.
Definition DXEndpoint.cpp:961
DXFCPP_EXPORT dxfc_error_code_t dxfc_dxendpoint_get_publisher(dxfc_dxendpoint_t endpoint, DXFC_OUT dxfc_dxpublisher_t *publisher)
Definition DXEndpoint.cpp:1151
DXFCPP_EXPORT dxfc_error_code_t dxfc_dxendpoint_builder_supports_property(dxfc_dxendpoint_builder_t builder, const char *key, DXFC_OUT int *supports)
Checks if a property is supported.
Definition DXEndpoint.cpp:740
DXFCPP_EXPORT dxfc_error_code_t dxfc_dxendpoint_add_state_change_listener(dxfc_dxendpoint_t endpoint, dxfc_dxendpoint_state_change_listener listener)
Adds a listener notified about changes in state property.
Definition DXEndpoint.cpp:1097
DXFCPP_EXPORT dxfc_error_code_t dxfc_dxendpoint_disconnect(dxfc_dxendpoint_t endpoint)
Terminates all remote network connections.
Definition DXEndpoint.cpp:1012
#define DXFCPP_EXPORT
Definition api.h:35
void * dxfc_dxendpoint_builder_t
The dxFeed endpoint's builder handle.
Definition api.h:207
DXFCPP_EXPORT dxfc_error_code_t dxfc_dxendpoint_close_and_await_termination(dxfc_dxendpoint_t endpoint)
Closes this endpoint and wait until all pending data processing tasks are completed.
Definition DXEndpoint.cpp:910
DXFCPP_EXPORT dxfc_error_code_t dxfc_dxendpoint_await_not_connected(dxfc_dxendpoint_t endpoint)
Waits while this endpoint state becomes NOT_CONNECTED or CLOSED.
Definition DXEndpoint.cpp:1063
dxfc_dxendpoint_state_t
Represents the current state of endpoint.
Definition api.h:149
@ DXFC_DXENDPOINT_STATE_CLOSED
Endpoint was closed.
Definition api.h:169
@ DXFC_DXENDPOINT_STATE_NOT_CONNECTED
Endpoint was created by is not connected to remote endpoints.
Definition api.h:153
@ DXFC_DXENDPOINT_STATE_CONNECTING
The connect function was called to establish connection to remove endpoint, but the connection is not...
Definition api.h:159
@ DXFC_DXENDPOINT_STATE_CONNECTED
The connection to the remote endpoint is established.
Definition api.h:164
DXFCPP_EXPORT dxfc_error_code_t dxfc_dxendpoint_get_instance(void *user_data, DXFC_OUT dxfc_dxendpoint_t *endpoint)
Returns a default application-wide singleton instance of dxFeed endpoint with a FEED role.
Definition DXEndpoint.cpp:799
#define DXFC_OUT
Definition api.h:17
DXFCPP_EXPORT dxfc_error_code_t dxfc_dxendpoint_get_state(dxfc_dxendpoint_t endpoint, DXFC_OUT dxfc_dxendpoint_state_t *state)
Returns the state of this endpoint.
Definition DXEndpoint.cpp:1080
void * dxfc_dxendpoint_t
The dxFeed endpoint handle.
Definition api.h:198
DXFCPP_EXPORT dxfc_error_code_t dxfc_dxendpoint_builder_with_property(dxfc_dxendpoint_builder_t builder, const char *key, const char *value)
Sets the specified property.
Definition DXEndpoint.cpp:696
DXFCPP_EXPORT dxfc_error_code_t dxfc_dxendpoint_builder_free(dxfc_dxendpoint_builder_t builder)
Removes a builder from the registry.
Definition DXEndpoint.cpp:787
DXFCPP_EXPORT dxfc_error_code_t dxfc_dxendpoint_connect(dxfc_dxendpoint_t endpoint, const char *address)
Connects to the specified remote address.
Definition DXEndpoint.cpp:978
dxfc_error_code_t
List of error codes.
Definition api.h:49
@ DXFC_EC_ERROR
The error returned if the current operation cannot be completed.
Definition api.h:60
@ DXFC_EC_SUCCESS
OK.
Definition api.h:53
@ DXFC_EC_G_ERR
dxFeed Graal Native API error.
Definition api.h:57
DXFCPP_EXPORT dxfc_error_code_t dxfc_dxendpoint_remove_state_change_listener(dxfc_dxendpoint_t endpoint, dxfc_dxendpoint_state_change_listener listener)
Removes a listener notified about changes in state property.
Definition DXEndpoint.cpp:1123
DXFCPP_EXPORT dxfc_error_code_t dxfc_system_set_property(const char *key, const char *value)
Sets the system property indicated by the specified key.
Definition System.cpp:73
DXFCPP_EXPORT dxfc_error_code_t dxfc_dxendpoint_builder_build(dxfc_dxendpoint_builder_t builder, void *user_data, DXFC_OUT dxfc_dxendpoint_t *endpoint)
Builds the new dxFeed endpoint instance.
Definition DXEndpoint.cpp:757
DXFCPP_EXPORT dxfc_error_code_t dxfc_dxendpoint_get_feed(dxfc_dxendpoint_t endpoint, DXFC_OUT dxfc_dxfeed_t *feed)
Definition DXEndpoint.cpp:1146
DXFCPP_EXPORT dxfc_error_code_t dxfc_dxendpoint_await_processed(dxfc_dxendpoint_t endpoint)
Waits until this endpoint stops processing data (becomes quiescent).
Definition DXEndpoint.cpp:1046
DXFCPP_EXPORT dxfc_error_code_t dxfc_dxendpoint_close(dxfc_dxendpoint_t endpoint)
Closes this endpoint.
Definition DXEndpoint.cpp:893
DXFCPP_EXPORT dxfc_error_code_t dxfc_dxendpoint_new_builder(DXFC_OUT dxfc_dxendpoint_builder_t *builder)
Creates a new dxFeed endpoint's builder instance.
Definition DXEndpoint.cpp:647
void(* dxfc_dxendpoint_state_change_listener)(dxfc_dxendpoint_state_t old_state, dxfc_dxendpoint_state_t new_state, void *user_data)
The endpoint current state change listener.
Definition api.h:178
DXFCPP_EXPORT dxfc_error_code_t dxfc_dxendpoint_reconnect(dxfc_dxendpoint_t endpoint)
Terminates all established network connections and initiates connecting again with the same address.
Definition DXEndpoint.cpp:995
DXFCPP_EXPORT dxfc_error_code_t dxfc_dxendpoint_get_role(dxfc_dxendpoint_t endpoint, DXFC_OUT dxfc_dxendpoint_role_t *role)
Returns the role of this endpoint.
Definition DXEndpoint.cpp:927
DXFCPP_EXPORT dxfc_error_code_t dxfc_dxendpoint_user(dxfc_dxendpoint_t endpoint, const char *user)
Changes username for this endpoint.
Definition DXEndpoint.cpp:944
DXFCPP_EXPORT dxfc_error_code_t dxfc_system_get_property(const char *key, DXFC_OUT char *buffer, size_t buffer_size)
Gets the system property indicated by the specified key.
dxfc_dxendpoint_role_t
Represents the role of an endpoint that was specified during its creation.
Definition api.h:89
@ DXFC_DXENDPOINT_ROLE_PUBLISHER
PUBLISHER endpoint connects to the remote publisher hub (also known as multiplexor) or creates a publ...
Definition api.h:127
@ DXFC_DXENDPOINT_ROLE_STREAM_FEED
STREAM_FEED endpoint is similar to DXFC_DXENDPOINT_ROLE_FEED and also connects to the remote data fee...
Definition api.h:116
@ DXFC_DXENDPOINT_ROLE_FEED
FEED endpoint connects to the remote data feed provider and is optimized for real-time or delayed dat...
Definition api.h:99
@ DXFC_DXENDPOINT_ROLE_STREAM_PUBLISHER
STREAM_PUBLISHER endpoint is similar to DXFC_DXENDPOINT_ROLE_PUBLISHER and also connects to the remot...
Definition api.h:136
@ DXFC_DXENDPOINT_ROLE_LOCAL_HUB
LOCAL_HUB endpoint is a local hub without the ability to establish network connections.
Definition api.h:143
@ DXFC_DXENDPOINT_ROLE_ON_DEMAND_FEED
ON_DEMAND_FEED endpoint is similar to DXFC_DXENDPOINT_ROLE_FEED, but it is designed to be used with d...
Definition api.h:107
void * dxfc_dxpublisher_t
The dxFeed publisher handle.
Definition api.h:217
DXFCPP_EXPORT dxfc_error_code_t dxfc_dxendpoint_create(void *user_data, DXFC_OUT dxfc_dxendpoint_t *endpoint)
Creates an endpoint with FEED role.
Definition DXEndpoint.cpp:846
DXFCPP_EXPORT dxfc_error_code_t dxfc_dxendpoint_get_instance2(dxfc_dxendpoint_role_t role, void *user_data, DXFC_OUT dxfc_dxendpoint_t *endpoint)
Returns a default application-wide singleton instance of DXEndpoint for a specific role.
Definition DXEndpoint.cpp:822
void * dxfc_dxfeed_t
The dxFeed handle.
Definition api.h:212
DXFCPP_EXPORT dxfc_error_code_t dxfc_dxendpoint_builder_with_role(dxfc_dxendpoint_builder_t builder, dxfc_dxendpoint_role_t role)
Sets role for the created dxFeed endpoint.
Definition DXEndpoint.cpp:663
DXFCPP_EXPORT dxfc_error_code_t dxfc_dxendpoint_create2(dxfc_dxendpoint_role_t role, void *user_data, DXFC_OUT dxfc_dxendpoint_t *endpoint)
Creates an endpoint with a specified role.
Definition DXEndpoint.cpp:869
DXFCPP_EXPORT dxfc_error_code_t dxfc_dxendpoint_free(dxfc_dxendpoint_t endpoint)
Removes the dxFeed endpoint from the registry.
Definition DXEndpoint.cpp:1156
DXFCPP_EXPORT dxfc_error_code_t dxfc_dxendpoint_disconnect_and_clear(dxfc_dxendpoint_t endpoint)
Terminates all remote network connections and clears stored data.
Definition DXEndpoint.cpp:1029
Marks all event types that can be received via dxFeed API.
Definition EventType.hpp:31
A base abstract "shared entity" class. Has some helpers for dynamic polymorphism.
Definition SharedEntity.hpp:20
The simple key-value structure that represents an endpoint's property.
Definition api.h:184
const char * key
The property's key.
Definition api.h:186
const char * value
The property's value.
Definition api.h:188