dxFeed Graal CXX API v4.2.1
Loading...
Searching...
No Matches
OrderSource.hpp
1// Copyright (c) 2025 Devexperts LLC.
2// SPDX-License-Identifier: MPL-2.0
3
4#pragma once
5
6#include "../../internal/Conf.hpp"
7
9
10#include <cstdint>
11#include <memory>
12#include <mutex>
13#include <string>
14#include <unordered_map>
15
16#include "../EventTypeEnum.hpp"
17#include "../IndexedEventSource.hpp"
18
20
21struct EventSourceWrapper;
22
23/**
24 * Identifies source of Order, AnalyticOrder, OtcMarketsOrder and SpreadOrder events.
25 * There are the following kinds of order sources:
26 * <ul>
27 * <li><em>Synthetic</em> sources OrderSource::COMPOSITE_BID, OrderSource::COMPOSITE_ASK,
28 * OrderSource::REGIONAL_BID, and OrderSource::REGIONAL_ASK are provided for convenience of a consolidated
29 * order book and are automatically generated based on the corresponding Quote events.
30 * <li><em>Aggregate</em> sources OrderSource::AGGREGATE_BID and OrderSource::AGGREGATE_ASK provide
31 * futures depth (aggregated by price level) and NASDAQ Level II (top of book for each market maker).
32 * These source cannot be directly published to via dxFeed API.
33 * <li><em>Publishable</em> sources OrderSource::DEFAULT, OrderSource::NTV, OrderSource::ISE etc
34 * support full range of dxFeed API features.
35 * </ul>
36 */
37class DXFCPP_EXPORT OrderSource final : public IndexedEventSource {
38 friend struct EventSourceWrapper;
39
40 static constexpr std::uint32_t PUB_ORDER = 0x0001U;
41 static constexpr std::uint32_t PUB_ANALYTIC_ORDER = 0x0002U;
42 static constexpr std::uint32_t PUB_OTC_MARKETS_ORDER = 0x0004;
43 static constexpr std::uint32_t PUB_SPREAD_ORDER = 0x0008U;
44 static constexpr std::uint32_t FULL_ORDER_BOOK = 0x0010U;
45 static constexpr std::uint32_t PUB_NUAM_ORDER = 0x0020U;
46
47 static constexpr std::uint32_t FLAGS_SIZE = 6U;
48
49 public:
50 static const std::unordered_map<std::variant<std::int32_t, std::string>, std::reference_wrapper<const OrderSource>>
51 PREDEFINED_SOURCES;
52
53 private:
54 static inline std::mutex MTX_{};
55 static std::unordered_map<std::int32_t, OrderSource> USER_SOURCES_;
56
57 std::uint32_t pubFlags_{};
58 bool builtin_{};
59
60 OrderSource(std::int32_t id, std::string name, std::uint32_t pubFlags) noexcept;
61
62 OrderSource(const std::string &name, std::uint32_t pubFlags);
63
64 OrderSource(std::int32_t id, const std::string &name) noexcept;
65
66 static std::int32_t composeId(const std::string &name);
67
68 static void checkChar(char c);
69
70 static std::string decodeName(std::int32_t id);
71
72 static std::uint32_t getEventTypeMask(const EventTypeEnum &eventType);
73
74 /**
75 * Allocates memory for the dxFeed Graal SDK structure (recursively if necessary).
76 * Fills the dxFeed Graal SDK structure's fields by the data of the current entity (recursively if necessary).
77 * Returns the pointer to the filled structure.
78 *
79 * @return The pointer to the filled dxFeed Graal SDK structure
80 */
81 void *toGraal() const override;
82
83 std::unique_ptr<void, decltype(&IndexedEventSource::freeGraal)> toGraalUnique() const noexcept override;
84
85 public:
86 /**
87 * Bid side of a composite Quote.
88 * It is a <em>synthetic</em> source.
89 * It cannot be used with DXFeed::getIndexedEventsPromise method and it cannot be published directly to.
90 * The subscription on composite Quote event is observed when this source is subscribed to.
91 * @deprecated Use the OrderSource::COMPOSITE source.
92 */
93 static const OrderSource COMPOSITE_BID;
94
95 /**
96 * Ask side of a composite Quote.
97 * It is a <em>synthetic</em> and <em>separate</em> source.
98 * It cannot be used with DXFeed::getIndexedEventsPromise method and it cannot be published directly to.
99 * The subscription on composite Quote event is observed when this source is subscribed to.
100 * @deprecated Use the OrderSource::COMPOSITE source.
101 */
102 static const OrderSource COMPOSITE_ASK;
103
104 /**
105 * Bid side of a regional Quote.
106 * It is a <em>synthetic</em> and <em>separate</em> source.
107 * It cannot be used with DXFeed::getIndexedEventsPromise method and it cannot be published directly to.
108 * The subscription on regional Quote event is observed when this source is subscribed to.
109 * @deprecated Use the OrderSource::REGIONAL source.
110 */
111 static const OrderSource REGIONAL_BID;
112
113 /**
114 * Ask side of a regional Quote.
115 * It is a <em>synthetic</em> and <em>separate</em> source.
116 * It cannot be used with DXFeed::getIndexedEventsPromise method and it cannot be published directly to.
117 * The subscription on regional Quote event is observed when this source is subscribed to.
118 * @deprecated Use the OrderSource::REGIONAL source.
119 */
120 static const OrderSource REGIONAL_ASK;
121
122 /**
123 * Bid side of an aggregate order book (futures depth and NASDAQ Level II).
124 * It is a <em>aggregate</em> and <em>separate</em> source.
125 * This source cannot be directly published via dxFeed API, but otherwise it is fully operational.
126 * @deprecated Use the OrderSource::AGGREGATE source.
127 */
128 static const OrderSource AGGREGATE_BID;
129
130 /**
131 * Ask side of an aggregate order book (futures depth and NASDAQ Level II).
132 * It is a <em>aggregate</em> and <em>separate</em> source.
133 * This source cannot be directly published via dxFeed API, but otherwise it is fully operational.
134 * @deprecated Use the OrderSource::AGGREGATE source.
135 */
136 static const OrderSource AGGREGATE_ASK;
137
138 /**
139 * Composite Quote.
140 * It is a <em>synthetic</em> and <em>unitary</em> source, that represents both bid and ask side.
141 * It cannot be used with DXFeed::getIndexedEventsPromise method and it cannot be published directly to.
142 * The subscription on composite Quote event is observed when this source is subscribed to.
143 * To use this source when subscribing to all sources (e.g., when subscribing to an order without specifying a
144 * source), instead of OrderSource::COMPOSITE_ASK and OrderSource::COMPOSITE_BID, set the system property
145 * <b>`dxscheme.unitaryOrderSource`</b> to `true`.
146 */
147 static const OrderSource COMPOSITE;
148
149 /**
150 * Regional Quote.
151 * It is a <em>synthetic</em> and <em>unitary</em> source, that represents both bid and ask side.
152 * It cannot be used with DXFeed::getIndexedEventsPromise method and it cannot be published directly to.
153 * The subscription on regional Quote event is observed when this source is subscribed to.
154 * To use this source when subscribing to all sources (e.g., when subscribing to an order without specifying a
155 * source), instead of OrderSource::REGIONAL_ASK and OrderSource::REGIONAL_BID, set the system property
156 * <b>`dxscheme.unitaryOrderSource`</b> to `true`.
157 */
158 static const OrderSource REGIONAL;
159
160 /**
161 * Aggregate order book (futures depth and NASDAQ Level II).
162 * It is a <em>aggregate</em> and <em>unitary</em> source, that represents both bid and ask side.
163 * This source cannot be directly published via dxFeed API, but otherwise it is fully operational.
164 * To use this source when subscribing to all sources (e.g., when subscribing to an order without specifying a
165 * source), instead of OrderSource::AGGREGATE_ASK and OrderSource::AGGREGATE_BID, set the system property
166 * <b>`dxscheme.unitaryOrderSource`</b> to `true`.
167 */
168 static const OrderSource AGGREGATE;
169
170 /**
171 * Default source for publishing custom order books.
172 * Order, AnalyticOrder, OtcMarketsOrder and SpreadOrder events are @ref ::isPublishable() "publishable"
173 * on this source and the corresponding subscription can be observed via DXPublisher.
174 */
175 static const OrderSource DEFAULT;
176
177 /**
178 * NASDAQ Total View.
179 *
180 * Order events are @ref ::isPublishable() "publishable" on this source and the corresponding subscription can be
181 * observed via DXPublisher.
182 */
183 static const OrderSource NTV;
184
185 /**
186 * NASDAQ Total View. Record for price level book.
187 *
188 * Order events are @ref ::isPublishable() "publishable" on this source and the corresponding subscription can be
189 * observed via DXPublisher.
190 */
191 static const OrderSource ntv;
192
193 /**
194 * NASDAQ Futures Exchange.
195 *
196 * Order events are @ref ::isPublishable() "publishable" on this source and the corresponding subscription can be
197 * observed via DXPublisher.
198 */
199 static const OrderSource NFX;
200
201 /**
202 * NASDAQ eSpeed.
203 *
204 * Order events are @ref ::isPublishable() "publishable" on this source and the corresponding subscription can be
205 * observed via DXPublisher.
206 */
207 static const OrderSource ESPD;
208
209 /**
210 * NASDAQ Fixed Income.
211 *
212 * Order events are @ref ::isPublishable() "publishable" on this source and the corresponding subscription can be
213 * observed via DXPublisher.
214 */
215 static const OrderSource XNFI;
216
217 /**
218 * Intercontinental Exchange.
219 *
220 * Order events are @ref ::isPublishable() "publishable" on this source and the corresponding subscription can be
221 * observed via DXPublisher.
222 */
223 static const OrderSource ICE;
224
225 /**
226 * International Securities Exchange.
227 *
228 * Order and SpreadOrder events are @ref ::isPublishable() "publishable" on this source and the corresponding
229 * subscription can be observed via DXPublisher.
230 */
231 static const OrderSource ISE;
232
233 /**
234 * Direct-Edge EDGA Exchange.
235 *
236 * Order events are @ref ::isPublishable() "publishable" on this source and the corresponding subscription can be
237 * observed via DXPublisher.
238 */
239 static const OrderSource DEA;
240
241 /**
242 * Direct-Edge EDGX Exchange.
243 *
244 * Order events are @ref ::isPublishable() "publishable" on this source and the corresponding subscription can be
245 * observed via DXPublisher.
246 */
247 static const OrderSource DEX;
248
249 /**
250 * Direct-Edge EDGX Exchange. Record for price level book.
251 *
252 * Order events are @ref ::isPublishable() "publishable" on this source and the corresponding subscription can be
253 * observed via DXPublisher.
254 */
255
256 static const OrderSource dex;
257
258 /**
259 * Bats BYX Exchange.
260 *
261 * Order events are @ref ::isPublishable() "publishable" on this source and the corresponding subscription can be
262 * observed via DXPublisher.
263 */
264 static const OrderSource BYX;
265
266 /**
267 * Bats BZX Exchange.
268 *
269 * Order events are @ref ::isPublishable() "publishable" on this source and the corresponding subscription can be
270 * observed via DXPublisher.
271 */
272 static const OrderSource BZX;
273
274 /**
275 * Bats BZX Exchange. Record for price level book.
276 *
277 * Order events are @ref ::isPublishable() "publishable" on this source and the corresponding subscription can be
278 * observed via DXPublisher.
279 */
280 static const OrderSource bzx;
281
282 /**
283 * Bats Europe BXE Exchange.
284 *
285 * Order events are @ref ::isPublishable() "publishable" on this source and the corresponding subscription can be
286 * observed via DXPublisher.
287 */
288 static const OrderSource BATE;
289
290 /**
291 * Bats Europe CXE Exchange.
292 *
293 * Order events are @ref ::isPublishable() "publishable" on this source and the corresponding subscription can be
294 * observed via DXPublisher.
295 */
296 static const OrderSource CHIX;
297
298 /**
299 * Bats Europe DXE Exchange.
300 *
301 * Order events are @ref ::isPublishable() "publishable" on this source and the corresponding subscription can be
302 * observed via DXPublisher.
303 */
304 static const OrderSource CEUX;
305
306 /**
307 * Bats Europe TRF.
308 *
309 * Order events are @ref ::isPublishable() "publishable" on this source and the corresponding subscription can be
310 * observed via DXPublisher.
311 */
312 static const OrderSource BXTR;
313
314 /**
315 * Borsa Istanbul Exchange.
316 *
317 * Order events are @ref ::isPublishable() "publishable" on this source and the corresponding subscription can be
318 * observed via DXPublisher.
319 */
320 static const OrderSource IST;
321
322 /**
323 * Borsa Istanbul Exchange. Record for particular top 20 order book.
324 *
325 * Order events are @ref ::isPublishable() "publishable" on this source and the corresponding subscription can be
326 * observed via DXPublisher.
327 */
328 static const OrderSource BI20;
329
330 /**
331 * ABE (abe.io) exchange.
332 *
333 * Order events are @ref ::isPublishable() "publishable" on this source and the corresponding subscription can be
334 * observed via DXPublisher.
335 */
336 static const OrderSource ABE;
337
338 /**
339 * FAIR (FairX) exchange.
340 *
341 * Order events are @ref ::isPublishable() "publishable" on this source and the corresponding subscription can be
342 * observed via DXPublisher.
343 */
344 static const OrderSource FAIR;
345
346 /**
347 * CME Globex.
348 *
349 * Order and AnalyticOrder events are @ref ::isPublishable() "publishable" on this source and the corresponding
350 * subscription can be observed via DXPublisher.
351 */
352 static const OrderSource GLBX;
353
354 /**
355 * CME Globex. Record for price level book.
356 *
357 * Order events are @ref ::isPublishable() "publishable" on this source and the corresponding subscription can be
358 * observed via DXPublisher.
359 */
360 static const OrderSource glbx;
361
362 /**
363 * Eris Exchange group of companies.
364 *
365 * Order events are @ref ::isPublishable() "publishable" on this source and the corresponding subscription can be
366 * observed via DXPublisher.
367 */
368 static const OrderSource ERIS;
369
370 /**
371 * Eurex Exchange.
372 *
373 * Order events are @ref ::isPublishable() "publishable" on this source and the corresponding subscription can be
374 * observed via DXPublisher.
375 */
376 static const OrderSource XEUR;
377
378 /**
379 * Eurex Exchange. Record for price level book.
380 *
381 * Order events are @ref ::isPublishable() "publishable" on this source and the corresponding subscription can be
382 * observed via DXPublisher.
383 */
384 static const OrderSource xeur;
385
386 /**
387 * CBOE Futures Exchange.
388 *
389 * Order events are @ref ::isPublishable() "publishable" on this source and the corresponding subscription can be
390 * observed via DXPublisher.
391 */
392 static const OrderSource CFE;
393
394 /**
395 * CBOE Options C2 Exchange.
396 *
397 * Order events are @ref ::isPublishable() "publishable" on this source and the corresponding subscription can be
398 * observed via DXPublisher.
399 */
400 static const OrderSource C2OX;
401
402 /**
403 * Small Exchange.
404 *
405 * Order events are @ref ::isPublishable() "publishable" on this source and the corresponding subscription can be
406 * observed via DXPublisher.
407 */
408 static const OrderSource SMFE;
409
410 /**
411 * Small Exchange. Record for price level book.
412 *
413 * Order events are @ref ::isPublishable() "publishable" on this source and the corresponding subscription can be
414 * observed via DXPublisher.
415 */
416 static const OrderSource smfe;
417
418 /**
419 * Investors exchange. Record for price level book.
420 *
421 * Order events are @ref ::isPublishable() "publishable" on this source and the corresponding subscription can be
422 * observed via DXPublisher.
423 */
424 static const OrderSource iex;
425
426 /**
427 * Members Exchange.
428 *
429 * Order events are @ref ::isPublishable() "publishable" on this source and the corresponding subscription can be
430 * observed via DXPublisher.
431 */
432 static const OrderSource MEMX;
433
434 /**
435 * Members Exchange. Record for price level book.
436 *
437 * Order events are @ref ::isPublishable() "publishable" on this source and the corresponding subscription can be
438 * observed via DXPublisher.
439 */
440 static const OrderSource memx;
441
442 /**
443 * Blue Ocean Technologies Alternative Trading System.
444 *
445 * Order events are @ref ::isPublishable() "publishable" on this source and the corresponding subscription can be
446 * observed via DXPublisher.
447 */
448 static const OrderSource OCEA;
449
450 /**
451 * Blue Ocean Technologies Alternative Trading System. Record for price level book.
452 * Order events are @ref ::isPublishable() "publishable" on this source and the corresponding subscription can be
453 * observed via DXPublisher.
454 */
455 static const OrderSource ocea;
456
457 /**
458 * Pink Sheets. Record for price level book.
459 * Pink sheets are listings for stocks that trade over-the-counter (OTC).
460 *
461 * Order and OtcMarketsOrder events are @ref ::isPublishable() "publishable" on this source and the corresponding
462 * subscription can be observed via DXPublisher.
463 */
464 static const OrderSource pink;
465
466 /**
467 * NYSE Arca traded securities
468 *
469 * Order events are @ref ::isPublishable() "publishable" on this source and the corresponding subscription can be
470 * observed via DXPublisher.
471 */
472 static const OrderSource ARCA;
473
474 /**
475 * NYSE Arca traded securities. Record for price level book.
476 *
477 * Order events are @ref ::isPublishable() "publishable" on this source and the corresponding subscription can be
478 * observed via DXPublisher.
479 */
480 static const OrderSource arca;
481
482 /**
483 * Cboe European Derivatives.
484 *
485 * Order events are @ref ::isPublishable() "publishable" on this source and the corresponding subscription can be
486 * observed via DXPublisher.
487 */
488 static const OrderSource CEDX;
489
490 /**
491 * Cboe European Derivatives. Record for price level book.
492 *
493 * Order events are @ref ::isPublishable() "publishable" on this source and the corresponding subscription can be
494 * observed via DXPublisher.
495 */
496 static const OrderSource cedx;
497
498 /**
499 * IG CFDs Gate.
500 *
501 * Order events are @ref ::isPublishable() "publishable" on this source and the corresponding subscription can be
502 * observed via DXPublisher.
503 */
504 static const OrderSource IGC;
505
506 /**
507 * IG CFDs Gate. Record for price level book.
508 *
509 * Order events are @ref ::isPublishable() "publishable" on this source and the corresponding subscription can be
510 * observed via DXPublisher.
511 */
512 static const OrderSource igc;
513
514 /**
515 * EDX Exchange.
516 *
517 * Order events are @ref ::isPublishable() "publishable" on this source and the corresponding subscription can be
518 * observed via DXPublisher.
519 */
520 static const OrderSource EDX;
521
522 /**
523 * EDX Exchange. Record for price level book.
524 *
525 * Order events are @ref ::isPublishable() "publishable" on this source and the corresponding subscription can be
526 * observed via DXPublisher.
527 */
528 static const OrderSource edx;
529
530 /**
531 * Nuam Exchange Gate.
532 *
533 * Order and NuamOrder events are @ref ::isPublishable() "publishable" on this source and the corresponding
534 * subscription can be observed via DXPublisher.
535 */
536 static const OrderSource NUAM;
537
538 /**
539 * Nuam Exchange Gate. Record for price level book.
540 *
541 * Order and NuamOrder events are @ref ::isPublishable() "publishable" on this source and the corresponding
542 * subscription can be observed via DXPublisher.
543 */
544 static const OrderSource nuam;
545
546 /**
547 * Determines whether specified source identifier refers to special order source.
548 * Special order sources are used for wrapping non-order events into order events.
549 *
550 * @param sourceId the source identifier.
551 * @return `true` if it is a special source identifier
552 */
553 static bool isSpecialSourceId(std::int32_t sourceId) noexcept;
554
555 /**
556 * Returns order source for the specified source identifier.
557 *
558 * @param sourceId the source identifier.
559 * @return order source.
560 */
561 static const OrderSource &valueOf(std::int32_t sourceId);
562
563 /**
564 * Returns order source for the specified source name.
565 * The name must be either predefined, or contain at most 4 alphanumeric characters.
566 *
567 * @param name the name of the source.
568 * @return order source.
569 */
570 static const OrderSource &valueOf(const std::string &name);
571};
572
574
575template <> struct std::hash<dxfcpp::OrderSource> {
576 std::size_t operator()(const dxfcpp::OrderSource &orderSource) const noexcept {
577 return static_cast<std::size_t>(orderSource.id());
578 }
579};
580
#define DXFCXX_DISABLE_MSC_WARNINGS_POP()
Definition Conf.hpp:22
#define DXFCPP_END_NAMESPACE
Definition Conf.hpp:70
#define DXFCPP_BEGIN_NAMESPACE
Definition Conf.hpp:67
#define DXFCXX_DISABLE_GCC_WARNINGS_PUSH(warnings)
Definition Conf.hpp:38
#define DXFCXX_DISABLE_GCC_WARNINGS_POP()
Definition Conf.hpp:40
#define DXFCXX_DISABLE_MSC_WARNINGS_PUSH(warnings)
Definition Conf.hpp:21
#define DXFCPP_TRACE_ISOLATES
Definition Debug.hpp:19
#define DXFCPP_DEBUG
Definition Debug.hpp:15
#define DXFCPP_TRACE_LISTS
Definition Debug.hpp:22
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:703
DXFCPP_EXPORT dxfc_error_code_t dxfc_dxendpoint_password(dxfc_dxendpoint_t endpoint, const char *password)
Changes password for this endpoint.
Definition DXEndpoint.cpp:946
DXFCPP_EXPORT dxfc_error_code_t dxfc_dxendpoint_get_publisher(dxfc_dxendpoint_t endpoint, DXFC_OUT dxfc_dxpublisher_t *publisher)
Definition DXEndpoint.cpp:1136
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:730
DXFCPP_EXPORT dxfc_error_code_t dxfc_dxendpoint_add_state_change_listener(dxfc_dxendpoint_t endpoint, dxfc_dxendpoint_state_change_listener listener)
Adds listener that is notified about changes in state property.
Definition DXEndpoint.cpp:1082
DXFCPP_EXPORT dxfc_error_code_t dxfc_dxendpoint_disconnect(dxfc_dxendpoint_t endpoint)
Terminates all remote network connections.
Definition DXEndpoint.cpp:997
#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:895
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:1048
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 connection is not act...
Definition api.h:159
@ DXFC_DXENDPOINT_STATE_CONNECTED
The connection to 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:788
#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:1065
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:686
DXFCPP_EXPORT dxfc_error_code_t dxfc_dxendpoint_builder_free(dxfc_dxendpoint_builder_t builder)
Removes a builder from the registry.
Definition DXEndpoint.cpp:776
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:963
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 listener that is notified about changes in state property.
Definition DXEndpoint.cpp:1108
DXFCPP_EXPORT dxfc_error_code_t dxfc_dxendpoint_builder_with_name(dxfc_dxendpoint_builder_t builder, const char *name)
Changes name that is used to distinguish multiple endpoints in the same process (GraalVM Isolate) in ...
Definition DXEndpoint.cpp:670
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:68
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:747
DXFCPP_EXPORT dxfc_error_code_t dxfc_dxendpoint_get_feed(dxfc_dxendpoint_t endpoint, DXFC_OUT dxfc_dxfeed_t *feed)
Definition DXEndpoint.cpp:1131
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:1031
DXFCPP_EXPORT dxfc_error_code_t dxfc_dxendpoint_close(dxfc_dxendpoint_t endpoint)
Closes this endpoint.
Definition DXEndpoint.cpp:878
DXFCPP_EXPORT dxfc_error_code_t dxfc_dxendpoint_new_builder(DXFC_OUT dxfc_dxendpoint_builder_t *builder)
Creates new dxFeed endpoint's builder instance.
Definition DXEndpoint.cpp:637
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:980
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:912
DXFCPP_EXPORT dxfc_error_code_t dxfc_dxendpoint_user(dxfc_dxendpoint_t endpoint, const char *user)
Changes username for this endpoint.
Definition DXEndpoint.cpp:929
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 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 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:833
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:810
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:653
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:855
DXFCPP_EXPORT dxfc_error_code_t dxfc_dxendpoint_free(dxfc_dxendpoint_t endpoint)
Removes the dxFeed endpoint from the registry.
Definition DXEndpoint.cpp:1141
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:1014
The enumeration type that provides additional information about the dxFeed Graal C++-API event type.
Definition EventTypeEnum.hpp:21
bool isTimeSeries() const noexcept
Definition EventTypeEnum.hpp:174
const std::string & getClassName() const &noexcept
Definition EventTypeEnum.hpp:117
bool isLasting() const noexcept
Definition EventTypeEnum.hpp:160
bool isOnlyIndexed() const noexcept
Definition EventTypeEnum.hpp:181
bool isIndexed() const noexcept
Definition EventTypeEnum.hpp:167
std::uint32_t getId() const noexcept
Definition EventTypeEnum.hpp:103
bool isMarket() const noexcept
Definition EventTypeEnum.hpp:188
const std::string & getName() const &noexcept
Definition EventTypeEnum.hpp:110
Source identifier for IndexedEvent.
Definition IndexedEventSource.hpp:22
static void freeGraal(void *graalNative)
Releases the memory occupied by the dxFeed Graal SDK structure (recursively if necessary).
Definition IndexedEventSource.cpp:21
const std::string & name() const noexcept
Returns the string representation of the object.
Definition IndexedEventSource.hpp:90
static IndexedEventSource fromGraal(void *graalNative)
Creates an object of the current type and fills it with data from the the dxFeed Graal SDK structure.
Definition IndexedEventSource.cpp:32
static const IndexedEventSource DEFAULT
The default source with zero identifier for all events that do not support multiple sources.
Definition IndexedEventSource.hpp:13
std::int32_t id() const noexcept
Returns the source identifier.
Definition IndexedEventSource.hpp:81
virtual void * toGraal() const
Allocates memory for the dxFeed Graal SDK structure (recursively if necessary).
Definition IndexedEventSource.cpp:15
std::string toString() const
Returns the string representation of the object.
Definition IndexedEventSource.hpp:99
IndexedEventSource(std::int32_t id, std::string name) noexcept
Creates the new IndexedEvent's source by id and name.
Definition IndexedEventSource.hpp:73
static const OrderSource GLBX
CME Globex.
Definition OrderSource.hpp:352
static const OrderSource smfe
Small Exchange.
Definition OrderSource.hpp:416
static const OrderSource bzx
Bats BZX Exchange.
Definition OrderSource.hpp:280
static const OrderSource DEX
Direct-Edge EDGX Exchange.
Definition OrderSource.hpp:247
static const OrderSource NTV
NASDAQ Total View.
Definition OrderSource.hpp:183
static const OrderSource AGGREGATE_ASK
Ask side of an aggregate order book (futures depth and NASDAQ Level II).
Definition OrderSource.hpp:136
static const OrderSource & valueOf(std::int32_t sourceId)
Returns order source for the specified source identifier.
Definition OrderSource.cpp:194
static const OrderSource ESPD
NASDAQ eSpeed.
Definition OrderSource.hpp:207
static const OrderSource CFE
CBOE Futures Exchange.
Definition OrderSource.hpp:392
static const OrderSource ntv
NASDAQ Total View.
Definition OrderSource.hpp:191
static const OrderSource ICE
Intercontinental Exchange.
Definition OrderSource.hpp:223
static const OrderSource BZX
Bats BZX Exchange.
Definition OrderSource.hpp:272
static const OrderSource C2OX
CBOE Options C2 Exchange.
Definition OrderSource.hpp:400
static const OrderSource AGGREGATE
Aggregate order book (futures depth and NASDAQ Level II).
Definition OrderSource.hpp:168
static const OrderSource REGIONAL_ASK
Ask side of a regional Quote.
Definition OrderSource.hpp:120
static const OrderSource REGIONAL_BID
Bid side of a regional Quote.
Definition OrderSource.hpp:111
static const OrderSource igc
IG CFDs Gate.
Definition OrderSource.hpp:512
static const OrderSource ABE
ABE (abe.io) exchange.
Definition OrderSource.hpp:336
static const OrderSource CEUX
Bats Europe DXE Exchange.
Definition OrderSource.hpp:304
static const OrderSource OCEA
Blue Ocean Technologies Alternative Trading System.
Definition OrderSource.hpp:448
static const OrderSource AGGREGATE_BID
Bid side of an aggregate order book (futures depth and NASDAQ Level II).
Definition OrderSource.hpp:128
static const OrderSource BXTR
Bats Europe TRF.
Definition OrderSource.hpp:312
static const OrderSource dex
Direct-Edge EDGX Exchange.
Definition OrderSource.hpp:256
static const OrderSource cedx
Cboe European Derivatives.
Definition OrderSource.hpp:496
static const OrderSource COMPOSITE
Composite Quote.
Definition OrderSource.hpp:147
static const OrderSource COMPOSITE_ASK
Ask side of a composite Quote.
Definition OrderSource.hpp:102
static const OrderSource REGIONAL
Regional Quote.
Definition OrderSource.hpp:158
static const OrderSource XNFI
NASDAQ Fixed Income.
Definition OrderSource.hpp:215
static const OrderSource iex
Investors exchange.
Definition OrderSource.hpp:424
static const OrderSource xeur
Eurex Exchange.
Definition OrderSource.hpp:384
static const OrderSource CEDX
Cboe European Derivatives.
Definition OrderSource.hpp:488
static const OrderSource ISE
International Securities Exchange.
Definition OrderSource.hpp:231
static const OrderSource DEA
Direct-Edge EDGA Exchange.
Definition OrderSource.hpp:239
static const OrderSource glbx
CME Globex.
Definition OrderSource.hpp:360
static const OrderSource ocea
Blue Ocean Technologies Alternative Trading System.
Definition OrderSource.hpp:455
static const OrderSource EDX
EDX Exchange.
Definition OrderSource.hpp:520
static const OrderSource BI20
Borsa Istanbul Exchange.
Definition OrderSource.hpp:328
static const OrderSource NUAM
Nuam Exchange Gate.
Definition OrderSource.hpp:536
static const OrderSource BYX
Bats BYX Exchange.
Definition OrderSource.hpp:264
static const OrderSource IGC
IG CFDs Gate.
Definition OrderSource.hpp:504
static const OrderSource FAIR
FAIR (FairX) exchange.
Definition OrderSource.hpp:344
static const OrderSource BATE
Bats Europe BXE Exchange.
Definition OrderSource.hpp:288
static const OrderSource pink
Pink Sheets.
Definition OrderSource.hpp:464
static const OrderSource DEFAULT
Default source for publishing custom order books.
Definition OrderSource.hpp:175
static const OrderSource NFX
NASDAQ Futures Exchange.
Definition OrderSource.hpp:199
static const OrderSource memx
Members Exchange.
Definition OrderSource.hpp:440
static bool isSpecialSourceId(std::int32_t sourceId) noexcept
Determines whether specified source identifier refers to special order source.
Definition OrderSource.cpp:190
static const OrderSource IST
Borsa Istanbul Exchange.
Definition OrderSource.hpp:320
static const OrderSource edx
EDX Exchange.
Definition OrderSource.hpp:528
static const OrderSource ARCA
NYSE Arca traded securities.
Definition OrderSource.hpp:472
static const OrderSource CHIX
Bats Europe CXE Exchange.
Definition OrderSource.hpp:296
static const OrderSource & valueOf(const std::string &name)
Returns order source for the specified source name.
Definition OrderSource.cpp:208
static const OrderSource ERIS
Eris Exchange group of companies.
Definition OrderSource.hpp:368
static const OrderSource nuam
Nuam Exchange Gate.
Definition OrderSource.hpp:544
static const OrderSource XEUR
Eurex Exchange.
Definition OrderSource.hpp:376
static const OrderSource MEMX
Members Exchange.
Definition OrderSource.hpp:432
static const OrderSource COMPOSITE_BID
Bid side of a composite Quote.
Definition OrderSource.hpp:93
static const OrderSource arca
NYSE Arca traded securities.
Definition OrderSource.hpp:480
static const OrderSource SMFE
Small Exchange.
Definition OrderSource.hpp:408
Base abstract class for all dxFeed C++ API entities.
Definition Entity.hpp:13
virtual ~Entity() noexcept=default
The default virtual d-tor.
bool isOrderSource() const noexcept
Definition EventSourceWrapper.hpp:242
std::unique_ptr< void, decltype(&EventSourceWrapper::freeGraal)> toGraalUnique() const noexcept
Allocates memory for the dxFeed Graal SDK structure (recursively if necessary).
Definition EventSourceWrapper.hpp:200
std::string toStringUnderlying() const
Returns a string representation of the underlying object.
Definition EventSourceWrapper.hpp:224
static void freeGraal(void *graalNative)
Releases the memory occupied by the dxFeed Graal SDK structure (recursively if necessary).
Definition EventSourceWrapper.hpp:163
std::string toString() const
Returns a string representation of the current object.
Definition EventSourceWrapper.hpp:209
void * toGraal() const noexcept
Allocates memory for the dxFeed Graal SDK structure (recursively if necessary).
Definition EventSourceWrapper.hpp:184
static EventSourceWrapper fromGraal(void *graalNative)
Creates an object of the current type and fills it with data from the the dxFeed Graal SDK structure.
Definition EventSourceWrapper.cpp:40
const DataType & getData() const noexcept
Definition EventSourceWrapper.hpp:266
EventSourceWrapper(const IndexedEventSource &data) noexcept
Constructs a wrapper from IndexedEventSource.
Definition EventSourceWrapper.hpp:145
bool isIndexedEventSource() const noexcept
Definition EventSourceWrapper.hpp:235
std::optional< IndexedEventSource > asIndexedEventSource() const noexcept
Definition EventSourceWrapper.hpp:250
std::optional< OrderSource > asOrderSource() const noexcept
Definition EventSourceWrapper.hpp:259
EventSourceWrapper(const OrderSource &data) noexcept
Constructs a wrapper from OrderSource.
Definition EventSourceWrapper.hpp:153
Event type parametrized by a symbol.
Definition EventType.hpp:116
virtual const std::optional< Symbol > & getEventSymbolOpt() const &noexcept=0
Returns event symbol that identifies this event type in subscription.
virtual void setEventSymbol(const Symbol &eventSymbol) noexcept=0
Changes event symbol that identifies this event type in subscription.
virtual const Symbol & getEventSymbol() const &noexcept=0
Returns event symbol that identifies this event type in subscription.
Marks all event types that can be received via dxFeed API.
Definition EventType.hpp:31
std::string toString() const override
Returns a string representation of the current object.
Definition EventType.hpp:89
virtual std::int64_t getEventTime() const noexcept
Returns time when event was created or zero when time is not available.
Definition EventType.hpp:54
virtual void assign(std::shared_ptr< EventType > event)
Replaces the contents of the event.
Definition EventType.hpp:84
virtual void * toGraal() const =0
Allocates memory for the dxFeed Graal SDK structure (recursively if necessary).
virtual void setEventTime(std::int64_t) noexcept
Changes event creation time.
Definition EventType.hpp:66
The wrapper over CEntryPointErrorsEnum, the error code returned by GraalVM.
Definition GraalException.hpp:22
GraalException(CEntryPointErrorsEnum entryPointErrorsEnum)
Constructs an exception.
Definition GraalException.cpp:10
void handle(ArgTypes... args)
Calls the listeners and pass the args to them.
Definition Handler.hpp:123
std::size_t add(ListenerType &&listener)
Adds the listener to "main" group.
Definition Handler.hpp:157
std::size_t operator%=(ListenerType &&listener)
Adds the low priority listener (to the "low priority" group).
Definition Handler.hpp:209
std::size_t operator+=(ListenerType &&listener)
Adds the listener to "main" group.
Definition Handler.hpp:198
void operator()(ArgTypes... args)
Calls the listeners and pass the ars to them.
Definition Handler.hpp:147
Handler(std::size_t mainFuturesSize=MAIN_FUTURES_DEFAULT_SIZE) noexcept
Creates the new handler by specified size of circular buffer of futures.
Definition Handler.hpp:85
void operator-=(std::size_t id)
Removes a listener by the id.
Definition Handler.hpp:237
std::size_t addLowPriority(ListenerType &&listener)
Adds the low priority listener (to the "low priority" group) It will be called after the "main" liste...
Definition Handler.hpp:178
void remove(std::size_t id)
Removes a listener by the id.
Definition Handler.hpp:218
A helper class needed to construct smart pointers to objects, and does not allow explicit constructio...
Definition SharedEntity.hpp:89
static auto createShared(Args &&...args)
Creates smart pointer to object.
Definition SharedEntity.hpp:103
A runtime axception with stacktrace.
Definition RuntimeException.hpp:20
RuntimeException(const StringLikeWrapper &message, const StringLikeWrapper &additionalStackTrace="")
Constructs a runtime exception.
Definition RuntimeException.cpp:71
const std::string & getStackTrace() const &
Definition RuntimeException.cpp:85
Base abstract "shared entity" class. Has some helpers for dynamic polymorphism.
Definition SharedEntity.hpp:21
virtual std::string toString() const
Returns a string representation of the current object.
Definition SharedEntity.hpp:78
std::shared_ptr< T > sharedAs() const noexcept
Returns a pointer to the current object wrapped in a smart pointer to type T.
Definition SharedEntity.hpp:69
std::shared_ptr< T > sharedAs() noexcept
Returns a pointer to the current object wrapped in a smart pointer to type T.
Definition SharedEntity.hpp:56
bool is() const noexcept
Checks that pointer to the current type could be converted to type T* In other words: whether type T ...
Definition SharedEntity.hpp:35
std::size_t operator+=(ListenerType &&listener)
Adds the listener to "main" group.
Definition Handler.hpp:378
void remove(std::size_t id)
Removes a listener by the id.
Definition Handler.hpp:398
void handle(ArgTypes... args)
Calls the listeners and pass the args to them.
Definition Handler.hpp:316
void operator()(ArgTypes... args)
Calls the listeners and pass the ars to them.
Definition Handler.hpp:327
SimpleHandler() noexcept=default
Creates the new handler.
std::size_t addLowPriority(ListenerType &&listener)
Adds the low priority listener (to the "low priority" group) It will be called after the "main" liste...
Definition Handler.hpp:358
void operator-=(std::size_t id)
Removes a listener by the id.
Definition Handler.hpp:417
std::size_t operator%=(ListenerType &&listener)
Adds the low priority listener (to the "low priority" group).
Definition Handler.hpp:389
std::size_t add(ListenerType &&listener)
Adds the listener to "main" group.
Definition Handler.hpp:337
Universal functional object that allows searching std::unordered_map for string-like keys.
Definition Common.hpp:911
A simple wrapper around strings or something similar to strings to reduce the amount of code for meth...
Definition Common.hpp:794
Utility class for parsing and formatting dates and times in ISO-compatible format.
Definition TimeFormat.hpp:29
std::string format(std::int64_t timestamp) const
Converts timestamp into string according to the format.
Definition TimeFormat.cpp:55
static const TimeFormat GMT
An instance of TimeFormat that corresponds to GMT timezone as returned by TimeZone::getTimeZone("GMT"...
Definition TimeFormat.hpp:41
std::int64_t parse(const StringLikeWrapper &value) const
Reads Date from String and returns timestamp.
Definition TimeFormat.cpp:49
static const TimeFormat DEFAULT
An instance of TimeFormat that corresponds to default timezone as returned by TimeZone::getDefault() ...
Definition TimeFormat.hpp:33
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