dxFeed Graal CXX API v8.1.0
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 "../EventTypeEnum.hpp"
11#include "../IndexedEventSource.hpp"
12#include "../../internal/utils/StringUtils.hpp"
13
14#include <cstdint>
15#include <memory>
16#include <mutex>
17#include <string>
18#include <unordered_map>
19#include <variant>
20
21/**
22 * \addtogroup dxfcpp_market
23 * @{
24 */
25
27
28struct EventSourceWrapper;
29
30/**
31 * Identifies a source of Order, AnalyticOrder, OtcMarketsOrder, and SpreadOrder events.
32 * There are the following kinds of order sources:
33 * <ul>
34 * <li><em>Synthetic</em> sources OrderSource::COMPOSITE_BID, OrderSource::COMPOSITE_ASK,
35 * OrderSource::REGIONAL_BID, and OrderSource::REGIONAL_ASK are provided for convenience of a consolidated
36 * order book and are automatically generated based on the corresponding Quote events.
37 * <li><em>Aggregate</em> sources OrderSource::AGGREGATE_BID and OrderSource::AGGREGATE_ASK provide
38 * futures depth (aggregated by price level) and NASDAQ Level II (top of the book for each market maker).
39 * This source cannot be directly published to via dxFeed API.
40 * <li><em>Publishable</em> sources OrderSource::DEFAULT, OrderSource::NTV, OrderSource::ISE etc.
41 * support a full range of dxFeed API features.
42 * </ul>
43 */
44class DXFCPP_EXPORT OrderSource final : public IndexedEventSource {
45 friend struct EventSourceWrapper;
46
47 static constexpr std::uint32_t PUB_ORDER = 0x0001U;
48 static constexpr std::uint32_t PUB_ANALYTIC_ORDER = 0x0002U;
49 static constexpr std::uint32_t PUB_OTC_MARKETS_ORDER = 0x0004;
50 static constexpr std::uint32_t PUB_SPREAD_ORDER = 0x0008U;
51 static constexpr std::uint32_t FULL_ORDER_BOOK = 0x0010U;
52 static constexpr std::uint32_t PUB_NUAM_ORDER = 0x0020U;
53
54 static constexpr std::uint32_t FLAGS_SIZE = 6U;
55
56 public:
57 static const std::unordered_map<std::variant<std::int32_t, std::string>, std::reference_wrapper<const OrderSource>>
58 PREDEFINED_SOURCES;
59
60 private:
61 static inline std::mutex MTX_{};
62 static std::unordered_map<std::int32_t, OrderSource> USER_SOURCES_;
63
64 std::uint32_t pubFlags_{};
65 bool builtin_{};
66
67 OrderSource(std::int32_t id, const StringLike& name, std::uint32_t pubFlags) noexcept;
68
69 OrderSource(const StringLike &name, std::uint32_t pubFlags);
70
71 OrderSource(std::int32_t id, const StringLike &name) noexcept;
72
73 static std::int32_t composeId(const StringLike &name);
74
75 static void checkChar(char c);
76
77 static std::string decodeName(std::int32_t id);
78
79 static std::uint32_t getEventTypeMask(const EventTypeEnum &eventType);
80
81 /**
82 * Allocates memory for the dxFeed Graal SDK structure (recursively if necessary).
83 * Fills the dxFeed Graal SDK structure's fields by the data of the current entity (recursively if necessary).
84 * Returns the pointer to the filled structure.
85 *
86 * @return The pointer to the filled dxFeed Graal SDK structure
87 */
88 void *toGraal() const override;
89
90 std::unique_ptr<void, decltype(&IndexedEventSource::freeGraal)> toGraalUnique() const noexcept override;
91
92 public:
93 /**
94 * Bid side of a composite Quote.
95 * It is a <em>synthetic</em> source.
96 * It cannot be used with the DXFeed::getIndexedEventsPromise method, and it cannot be published directly to.
97 * The subscription on the composite Quote event is observed when this source is subscribed to.
98 * @deprecated Use the OrderSource::COMPOSITE source.
99 */
100 static const OrderSource COMPOSITE_BID;
101
102 /**
103 * Ask side of a composite Quote.
104 * It is a <em>synthetic</em> and <em>separate</em> source.
105 * It cannot be used with the DXFeed::getIndexedEventsPromise method, and it cannot be published directly to.
106 * The subscription on the composite Quote event is observed when this source is subscribed to.
107 * @deprecated Use the OrderSource::COMPOSITE source.
108 */
109 static const OrderSource COMPOSITE_ASK;
110
111 /**
112 * Bid side of a regional Quote.
113 * It is a <em>synthetic</em> and <em>separate</em> source.
114 * It cannot be used with the DXFeed::getIndexedEventsPromise method, and it cannot be published directly to.
115 * The subscription on the regional Quote event is observed when this source is subscribed to.
116 * @deprecated Use the OrderSource::REGIONAL source.
117 */
118 static const OrderSource REGIONAL_BID;
119
120 /**
121 * Ask side of a regional Quote.
122 * It is a <em>synthetic</em> and <em>separate</em> source.
123 * It cannot be used with the DXFeed::getIndexedEventsPromise method, and it cannot be published directly to.
124 * The subscription on a regional Quote event is observed when this source is subscribed to.
125 * @deprecated Use the OrderSource::REGIONAL source.
126 */
127 static const OrderSource REGIONAL_ASK;
128
129 /**
130 * Bid side of an aggregate order book (futures depth and NASDAQ Level II).
131 * It is an <em>aggregate</em> and <em>separate</em> source.
132 * This source cannot be directly published via dxFeed API, but otherwise it is fully operational.
133 * @deprecated Use the OrderSource::AGGREGATE source.
134 */
135 static const OrderSource AGGREGATE_BID;
136
137 /**
138 * Ask side of an aggregate order book (futures depth and NASDAQ Level II).
139 * It is a <em>aggregate</em> and <em>separate</em> source.
140 * This source cannot be directly published via dxFeed API, but otherwise it is fully operational.
141 * @deprecated Use the OrderSource::AGGREGATE source.
142 */
143 static const OrderSource AGGREGATE_ASK;
144
145 /**
146 * Composite Quote.
147 * It is a <em>synthetic</em> and <em>unitary</em> source that represents both bid and ask side.
148 * It cannot be used with the DXFeed::getIndexedEventsPromise method, and it cannot be published directly to.
149 * The subscription on the composite Quote event is observed when this source is subscribed to.
150 * To use this source when subscribing to all sources (e.g., when subscribing to an order without specifying a
151 * source), instead of OrderSource::COMPOSITE_ASK and OrderSource::COMPOSITE_BID, set the system property
152 * <b>`dxscheme.unitaryOrderSource`</b> to `true`.
153 */
154 static const OrderSource COMPOSITE;
155
156 /**
157 * Regional Quote.
158 * It is a <em>synthetic</em> and <em>unitary</em> source that represents both bid and ask side.
159 * It cannot be used with the DXFeed::getIndexedEventsPromise method, and it cannot be published directly to.
160 * The subscription on a regional Quote event is observed when this source is subscribed to.
161 * To use this source when subscribing to all sources (e.g., when subscribing to an order without specifying a
162 * source), instead of OrderSource::REGIONAL_ASK and OrderSource::REGIONAL_BID, set the system property
163 * <b>`dxscheme.unitaryOrderSource`</b> to `true`.
164 */
165 static const OrderSource REGIONAL;
166
167 /**
168 * Aggregate order book (futures depth and NASDAQ Level II).
169 * It is an <em>aggregate</em> and <em>unitary</em> source that represents both bid and ask side.
170 * This source cannot be directly published via dxFeed API, but otherwise it is fully operational.
171 * To use this source when subscribing to all sources (e.g., when subscribing to an order without specifying a
172 * source), instead of OrderSource::AGGREGATE_ASK and OrderSource::AGGREGATE_BID, set the system property
173 * <b>`dxscheme.unitaryOrderSource`</b> to `true`.
174 */
175 static const OrderSource AGGREGATE;
176
177 /**
178 * Default source for publishing custom order books.
179 * Order, AnalyticOrder, OtcMarketsOrder, and SpreadOrder events are @ref ::isPublishable() "publishable"
180 * on this source and the corresponding subscription can be observed via DXPublisher.
181 */
182 static const OrderSource DEFAULT;
183
184 /**
185 * NASDAQ Total View.
186 *
187 * Order events are @ref ::isPublishable() "publishable" on this source and the corresponding subscription can be
188 * observed via DXPublisher.
189 */
190 static const OrderSource NTV;
191
192 /**
193 * NASDAQ Total View. Record for a price level book.
194 *
195 * Order events are @ref ::isPublishable() "publishable" on this source and the corresponding subscription can be
196 * observed via DXPublisher.
197 */
198 static const OrderSource ntv;
199
200 /**
201 * NASDAQ Futures Exchange.
202 *
203 * Order events are @ref ::isPublishable() "publishable" on this source and the corresponding subscription can be
204 * observed via DXPublisher.
205 */
206 static const OrderSource NFX;
207
208 /**
209 * NASDAQ eSpeed.
210 *
211 * Order events are @ref ::isPublishable() "publishable" on this source and the corresponding subscription can be
212 * observed via DXPublisher.
213 */
214 static const OrderSource ESPD;
215
216 /**
217 * NASDAQ Fixed Income.
218 *
219 * Order events are @ref ::isPublishable() "publishable" on this source and the corresponding subscription can be
220 * observed via DXPublisher.
221 */
222 static const OrderSource XNFI;
223
224 /**
225 * Intercontinental Exchange.
226 *
227 * Order events are @ref ::isPublishable() "publishable" on this source and the corresponding subscription can be
228 * observed via DXPublisher.
229 */
230 static const OrderSource ICE;
231
232 /**
233 * International Securities Exchange.
234 *
235 * Order and SpreadOrder events are @ref ::isPublishable() "publishable" on this source and the corresponding
236 * subscription can be observed via DXPublisher.
237 */
238 static const OrderSource ISE;
239
240 /**
241 * Direct-Edge EDGA Exchange.
242 *
243 * Order events are @ref ::isPublishable() "publishable" on this source and the corresponding subscription can be
244 * observed via DXPublisher.
245 */
246 static const OrderSource DEA;
247
248 /**
249 * Direct-Edge EDGX Exchange.
250 *
251 * Order events are @ref ::isPublishable() "publishable" on this source and the corresponding subscription can be
252 * observed via DXPublisher.
253 */
254 static const OrderSource DEX;
255
256 /**
257 * Direct-Edge EDGX Exchange. Record for a price level book.
258 *
259 * Order events are @ref ::isPublishable() "publishable" on this source and the corresponding subscription can be
260 * observed via DXPublisher.
261 */
262
263 static const OrderSource dex;
264
265 /**
266 * Bats BYX Exchange.
267 *
268 * Order events are @ref ::isPublishable() "publishable" on this source and the corresponding subscription can be
269 * observed via DXPublisher.
270 */
271 static const OrderSource BYX;
272
273 /**
274 * Bats BZX Exchange.
275 *
276 * Order events are @ref ::isPublishable() "publishable" on this source and the corresponding subscription can be
277 * observed via DXPublisher.
278 */
279 static const OrderSource BZX;
280
281 /**
282 * Bats BZX Exchange. Record for a price level book.
283 *
284 * Order events are @ref ::isPublishable() "publishable" on this source and the corresponding subscription can be
285 * observed via DXPublisher.
286 */
287 static const OrderSource bzx;
288
289 /**
290 * Bats Europe BXE Exchange.
291 *
292 * Order events are @ref ::isPublishable() "publishable" on this source and the corresponding subscription can be
293 * observed via DXPublisher.
294 */
295 static const OrderSource BATE;
296
297 /**
298 * Bats Europe CXE Exchange.
299 *
300 * Order events are @ref ::isPublishable() "publishable" on this source and the corresponding subscription can be
301 * observed via DXPublisher.
302 */
303 static const OrderSource CHIX;
304
305 /**
306 * Bats Europe DXE Exchange.
307 *
308 * Order events are @ref ::isPublishable() "publishable" on this source and the corresponding subscription can be
309 * observed via DXPublisher.
310 */
311 static const OrderSource CEUX;
312
313 /**
314 * Bats Europe TRF.
315 *
316 * Order events are @ref ::isPublishable() "publishable" on this source and the corresponding subscription can be
317 * observed via DXPublisher.
318 */
319 static const OrderSource BXTR;
320
321 /**
322 * Borsa Istanbul Exchange.
323 *
324 * Order events are @ref ::isPublishable() "publishable" on this source and the corresponding subscription can be
325 * observed via DXPublisher.
326 */
327 static const OrderSource IST;
328
329 /**
330 * Borsa Istanbul Exchange. Record for a particular top 20 order book.
331 *
332 * Order events are @ref ::isPublishable() "publishable" on this source and the corresponding subscription can be
333 * observed via DXPublisher.
334 */
335 static const OrderSource BI20;
336
337 /**
338 * ABE (abe.io) exchange.
339 *
340 * Order events are @ref ::isPublishable() "publishable" on this source and the corresponding subscription can be
341 * observed via DXPublisher.
342 */
343 static const OrderSource ABE;
344
345 /**
346 * FAIR (FairX) exchange.
347 *
348 * Order events are @ref ::isPublishable() "publishable" on this source and the corresponding subscription can be
349 * observed via DXPublisher.
350 */
351 static const OrderSource FAIR;
352
353 /**
354 * CME Globex.
355 *
356 * Order and AnalyticOrder events are @ref ::isPublishable() "publishable" on this source and the corresponding
357 * subscription can be observed via DXPublisher.
358 */
359 static const OrderSource GLBX;
360
361 /**
362 * CME Globex. Record for a price level book.
363 *
364 * Order events are @ref ::isPublishable() "publishable" on this source and the corresponding subscription can be
365 * observed via DXPublisher.
366 */
367 static const OrderSource glbx;
368
369 /**
370 * Eris Exchange group of companies.
371 *
372 * Order events are @ref ::isPublishable() "publishable" on this source and the corresponding subscription can be
373 * observed via DXPublisher.
374 */
375 static const OrderSource ERIS;
376
377 /**
378 * Eurex Exchange.
379 *
380 * Order events are @ref ::isPublishable() "publishable" on this source and the corresponding subscription can be
381 * observed via DXPublisher.
382 */
383 static const OrderSource XEUR;
384
385 /**
386 * Eurex Exchange. Record for a price level book.
387 *
388 * Order events are @ref ::isPublishable() "publishable" on this source and the corresponding subscription can be
389 * observed via DXPublisher.
390 */
391 static const OrderSource xeur;
392
393 /**
394 * CBOE Futures Exchange.
395 *
396 * Order events are @ref ::isPublishable() "publishable" on this source and the corresponding subscription can be
397 * observed via DXPublisher.
398 */
399 static const OrderSource CFE;
400
401 /**
402 * CBOE Options C2 Exchange.
403 *
404 * Order events are @ref ::isPublishable() "publishable" on this source and the corresponding subscription can be
405 * observed via DXPublisher.
406 */
407 static const OrderSource C2OX;
408
409 /**
410 * Small Exchange.
411 *
412 * Order events are @ref ::isPublishable() "publishable" on this source and the corresponding subscription can be
413 * observed via DXPublisher.
414 */
415 static const OrderSource SMFE;
416
417 /**
418 * Small Exchange. Record for a price level book.
419 *
420 * Order events are @ref ::isPublishable() "publishable" on this source and the corresponding subscription can be
421 * observed via DXPublisher.
422 */
423 static const OrderSource smfe;
424
425 /**
426 * Investors exchange. Record for a price level book.
427 *
428 * Order events are @ref ::isPublishable() "publishable" on this source and the corresponding subscription can be
429 * observed via DXPublisher.
430 */
431 static const OrderSource iex;
432
433 /**
434 * Members Exchange.
435 *
436 * Order events are @ref ::isPublishable() "publishable" on this source and the corresponding subscription can be
437 * observed via DXPublisher.
438 */
439 static const OrderSource MEMX;
440
441 /**
442 * Members Exchange. Record for a price level book.
443 *
444 * Order events are @ref ::isPublishable() "publishable" on this source and the corresponding subscription can be
445 * observed via DXPublisher.
446 */
447 static const OrderSource memx;
448
449 /**
450 * Blue Ocean Technologies Alternative Trading System.
451 *
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 * Blue Ocean Technologies Alternative Trading System. Record for a price level book.
459 * Order events are @ref ::isPublishable() "publishable" on this source and the corresponding subscription can be
460 * observed via DXPublisher.
461 */
462 static const OrderSource ocea;
463
464 /**
465 * Pink Sheets. Record for a price level book.
466 * Pink sheets are listings for stocks that trade over-the-counter (OTC).
467 *
468 * Order and OtcMarketsOrder events are @ref ::isPublishable() "publishable" on this source and the corresponding
469 * subscription can be observed via DXPublisher.
470 */
471 static const OrderSource pink;
472
473 /**
474 * NYSE Arca traded securities
475 *
476 * Order events are @ref ::isPublishable() "publishable" on this source and the corresponding subscription can be
477 * observed via DXPublisher.
478 */
479 static const OrderSource ARCA;
480
481 /**
482 * NYSE Arca traded securities. Record for a price level book.
483 *
484 * Order events are @ref ::isPublishable() "publishable" on this source and the corresponding subscription can be
485 * observed via DXPublisher.
486 */
487 static const OrderSource arca;
488
489 /**
490 * Cboe European Derivatives.
491 *
492 * Order events are @ref ::isPublishable() "publishable" on this source and the corresponding subscription can be
493 * observed via DXPublisher.
494 */
495 static const OrderSource CEDX;
496
497 /**
498 * Cboe European Derivatives. Record for a price level book.
499 *
500 * Order events are @ref ::isPublishable() "publishable" on this source and the corresponding subscription can be
501 * observed via DXPublisher.
502 */
503 static const OrderSource cedx;
504
505 /**
506 * IG CFDs Gate.
507 *
508 * Order events are @ref ::isPublishable() "publishable" on this source and the corresponding subscription can be
509 * observed via DXPublisher.
510 */
511 static const OrderSource IGC;
512
513 /**
514 * IG CFDs Gate. Record for a price level book.
515 *
516 * Order events are @ref ::isPublishable() "publishable" on this source and the corresponding subscription can be
517 * observed via DXPublisher.
518 */
519 static const OrderSource igc;
520
521 /**
522 * EDX Exchange.
523 *
524 * Order events are @ref ::isPublishable() "publishable" on this source and the corresponding subscription can be
525 * observed via DXPublisher.
526 */
527 static const OrderSource EDX;
528
529 /**
530 * EDX Exchange. Record for a price level book.
531 *
532 * Order events are @ref ::isPublishable() "publishable" on this source and the corresponding subscription can be
533 * observed via DXPublisher.
534 */
535 static const OrderSource edx;
536
537 /**
538 * Nuam Exchange Gate.
539 *
540 * Order and NuamOrder events are @ref ::isPublishable() "publishable" on this source and the corresponding
541 * subscription can be observed via DXPublisher.
542 */
543 static const OrderSource NUAM;
544
545 /**
546 * Nuam Exchange Gate. Record for a price level book.
547 *
548 * Order and NuamOrder events are @ref ::isPublishable() "publishable" on this source and the corresponding
549 * subscription can be observed via DXPublisher.
550 */
551 static const OrderSource nuam;
552
553 /**
554 * Determines whether the specified source identifier refers to a special order source.
555 * Special order sources are used for wrapping non-order events into order events.
556 *
557 * @param sourceId the source identifier.
558 * @return `true` if it is a special source identifier
559 */
560 static bool isSpecialSourceId(std::int32_t sourceId) noexcept;
561
562 /**
563 * Returns order source for the specified source identifier.
564 *
565 * @param sourceId the source identifier.
566 * @return order source.
567 */
568 static const OrderSource &valueOf(std::int32_t sourceId);
569
570 /**
571 * Returns order source for the specified source name.
572 * The name must be either predefined or contain at most 4 alphanumeric characters.
573 *
574 * @param name the name of the source.
575 * @return order source.
576 */
577 static const OrderSource &valueOf(const StringLike &name);
578};
579
581
582/// @}
583
584template <> struct std::hash<dxfcpp::OrderSource> {
585 std::size_t operator()(const dxfcpp::OrderSource &orderSource) const noexcept {
586 return static_cast<std::size_t>(orderSource.id());
587 }
588};
589
#define DXFCPP_MACRO_CONCAT_INNER(a, b)
Definition Common.hpp:135
#define DXFCPP_MACRO_CONCAT(a, b)
Definition Common.hpp:134
#define DXFCPP_MACRO_UNIQUE_NAME(base)
Definition Common.hpp:136
#define DXFCXX_DISABLE_MSC_WARNINGS_POP()
Definition Conf.hpp:31
#define DXFCXX_DISABLE_CLANG_WARNINGS_PUSH(warnings)
Definition Conf.hpp:65
#define DXFCPP_END_NAMESPACE
Definition Conf.hpp:97
#define DXFCPP_BEGIN_NAMESPACE
Definition Conf.hpp:94
#define DXFCXX_DISABLE_GCC_WARNINGS_PUSH(warnings)
Definition Conf.hpp:47
#define DXFCXX_DISABLE_CLANG_WARNINGS_POP()
Definition Conf.hpp:67
#define DXFCXX_DISABLE_GCC_WARNINGS_POP()
Definition Conf.hpp:49
#define DXFCXX_DISABLE_MSC_WARNINGS_PUSH(warnings)
Definition Conf.hpp:30
#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_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:721
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:754
DXFCPP_EXPORT dxfc_error_code_t dxfc_dxendpoint_password(dxfc_dxendpoint_t endpoint, const char *password)
Changes password for this endpoint.
Definition DXEndpoint.cpp:1002
DXFCPP_EXPORT dxfc_error_code_t dxfc_dxendpoint_get_publisher(dxfc_dxendpoint_t endpoint, DXFC_OUT dxfc_dxpublisher_t *publisher)
Definition DXEndpoint.cpp:1192
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:781
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:1138
DXFCPP_EXPORT dxfc_error_code_t dxfc_dxendpoint_disconnect(dxfc_dxendpoint_t endpoint)
Terminates all remote network connections.
Definition DXEndpoint.cpp:1053
#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:951
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:1104
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:840
#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:1121
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:737
DXFCPP_EXPORT dxfc_error_code_t dxfc_dxendpoint_builder_free(dxfc_dxendpoint_builder_t builder)
Removes a builder from the registry.
Definition DXEndpoint.cpp:828
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:1019
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:1164
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:74
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:798
DXFCPP_EXPORT dxfc_error_code_t dxfc_dxendpoint_get_feed(dxfc_dxendpoint_t endpoint, DXFC_OUT dxfc_dxfeed_t *feed)
Definition DXEndpoint.cpp:1187
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:1087
DXFCPP_EXPORT dxfc_error_code_t dxfc_dxendpoint_close(dxfc_dxendpoint_t endpoint)
Closes this endpoint.
Definition DXEndpoint.cpp:934
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:688
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:1036
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:968
DXFCPP_EXPORT dxfc_error_code_t dxfc_dxendpoint_user(dxfc_dxendpoint_t endpoint, const char *user)
Changes username for this endpoint.
Definition DXEndpoint.cpp:985
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:887
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:863
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:704
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:910
DXFCPP_EXPORT dxfc_error_code_t dxfc_dxendpoint_free(dxfc_dxendpoint_t endpoint)
Removes the dxFeed endpoint from the registry.
Definition DXEndpoint.cpp:1197
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:1070
Builder class for DXEndpoint that supports additional configuration properties.
Definition DXEndpoint.hpp:866
std::shared_ptr< DXEndpoint > build()
Builds DXEndpoint instance.
Definition DXEndpoint.cpp:348
std::shared_ptr< Builder > withName(const StringLike &name)
Changes the name used to distinguish multiple endpoints in the same process (GraalVM Isolate) in logs...
Definition DXEndpoint.cpp:391
std::shared_ptr< Builder > withExecutor(const std::shared_ptr< Executor > &executor)
Sets the executor that is used for notifications (events, state changes, etc.) of the endpoint to bui...
Definition DXEndpoint.hpp:995
bool supportsProperty(const StringLike &key) const
Checks if a property is supported.
Definition DXEndpoint.cpp:338
std::shared_ptr< Builder > withProperties(Properties &&properties)
Sets all supported properties from the provided properties object.
Definition DXEndpoint.hpp:957
~Builder() noexcept override
Releases the GraalVM handle.
Definition DXEndpoint.cpp:380
std::shared_ptr< Builder > withRole(Role role)
Sets role for the created DXEndpoint.
Definition DXEndpoint.cpp:300
std::shared_ptr< Builder > withProperty(const StringLike &key, const StringLike &value)
Sets the specified property.
Definition DXEndpoint.cpp:313
Subscription for a set of symbols and event types.
Definition DXFeedSubscription.hpp:45
bool containsEventType(const EventTypeEnum &eventType) override
Returns true if this subscription contains the corresponding event type.
Definition DXFeedSubscription.cpp:229
std::size_t addChangeListener(std::shared_ptr< ObservableSubscriptionChangeListener > listener) override
Adds subscription change listener.
Definition DXFeedSubscription.cpp:320
bool isClosed() override
Returns true if this subscription is closed.
Definition DXFeedSubscription.cpp:205
void addSymbols(SymbolIt begin, SymbolIt end) const
Adds the specified collection (using iterators) of symbols to the set of subscribed symbols.
Definition DXFeedSubscription.hpp:434
void close() const
Closes this subscription and makes it permanently detached.
Definition DXFeedSubscription.cpp:214
void setEventsBatchLimit(std::int32_t eventsBatchLimit) const
Sets maximum number of events in the single notification of OnEventHandler.
Definition DXFeedSubscription.cpp:366
std::unordered_set< EventTypeEnum > getEventTypes() override
Returns a set of subscribed event types.
Definition DXFeedSubscription.cpp:225
void setSymbols(std::initializer_list< SymbolWrapper > collection) const
Changes the set of subscribed symbols so that it contains just the symbols from the specified collect...
Definition DXFeedSubscription.cpp:260
void removeSymbols(SymbolIt begin, SymbolIt end) const
Removes the specified collection (using iterators) of symbols from the set of subscribed symbols.
Definition DXFeedSubscription.hpp:506
void removeSymbols(SymbolsCollection &&collection) const
Removes the specified collection of symbols from the set of subscribed symbols.
Definition DXFeedSubscription.hpp:532
static const std::int32_t MAX_BATCH_LIMIT
The maximum events' batch limit for a single notification in OnEventHandler.
Definition DXFeedSubscription.hpp:61
void removeSymbols(const SymbolWrapper &symbolWrapper) const
Removes the specified symbol from the set of subscribed symbols.
Definition DXFeedSubscription.cpp:279
void attach(std::shared_ptr< DXFeed > feed)
Attaches subscription to the specified feed.
Definition DXFeedSubscription.cpp:187
TimePeriod getAggregationPeriod() const
Returns the aggregation period for data for this subscription instance.
Definition DXFeedSubscription.cpp:294
std::string toString() const override
Returns a string representation of the current object.
Definition DXFeedSubscription.cpp:145
static const std::int32_t OPTIMAL_BATCH_LIMIT
The optimal events' batch limit for a single notification in OnEventHandler.
Definition DXFeedSubscription.hpp:56
std::size_t addEventListener(std::function< void(const std::vector< std::shared_ptr< EventT > > &)> &&listener)
Adds typed listener for events.
Definition DXFeedSubscription.hpp:675
void addSymbols(std::initializer_list< SymbolWrapper > collection) const
Adds the specified collection (initializer list) of symbols to the set of subscribed symbols.
Definition DXFeedSubscription.cpp:275
void setSymbols(SymbolsCollection &&collection) const
Changes the set of subscribed symbols so that it contains just the symbols from the specified collect...
Definition DXFeedSubscription.hpp:385
void setAggregationPeriod(const TimePeriod &aggregationPeriod) const
Sets the aggregation period for data.
Definition DXFeedSubscription.cpp:298
static std::shared_ptr< DXFeedSubscription > create(const EventTypeEnum &eventType)
Creates a detached subscription for a single event type.
Definition DXFeedSubscription.cpp:164
std::int32_t getEventsBatchLimit() const
Definition DXFeedSubscription.cpp:362
std::size_t addEventListener(EventListener &&listener)
Adds listener for events.
Definition DXFeedSubscription.hpp:620
static std::shared_ptr< DXFeedSubscription > create(EventTypesCollection &&eventTypes)
Creates a detached subscription for the given collection of event types.
Definition DXFeedSubscription.hpp:261
OnEventHandler & onEvent()
Returns a reference to an incoming events' handler (delegate), to which listeners can be added and re...
Definition DXFeedSubscription.cpp:314
void addSymbols(const SymbolsCollection &collection) const
Adds the specified collection of symbols to the set of subscribed symbols.
Definition DXFeedSubscription.hpp:460
void setSymbols(SymbolIt begin, SymbolIt end) const
Changes the set of subscribed symbols so that it contains just the symbols from the specified collect...
Definition DXFeedSubscription.hpp:359
void setAggregationPeriod(std::int64_t aggregationPeriod) const
Sets the aggregation period for data.
Definition DXFeedSubscription.cpp:306
void removeChangeListener(std::size_t changeListenerId) override
Removes subscription change listener by id.
Definition DXFeedSubscription.cpp:345
std::vector< SymbolWrapper > getDecoratedSymbols() const
Returns a set of decorated symbols (depending on the actual implementation of the subscription).
Definition DXFeedSubscription.cpp:251
void clear() const
Clears the set of subscribed symbols.
Definition DXFeedSubscription.cpp:233
void detach(std::shared_ptr< DXFeed > feed)
Detaches subscription from the specified feed.
Definition DXFeedSubscription.cpp:196
void addSymbols(const SymbolWrapper &symbolWrapper) const
Adds the specified symbol to the set of subscribed symbols.
Definition DXFeedSubscription.cpp:264
void setAggregationPeriod(std::chrono::milliseconds aggregationPeriod) const
Sets the aggregation period for data.
Definition DXFeedSubscription.cpp:302
void removeSymbols(std::initializer_list< SymbolWrapper > collection) const
Removes the specified collection (initializer list) of symbols from the set of subscribed symbols.
Definition DXFeedSubscription.cpp:290
std::vector< SymbolWrapper > getSymbols() const
Returns a set of subscribed symbols (depending on the actual implementation of the subscription).
Definition DXFeedSubscription.cpp:242
Extends DXFeedSubscription to conveniently subscribe to time-series of events for a set of symbols an...
Definition DXFeedSubscription.hpp:787
std::int64_t getFromTime()
Returns the earliest timestamp from which time-series of events shall be received.
Definition DXFeedSubscription.cpp:394
void setFromTime(std::chrono::milliseconds fromTime)
Sets the earliest timestamp from which time-series of events shall be received.
Definition DXFeedSubscription.cpp:405
void setFromTime(std::int64_t fromTime)
Sets the earliest timestamp from which time-series of events shall be received.
Definition DXFeedSubscription.cpp:398
bool in(std::uint32_t eventFlagsMask) const noexcept
Determines if the given flag is in the mask.
Definition IndexedEvent.cpp:27
std::uint32_t getFlag() const noexcept
Definition IndexedEvent.cpp:23
static bool isSnapshotSnip(const std::shared_ptr< Event > &event)
Determines if the given event is marked as a snapshot snip.
Definition EventFlag.hpp:344
friend std::int32_t operator|(const EventFlag &eventFlag1, std::int32_t eventFlag2) noexcept
Performs a bit or operation with two event flags.
Definition EventFlag.hpp:234
EventFlag() noexcept
Creates the invalid event flag.
Definition IndexedEvent.cpp:20
static bool isSnapshotBegin(const std::shared_ptr< Event > &event)
Determines if the given event marks the beginning of a snapshot.
Definition EventFlag.hpp:322
friend std::int32_t operator&(const EventFlag &eventFlag1, std::int32_t eventFlag2) noexcept
Performs a bit and operation with two event flags.
Definition EventFlag.hpp:256
static const EventFlag SNAPSHOT_SNIP
0x10 - A bitmask to get snapshot snip indicator from the value of eventFlags property.
Definition EventFlag.hpp:15
friend std::int32_t operator|(std::int32_t eventFlag1, const EventFlag &eventFlag2) noexcept
Performs a bit or operation with two event flags.
Definition EventFlag.hpp:245
static bool isPending(const std::shared_ptr< Event > &event)
Determines if the given event is in a pending state.
Definition EventFlag.hpp:365
friend std::int32_t operator&(std::int32_t eventFlag1, const EventFlag &eventFlag2) noexcept
Performs a bit and operation with two event flags.
Definition EventFlag.hpp:267
static const EventFlag SNAPSHOT_MODE
0x40 - A bitmask to set snapshot mode indicator into the value of eventFlags property.
Definition EventFlag.hpp:17
bool in(const EventFlagsMask &eventFlagsMask) const noexcept
Determines if the given flag is in the mask.
Definition EventFlag.hpp:211
static bool isRemove(const std::shared_ptr< Event > &event)
Determines if the given event is marked for removal.
Definition EventFlag.hpp:376
static bool isSnapshotEndOrSnip(const std::shared_ptr< Event > &event)
Determines if the given event marks the end of a snapshot or a snapshot snip.
Definition EventFlag.hpp:354
static const EventFlag TX_PENDING
0x01 - A bitmask to get transaction pending indicator from the value of eventFlags property.
Definition EventFlag.hpp:11
static const EventFlag SNAPSHOT_BEGIN
0x04 - A bitmask to get snapshot begin indicator from the value of eventFlags property.
Definition EventFlag.hpp:13
static const EventFlag REMOVE_SYMBOL
0x80 - For internal use.
Definition EventFlag.hpp:18
static const EventFlag SNAPSHOT_END
0x08 - A bitmask to get snapshot end indicator from the value of eventFlags property.
Definition EventFlag.hpp:14
static const EventFlag REMOVE_EVENT
0x02 - A bitmask to get removal indicator from the value of eventFlags property.
Definition EventFlag.hpp:12
static bool isSnapshotEnd(const std::shared_ptr< Event > &event)
Determines if the given event marks the end of a snapshot.
Definition EventFlag.hpp:333
constexpr std::uint32_t getMask() const noexcept
Returns an integer representation of an event mask.
Definition EventFlag.hpp:437
bool contains(const EventFlag &flag) const noexcept
Definition IndexedEvent.cpp:46
friend EventFlagsMask operator|(const EventFlagsMask &eventFlagsMask, const EventFlag &eventFlag) noexcept
Performs a bit or operation with an event flags' mask and an event flag.
Definition EventFlag.hpp:454
EventFlagsMask() noexcept
Creates an empty event flags mask.
Definition IndexedEvent.cpp:39
EventFlagsMask(std::initializer_list< EventFlag > eventFlags) noexcept
Creates event flags mask by initializer list with flags.
Definition IndexedEvent.cpp:42
EventFlagsMask(MaskType mask) noexcept
Create event flags mask by integer value.
Definition EventFlag.hpp:409
EventFlagsMask(EventFlagIt begin, EventFlagIt end) noexcept
Creates event flags mask by iterators of container with flags.
Definition EventFlag.hpp:419
friend EventFlagsMask operator&(const EventFlagsMask &eventFlagsMask, const EventFlag &eventFlag) noexcept
Performs a bit and operation with an event flags' mask and an event flag.
Definition EventFlag.hpp:465
The enumeration type that provides additional information about the dxFeed Graal C++-API event type.
Definition EventTypeEnum.hpp:29
bool isTimeSeries() const noexcept
Definition EventTypeEnum.cpp:148
const std::string & getClassName() const &noexcept
Definition EventTypeEnum.cpp:120
bool isLasting() const noexcept
Definition EventTypeEnum.cpp:140
bool isOnlyIndexed() const noexcept
Definition EventTypeEnum.cpp:152
bool isIndexed() const noexcept
Definition EventTypeEnum.cpp:144
std::uint32_t getId() const noexcept
Definition EventTypeEnum.cpp:112
bool isMarket() const noexcept
Definition EventTypeEnum.cpp:156
const std::string & getName() const &noexcept
Definition EventTypeEnum.cpp:116
Builder is a static inner class that provides a flexible and readable way to construct instances of t...
Definition HistoryEndpoint.hpp:113
std::shared_ptr< Builder > withAuthToken(const StringLike &authToken)
Sets the authentication token for the target endpoint.
Definition HistoryEndpoint.cpp:56
std::shared_ptr< Builder > withAddress(const StringLike &address)
Specifies the address for the target endpoint.
Definition HistoryEndpoint.cpp:38
std::shared_ptr< HistoryEndpoint > build() const
Builds and returns a configured instance of HistoryEndpoint.
Definition HistoryEndpoint.cpp:74
std::shared_ptr< Builder > withFormat(Format format)
Sets the format to be used for data handling.
Definition HistoryEndpoint.cpp:68
std::shared_ptr< Builder > withPassword(const StringLike &password)
Sets the password for the target endpoint.
Definition HistoryEndpoint.cpp:50
std::shared_ptr< Builder > withUserName(const StringLike &userName)
Sets the username for the target endpoint.
Definition HistoryEndpoint.cpp:44
std::shared_ptr< Builder > withCompression(Compression compression)
Sets the compression type to be used for data transmission or storage.
Definition HistoryEndpoint.cpp:62
std::shared_ptr< Builder > withAuthToken(const AuthToken &authToken)
Sets the authentication token for the target endpoint.
Definition HistoryEndpoint.hpp:160
Source identifier for IndexedEvent.
Definition IndexedEventSource.hpp:29
static void freeGraal(void *graalNative)
Releases the memory occupied by the dxFeed Graal SDK structure (recursively if necessary).
Definition IndexedEventSource.cpp:18
IndexedEventSource(std::int32_t id, const StringLike &name) noexcept
Creates the new IndexedEvent's source by id and name.
Definition IndexedEventSource.cpp:49
const std::string & name() const noexcept
Returns the string representation of the object.
Definition IndexedEventSource.cpp:56
static IndexedEventSource fromGraal(void *graalNative)
Creates an object of the current type and fills it with data from the dxFeed Graal SDK structure.
Definition IndexedEventSource.cpp:33
static const IndexedEventSource DEFAULT
The default source with zero identifier for all events that do not support multiple sources.
Definition IndexedEventSource.hpp:10
std::int32_t id() const noexcept
Returns the source identifier.
Definition IndexedEventSource.cpp:52
virtual void * toGraal() const
Allocates memory for the dxFeed Graal SDK structure (recursively if necessary).
Definition IndexedEventSource.cpp:12
std::string toString() const
Returns the string representation of the object.
Definition IndexedEventSource.cpp:60
Represents a subscription to a specific source of indexed events.
Definition IndexedEventSubscriptionSymbol.hpp:42
virtual const std::unique_ptr< SymbolWrapper > & getEventSymbol() const
Returns the wrapped event symbol (CandleSymbol, WildcardSymbol, etc.).
Definition IndexedEventSubscriptionSymbol.cpp:18
virtual void * toGraal() const
Allocates memory for the dxFeed Graal SDK structure (recursively if necessary).
Definition IndexedEventSubscriptionSymbol.cpp:26
static IndexedEventSubscriptionSymbol fromGraal(void *graalNative)
Creates an object of the current type and fills it with data from the dxFeed Graal SDK structure (rec...
Definition IndexedEventSubscriptionSymbol.cpp:48
virtual const std::unique_ptr< IndexedEventSource > & getSource() const
Returns indexed event source.
Definition IndexedEventSubscriptionSymbol.cpp:22
IndexedEventSubscriptionSymbol(const SymbolWrapper &eventSymbol, const IndexedEventSource &source)
Creates an indexed event subscription symbol with a specified event symbol and source.
Definition IndexedEventSubscriptionSymbol.cpp:12
static void freeGraal(void *graalNative)
Releases the memory occupied by the dxFeed Graal SDK structure (recursively if necessary).
Definition IndexedEventSubscriptionSymbol.cpp:35
virtual std::string toString() const
Returns string representation of this indexed event subscription symbol.
Definition IndexedEventSubscriptionSymbol.cpp:64
static JavaObjectHandleRegistry & getInstance() noexcept
Returns the process-wide handle registry.
Definition JavaObjectHandle.cpp:68
void releaseAll() noexcept
Releases all currently registered handles while the Graal isolate is still available.
Definition JavaObjectHandle.cpp:125
void reset(void *handle=nullptr) noexcept
Replaces the owned handle, releasing the previous one.
Definition JavaObjectHandle.cpp:163
JavaObjectHandleState(void *handle, Deleter deleter) noexcept
Creates an ownership state for a native handle.
Definition JavaObjectHandle.cpp:150
void * get() const noexcept
Returns the currently owned native handle.
Definition JavaObjectHandle.hpp:115
void moveFrom(JavaObjectHandleState &other) noexcept
Transfers ownership from another state and releases the handle previously owned by this state.
Definition JavaObjectHandle.cpp:159
~JavaObjectHandleState() noexcept
Releases the owned handle, if any, and unregisters the state.
Definition JavaObjectHandle.cpp:155
static const OrderSource GLBX
CME Globex.
Definition OrderSource.hpp:359
static const OrderSource smfe
Small Exchange.
Definition OrderSource.hpp:423
static const OrderSource bzx
Bats BZX Exchange.
Definition OrderSource.hpp:287
static const OrderSource DEX
Direct-Edge EDGX Exchange.
Definition OrderSource.hpp:254
static const OrderSource NTV
NASDAQ Total View.
Definition OrderSource.hpp:190
static const OrderSource AGGREGATE_ASK
Ask side of an aggregate order book (futures depth and NASDAQ Level II).
Definition OrderSource.hpp:143
static const OrderSource & valueOf(std::int32_t sourceId)
Returns order source for the specified source identifier.
Definition OrderSource.cpp:198
static const OrderSource ESPD
NASDAQ eSpeed.
Definition OrderSource.hpp:214
static const OrderSource CFE
CBOE Futures Exchange.
Definition OrderSource.hpp:399
static const OrderSource ntv
NASDAQ Total View.
Definition OrderSource.hpp:198
static const OrderSource ICE
Intercontinental Exchange.
Definition OrderSource.hpp:230
static const OrderSource BZX
Bats BZX Exchange.
Definition OrderSource.hpp:279
static const OrderSource C2OX
CBOE Options C2 Exchange.
Definition OrderSource.hpp:407
static const OrderSource AGGREGATE
Aggregate order book (futures depth and NASDAQ Level II).
Definition OrderSource.hpp:175
static const OrderSource REGIONAL_ASK
Ask side of a regional Quote.
Definition OrderSource.hpp:127
static const OrderSource REGIONAL_BID
Bid side of a regional Quote.
Definition OrderSource.hpp:118
static const OrderSource igc
IG CFDs Gate.
Definition OrderSource.hpp:519
static const OrderSource ABE
ABE (abe.io) exchange.
Definition OrderSource.hpp:343
static const OrderSource CEUX
Bats Europe DXE Exchange.
Definition OrderSource.hpp:311
static const OrderSource OCEA
Blue Ocean Technologies Alternative Trading System.
Definition OrderSource.hpp:455
static const OrderSource AGGREGATE_BID
Bid side of an aggregate order book (futures depth and NASDAQ Level II).
Definition OrderSource.hpp:135
static const OrderSource BXTR
Bats Europe TRF.
Definition OrderSource.hpp:319
static const OrderSource & valueOf(const StringLike &name)
Returns order source for the specified source name.
Definition OrderSource.cpp:212
static const OrderSource dex
Direct-Edge EDGX Exchange.
Definition OrderSource.hpp:263
static const OrderSource cedx
Cboe European Derivatives.
Definition OrderSource.hpp:503
static const OrderSource COMPOSITE
Composite Quote.
Definition OrderSource.hpp:154
static const OrderSource COMPOSITE_ASK
Ask side of a composite Quote.
Definition OrderSource.hpp:109
static const OrderSource REGIONAL
Regional Quote.
Definition OrderSource.hpp:165
static const OrderSource XNFI
NASDAQ Fixed Income.
Definition OrderSource.hpp:222
static const OrderSource iex
Investors exchange.
Definition OrderSource.hpp:431
static const OrderSource xeur
Eurex Exchange.
Definition OrderSource.hpp:391
static const OrderSource CEDX
Cboe European Derivatives.
Definition OrderSource.hpp:495
static const OrderSource ISE
International Securities Exchange.
Definition OrderSource.hpp:238
static const OrderSource DEA
Direct-Edge EDGA Exchange.
Definition OrderSource.hpp:246
static const OrderSource glbx
CME Globex.
Definition OrderSource.hpp:367
static const OrderSource ocea
Blue Ocean Technologies Alternative Trading System.
Definition OrderSource.hpp:462
static const OrderSource EDX
EDX Exchange.
Definition OrderSource.hpp:527
static const OrderSource BI20
Borsa Istanbul Exchange.
Definition OrderSource.hpp:335
static const OrderSource NUAM
Nuam Exchange Gate.
Definition OrderSource.hpp:543
static const OrderSource BYX
Bats BYX Exchange.
Definition OrderSource.hpp:271
static const OrderSource IGC
IG CFDs Gate.
Definition OrderSource.hpp:511
static const OrderSource FAIR
FAIR (FairX) exchange.
Definition OrderSource.hpp:351
static const OrderSource BATE
Bats Europe BXE Exchange.
Definition OrderSource.hpp:295
static const OrderSource pink
Pink Sheets.
Definition OrderSource.hpp:471
static const OrderSource DEFAULT
Default source for publishing custom order books.
Definition OrderSource.hpp:182
static const OrderSource NFX
NASDAQ Futures Exchange.
Definition OrderSource.hpp:206
static const OrderSource memx
Members Exchange.
Definition OrderSource.hpp:447
static bool isSpecialSourceId(std::int32_t sourceId) noexcept
Determines whether the specified source identifier refers to a special order source.
Definition OrderSource.cpp:194
static const OrderSource IST
Borsa Istanbul Exchange.
Definition OrderSource.hpp:327
static const OrderSource edx
EDX Exchange.
Definition OrderSource.hpp:535
static const OrderSource ARCA
NYSE Arca traded securities.
Definition OrderSource.hpp:479
static const OrderSource CHIX
Bats Europe CXE Exchange.
Definition OrderSource.hpp:303
static const OrderSource ERIS
Eris Exchange group of companies.
Definition OrderSource.hpp:375
static const OrderSource nuam
Nuam Exchange Gate.
Definition OrderSource.hpp:551
static const OrderSource XEUR
Eurex Exchange.
Definition OrderSource.hpp:383
static const OrderSource MEMX
Members Exchange.
Definition OrderSource.hpp:439
static const OrderSource COMPOSITE_BID
Bid side of a composite Quote.
Definition OrderSource.hpp:100
static const OrderSource arca
NYSE Arca traded securities.
Definition OrderSource.hpp:487
static const OrderSource SMFE
Small Exchange.
Definition OrderSource.hpp:415
TimeSeriesSubscriptionSymbol(const SymbolWrapper &eventSymbol, std::int64_t fromTime)
Creates a time-series subscription symbol with a specified event symbol and subscription time.
void * toGraal() const override
Allocates memory for the dxFeed Graal SDK structure (recursively if necessary).
Definition TimeSeriesSubscriptionSymbol.cpp:19
std::string toString() const override
Returns string representation of this time-series subscription symbol.
Definition TimeSeriesSubscriptionSymbol.cpp:66
std::int64_t getFromTime() const
Returns the subscription time.
Definition TimeSeriesSubscriptionSymbol.cpp:15
static TimeSeriesSubscriptionSymbol fromGraal(void *graalNative)
Creates an object of the current type and fills it with data from the dxFeed Graal SDK structure (rec...
Definition TimeSeriesSubscriptionSymbol.cpp:50
static void freeGraal(void *graalNative)
Releases the memory occupied by the dxFeed Graal SDK structure (recursively if necessary).
Definition TimeSeriesSubscriptionSymbol.cpp:33
Thread-safe registry that associates callback identifiers with entities without owning them.
Definition EntityManager.hpp:180
bool unregisterEntity(const H *handle)
Unregisters an entity using a constant opaque callback handle.
Definition EntityManager.hpp:303
std::optional< Id< EntityIdType > > getId(const std::shared_ptr< EntityType > &entity)
Definition EntityManager.hpp:360
bool unregisterEntity(H *handle)
Unregisters an entity using an opaque callback handle.
Definition EntityManager.hpp:292
bool unregisterEntity(const std::shared_ptr< EntityType > &entity)
Unregisters an entity.
Definition EntityManager.hpp:254
bool unregisterEntity(Id< EntityIdType > id)
Unregisters an entity by identifier.
Definition EntityManager.hpp:273
std::shared_ptr< EntityType > getEntity(H *handle)
Locks and returns the entity identified by an opaque callback handle.
Definition EntityManager.hpp:339
Id< EntityIdType > registerEntity(const std::shared_ptr< EntityType > &entity)
Registers an entity and returns its callback identifier.
Definition EntityManager.hpp:221
bool contains(const std::shared_ptr< EntityType > &entity)
Definition EntityManager.hpp:384
WeakEntityManager()=default
Constructs an empty weak entity registry.
std::shared_ptr< EntityType > getEntity(const H *handle)
Locks and returns the entity identified by a constant opaque callback handle.
Definition EntityManager.hpp:350
std::size_t getLastId()
Definition EntityManager.hpp:243
bool contains(Id< EntityIdType > id)
Definition EntityManager.hpp:355
std::shared_ptr< EntityType > getEntity(Id< EntityIdType > id)
Locks and returns the entity registered for an identifier.
Definition EntityManager.hpp:315
DXFCPP_END_NAMESPACE dxfcpp::EventFlagsMask operator|(const dxfcpp::EventFlag &eventFlag1, const dxfcpp::EventFlag &eventFlag2) noexcept
Performs a bit or operation with two event flags.
Definition EventFlag.hpp:482
SessionTypeEnum
Definition SessionType.hpp:24
SessionFilterEnum
Definition SessionFilter.hpp:23
@ NO_TRADING
Non-trading session type is used to mark periods of time during which trading is not allowed.
Definition SessionType.hpp:26
@ REGULAR
Regular session type marks regular trading hours session.
Definition SessionType.hpp:30
@ AFTER_MARKET
After-market session type marks extended trading session after regular trading hours.
Definition SessionType.hpp:32
@ PRE_MARKET
Pre-market session type marks extended trading session before regular trading hours.
Definition SessionType.hpp:28
@ NO_TRADING
Accepts any session with type SessionType::NO_TRADING.
Definition SessionFilter.hpp:32
@ REGULAR
Accepts any session with type SessionType::REGULAR.
Definition SessionFilter.hpp:36
@ ANY
Accepts any session - useful for pure schedule navigation.
Definition SessionFilter.hpp:25
@ AFTER_MARKET
Accepts any session with type SessionType::AFTER_MARKET.
Definition SessionFilter.hpp:38
@ TRADING
Accepts trading sessions only - those with (Session::isTrading() == true).
Definition SessionFilter.hpp:27
@ PRE_MARKET
Accepts any session with type SessionType::PRE_MARKET.
Definition SessionFilter.hpp:34
@ NON_TRADING
Accepts non-trading sessions only - those with (Session::isTrading() == false).
Definition SessionFilter.hpp:29
The AuthToken class represents an authorization token and encapsulates information about the authoriz...
Definition AuthToken.hpp:36
std::string getScheme() const
Returns the authentication scheme.
Definition AuthToken.cpp:82
static const std::string BEARER_SCHEME
String representation for the Bearer (token) authorization.
Definition AuthToken.hpp:14
std::string getPassword() const
Returns the password or dxfcpp::String::NUL (std::string{"<null>"}) if it is not known or applicable.
Definition AuthToken.cpp:74
static AuthToken createBasicToken(const StringLike &user, const StringLike &password)
Constructs an AuthToken with the specified username and password per RFC2617.
Definition AuthToken.cpp:26
static const std::string BASIC_SCHEME
String representation for Basic (Base64(login:password)) authorization.
Definition AuthToken.hpp:13
static AuthToken createBasicTokenOrNull(const StringLike &user, const StringLike &password)
Constructs an AuthToken with the specified username and password per RFC2617.
Definition AuthToken.cpp:30
std::string getHttpAuthorization() const
Returns the HTTP authorization header value.
Definition AuthToken.cpp:58
static AuthToken createBearerToken(const StringLike &token)
Constructs an AuthToken with the specified bearer token per RFC6750.
Definition AuthToken.cpp:40
static AuthToken createCustomToken(const StringLike &scheme, const StringLike &value)
Constructs an AuthToken with a custom scheme and value.
Definition AuthToken.cpp:54
std::string getValue() const
Returns the access token for RFC6750 or the Base64-encoded "username:password" for RFC2617.
Definition AuthToken.cpp:90
static AuthToken createBearerTokenOrNull(const StringLike &token)
Constructs an AuthToken with the specified bearer token per RFC6750.
Definition AuthToken.cpp:44
std::string getUser() const
Returns the username or dxfcpp::String::NUL (std::string{"<null>"}) if it is not known or applicable.
Definition AuthToken.cpp:66
static const AuthToken NULL_TOKEN
A stub that is needed to simulate null AuthToken without using std::optional.
Definition AuthToken.hpp:44
static AuthToken valueOf(const StringLike &string)
Constructs an AuthToken from the specified string.
Definition AuthToken.cpp:18
static AuthToken createBasicToken(const StringLike &userPassword)
Constructs an AuthToken with the specified username and password per RFC2617.
Definition AuthToken.cpp:22
Candle alignment attribute of CandleSymbol defines how candles are aligned with respect to time.
Definition CandleAlignment.hpp:37
static const CandleAlignment DEFAULT
Default alignment is CandleAlignment::MIDNIGHT.
Definition CandleAlignment.hpp:51
static const CandleAlignment MIDNIGHT
Align candles at midnight.
Definition CandleAlignment.hpp:14
static const CandleAlignment SESSION
Align candles on trading sessions.
Definition CandleAlignment.hpp:15
static std::reference_wrapper< const CandleAlignment > getAttributeForSymbol(const StringLike &symbol)
Returns candle alignment of the given candle symbol string.
Definition CandleAlignment.cpp:50
std::string toString() const
Returns string representation of this candle alignment.
Definition CandleAlignment.cpp:28
static std::reference_wrapper< const CandleAlignment > parse(const StringLike &s)
Parses string representation of candle alignment into an object.
Definition CandleAlignment.cpp:36
static const std::string ATTRIBUTE_KEY
The attribute key that is used to store the value of CandleAlignment in a symbol string using methods...
Definition CandleAlignment.hpp:17
std::string changeAttributeForSymbol(const StringLike &symbol) const override
Returns candle event symbol string with this candle alignment set.
Definition CandleAlignment.cpp:23
static std::string normalizeAttributeForSymbol(const StringLike &symbol)
Returns candle symbol string with the normalized representation of the candle alignment attribute.
Definition CandleAlignment.cpp:56
Exchange attribute of CandleSymbol defines the exchange identifier where data is taken from to build ...
Definition CandleExchange.hpp:34
char getExchangeCode() const noexcept
Returns exchange code.
Definition CandleExchange.cpp:17
static const CandleExchange DEFAULT
Default exchange is CandleExchange::COMPOSITE.
Definition CandleExchange.hpp:43
std::string toString() const
Returns string representation of this exchange.
Definition CandleExchange.cpp:25
std::string changeAttributeForSymbol(const StringLike &symbol) const override
Returns candle event symbol string with this exchange set.
Definition CandleExchange.cpp:21
static CandleExchange valueOf(char exchangeCode) noexcept
Returns an exchange attribute object that corresponds to the specified exchange code character.
Definition CandleExchange.cpp:33
static CandleExchange getAttributeForSymbol(const StringLike &symbol)
Returns exchange an attribute object of the given candle symbol string.
Definition CandleExchange.cpp:37
static const CandleExchange COMPOSITE
Composite exchange where data is taken from all exchanges.
Definition CandleExchange.hpp:32
Period attribute of CandleSymbol defines an aggregation period of the candles.
Definition CandlePeriod.hpp:41
double getValue() const noexcept
Returns aggregation period value.
Definition CandlePeriod.cpp:27
static const std::string ATTRIBUTE_KEY
The attribute key that is used to store the value of CandlePeriod in a symbol string using methods of...
Definition CandlePeriod.hpp:80
static const CandlePeriod TICK
Tick aggregation where each candle represents an individual tick.
Definition CandlePeriod.hpp:77
static std::string normalizeAttributeForSymbol(const StringLike &symbol)
Returns candle symbol string with the normalized representation of the candle period attribute.
Definition CandlePeriod.cpp:96
static CandlePeriod valueOf(double value, const CandleType &type) noexcept
Returns candle period with the given value and type.
Definition CandlePeriod.cpp:78
static const CandlePeriod DEFAULT
The default period is CandlePeriod::TICK.
Definition CandlePeriod.hpp:55
std::int64_t getPeriodIntervalMillis() const noexcept
Returns an aggregation period in milliseconds as closely as possible.
Definition CandlePeriod.cpp:18
static const CandlePeriod DAY
Day aggregation where each candle represents a day.
Definition CandlePeriod.hpp:78
const CandleType & getType() const &noexcept
Returns aggregation period type.
Definition CandlePeriod.cpp:31
const std::string & toString() const &
Returns string representation of this aggregation period.
Definition CandlePeriod.cpp:35
std::string changeAttributeForSymbol(const StringLike &symbol) const override
Returns candle event symbol string with this aggregation period set.
Definition CandlePeriod.cpp:22
static CandlePeriod parse(const StringLike &s)
Parses string representation of an aggregation period into an object.
Definition CandlePeriod.cpp:50
static CandlePeriod getAttributeForSymbol(const StringLike &symbol)
Returns candle period of the given candle symbol string.
Definition CandlePeriod.cpp:90
Candle price level attribute of CandleSymbol defines how candles shall be aggregated in respect to a ...
Definition CandlePriceLevel.hpp:45
std::string changeAttributeForSymbol(const StringLike &symbol) const override
Returns candle event symbol string with this candle price level set.
Definition CandlePriceLevel.cpp:33
static CandlePriceLevel valueOf(double value)
Returns candle price level with the given value.
Definition CandlePriceLevel.cpp:57
static const CandlePriceLevel DEFAULT
Default price level corresponds to NaN (std::numeric_limits<double>::quiet_NaN())
Definition CandlePriceLevel.hpp:108
static CandlePriceLevel parse(const StringLike &s)
Parses string representation of candle price level into an object.
Definition CandlePriceLevel.cpp:38
std::string toString() const
Returns string representation of this price level.
Definition CandlePriceLevel.cpp:25
double getValue() const noexcept
Returns price level value.
Definition CandlePriceLevel.cpp:21
static const std::string ATTRIBUTE_KEY
The attribute key that is used to store the value of CandlePriceLevel in a symbol string using method...
Definition CandlePriceLevel.hpp:110
static std::string normalizeAttributeForSymbol(const StringLike &symbol)
Returns candle symbol string with the normalized representation of the candle price level attribute.
Definition CandlePriceLevel.cpp:71
static CandlePriceLevel getAttributeForSymbol(const StringLike &symbol)
Returns candle price level of the given candle symbol string.
Definition CandlePriceLevel.cpp:65
Price type attribute of CandleSymbol defines the price used to build the candles.
Definition CandlePrice.hpp:39
static std::reference_wrapper< const CandlePrice > getAttributeForSymbol(const StringLike &symbol)
Returns the candle price type of the given candle symbol string.
Definition CandlePrice.cpp:52
static std::string normalizeAttributeForSymbol(const StringLike &symbol)
Returns candle symbol string with the normalized representation of the candle price type attribute.
Definition CandlePrice.cpp:58
static const CandlePrice BID
Quote bid price.
Definition CandlePrice.hpp:85
static const CandlePrice ASK
Quote ask price.
Definition CandlePrice.hpp:86
static const CandlePrice MARK
Market price defined as average between quote bid and ask prices.
Definition CandlePrice.hpp:87
const std::string & toString() const &noexcept
Returns string representation of this candle price type.
Definition CandlePrice.cpp:25
static const CandlePrice DEFAULT
The default price type is CandlePrice::LAST.
Definition CandlePrice.hpp:70
static const CandlePrice SETTLEMENT
Official settlement price that is defined by exchange or last trading price otherwise.
Definition CandlePrice.hpp:88
static const CandlePrice LAST
Last trading price.
Definition CandlePrice.hpp:84
static std::reference_wrapper< const CandlePrice > parse(const StringLike &s)
Parses string representation of a candle price type into an object.
Definition CandlePrice.cpp:33
std::string changeAttributeForSymbol(const StringLike &symbol) const override
Returns candle event symbol string with this candle price type set.
Definition CandlePrice.cpp:20
static const std::string ATTRIBUTE_KEY
The attribute key that is used to store the value of CandlePrice in a symbol string using methods of ...
Definition CandlePrice.hpp:91
const std::string & toString() const &noexcept
Returns string representation of this candle session attribute.
Definition CandleSession.cpp:103
static const CandleSession REGULAR
Only regular trading session data is used to build candles.
Definition CandleSession.hpp:134
const SessionFilter & getSessionFilter() const &noexcept
Returns a session filter that corresponds to this session attribute.
Definition CandleSession.cpp:94
static std::reference_wrapper< const CandleSession > getAttributeForSymbol(const StringLike &symbol)
Returns candle session attribute of the given candle symbol string.
Definition CandleSession.cpp:130
static const CandleSession ANY
All trading sessions are used to build candles.
Definition CandleSession.hpp:133
static const std::string ATTRIBUTE_KEY
The attribute key that is used to store the value of CandleSession in a symbol string using methods o...
Definition CandleSession.hpp:65
std::string changeAttributeForSymbol(const StringLike &symbol) const override
Returns candle event symbol string with this session attribute set.
Definition CandleSession.cpp:98
static std::reference_wrapper< const CandleSession > parse(const StringLike &s)
Parses string representation of the candle session attribute into an object.
Definition CandleSession.cpp:111
static const CandleSession DEFAULT
The default trading session is CandleSession::ANY.
Definition CandleSession.hpp:56
static std::string normalizeAttributeForSymbol(const StringLike &symbol) noexcept
Returns candle symbol string with the normalized representation of the candle session attribute.
Definition CandleSession.cpp:136
Attribute of the CandleSymbol.
Definition CandleSymbolAttribute.hpp:24
virtual std::string changeAttributeForSymbol(const StringLike &symbol) const =0
Returns candle event symbol string with this attribute set.
Symbol that should be used with DXFeedSubscription class to subscribe for Candle events.
Definition CandleSymbol.hpp:87
static CandleSymbol valueOf(const StringLike &symbol, std::initializer_list< CandleSymbolAttributeVariant > attributes)
Converts the given string symbol into the candle symbol object with the specified attributes set (ini...
Definition CandleSymbol.cpp:337
const std::optional< CandlePeriod > & getPeriod() const &noexcept
Returns the aggregation period of this symbol.
Definition CandleSymbol.cpp:225
const std::optional< CandlePriceLevel > & getPriceLevel() const &noexcept
Returns the price level attribute of this symbol.
Definition CandleSymbol.cpp:233
const std::optional< CandleExchange > & getExchange() const &noexcept
Returns exchange attribute of this symbol.
Definition CandleSymbol.cpp:213
const std::string & getBaseSymbol() const &noexcept
Returns base market symbol without attributes.
Definition CandleSymbol.cpp:209
static CandleSymbol valueOf(const StringLike &symbol)
Converts the given string symbol into the candle symbol object.
Definition CandleSymbol.cpp:329
static CandleSymbol valueOf(const StringLike &symbol, const CandleSymbolAttributeVariant &attribute)
Converts the given string symbol into the candle symbol object with the specified attribute set.
Definition CandleSymbol.cpp:333
const std::optional< CandlePrice > & getPrice() const &noexcept
Returns the price type attribute of this symbol.
Definition CandleSymbol.cpp:217
static CandleSymbol valueOf(const StringLike &symbol, CandleSymbolAttributeIt begin, CandleSymbolAttributeIt end)
Converts the given string symbol into the candle symbol object with the specified attribute set (iter...
Definition CandleSymbol.hpp:250
virtual void * toGraal() const
Allocates memory for the dxFeed Graal SDK structure (recursively if necessary).
Definition CandleSymbol.cpp:287
const std::string & toString() const &noexcept
Returns string representation of this symbol.
Definition CandleSymbol.cpp:237
static void freeGraal(void *graalNative)
Releases the memory occupied by the dxFeed Graal SDK structure (recursively if necessary).
Definition CandleSymbol.cpp:298
const std::optional< CandleSession > & getSession() const &noexcept
Returns the session attribute of this symbol.
Definition CandleSymbol.cpp:221
static CandleSymbol fromGraal(void *graalNative)
Creates an object of the current type and fills it with data from the dxFeed Graal SDK structure.
Definition CandleSymbol.cpp:314
const std::optional< CandleAlignment > & getAlignment() const &noexcept
Returns alignment attribute of this symbol.
Definition CandleSymbol.cpp:229
Type of the candle aggregation period constitutes CandlePeriod type together its actual value.
Definition CandleType.hpp:29
static const CandleType VOLUME
Certain volume of trades.
Definition CandleType.hpp:78
static const CandleType MONTH
Certain number of months.
Definition CandleType.hpp:63
static const CandleType PRICE_RENKO
Certain price change, calculated according to the following rules:
Definition CandleType.hpp:113
static const CandleType DAY
Certain number of days.
Definition CandleType.hpp:42
std::int64_t getPeriodIntervalMillis() const noexcept
Returns a candle type period in milliseconds as closely as possible.
Definition CandleType.cpp:22
static const CandleType WEEK
Certain number of weeks.
Definition CandleType.hpp:43
static const CandleType TICK
Certain number of ticks.
Definition CandleType.hpp:38
static const CandleType HOUR
Certain number of hours.
Definition CandleType.hpp:41
static const CandleType PRICE
Certain price change, calculated according to the following rules:
Definition CandleType.hpp:89
static std::reference_wrapper< const CandleType > parse(const StringLike &s)
Parses string representation of a candle type into an object.
Definition CandleType.cpp:34
const std::string & toString() const &noexcept
Returns string representation of this candle type.
Definition CandleType.cpp:30
static const CandleType OPTEXP
Certain number of option expirations.
Definition CandleType.hpp:68
static const CandleType SECOND
Certain number of seconds.
Definition CandleType.hpp:39
static const CandleType MINUTE
Certain number of minutes.
Definition CandleType.hpp:40
const std::string & getName() const &noexcept
Returns a name of this candle type.
Definition CandleType.cpp:26
static const CandleType PRICE_MOMENTUM
Certain price change, calculated according to the following rules:
Definition CandleType.hpp:101
static const CandleType YEAR
Certain number of years.
Definition CandleType.hpp:73
Mixin for wrapping calls to common promise methods.
Definition Promise.hpp:80
JavaException getException() const
Returns exceptional outcome of computation.
Definition Promise.hpp:128
void cancel() const
This method cancels computation.
Definition Promise.hpp:175
bool hasResult() const
Returns true when computation has completed normally.
Definition Promise.hpp:96
bool isCancelled() const
Returns true when computation was cancelled.
Definition Promise.hpp:115
bool hasException() const
Returns true when a computation has completed exceptionally or was canceled.
Definition Promise.hpp:105
bool awaitWithoutException(const std::chrono::milliseconds &timeoutInMilliseconds) const
Wait for computation to complete or timeout or throw an exception in case of exceptional completion.
Definition Promise.hpp:162
bool isDone() const
Returns true when a computation has completed normally, or exceptionally, or was canceled.
Definition Promise.hpp:86
bool awaitWithoutException(std::int32_t timeoutInMilliseconds) const
Wait for computation to complete or timeout or throw an exception in case of exceptional completion.
Definition Promise.hpp:145
Manages network connections to feed or publisher.
Definition DXEndpoint.hpp:179
bool isClosed() const
Definition DXEndpoint.cpp:540
SimpleHandler< void(DXEndpoint::State, DXEndpoint::State)> & onStateChange() noexcept
Returns the onStateChange handler that can be used to add or remove listeners.
Definition DXEndpoint.cpp:552
static const std::string DXFEED_PASSWORD_PROPERTY
"dxfeed.password"
Definition DXEndpoint.hpp:246
static std::shared_ptr< DXEndpoint > create(Role role)
Creates an endpoint with a specified role.
Definition DXEndpoint.cpp:527
std::shared_ptr< DXFeed > getFeed() const
Definition DXEndpoint.cpp:227
std::shared_ptr< DXEndpoint > password(const StringLike &password)
Changes password for this endpoint.
Definition DXEndpoint.cpp:154
State
Represents the current state of endpoint.
Definition DXEndpoint.hpp:444
@ CLOSED
Endpoint was closed.
Definition DXEndpoint.hpp:464
@ CONNECTING
The connect method was called to establish connection to remove endpoint, but the connection is not e...
Definition DXEndpoint.hpp:454
@ CONNECTED
The connection to the remote endpoint is established.
Definition DXEndpoint.hpp:459
@ NOT_CONNECTED
Endpoint was created by is not connected to remote endpoints.
Definition DXEndpoint.hpp:448
std::shared_ptr< DXEndpoint > user(const StringLike &user)
Changes username for this endpoint.
Definition DXEndpoint.cpp:147
void reconnect() const
Terminates all established network connections and initiates connecting again with the same address.
Definition DXEndpoint.cpp:173
static std::shared_ptr< DXEndpoint > create()
Creates an endpoint with FEED role.
Definition DXEndpoint.cpp:518
void removeStateChangeListener(std::size_t listenerId) noexcept
Removes a listener notified about changes in state property.
Definition DXEndpoint.cpp:548
const std::string & getName() const &noexcept
Definition DXEndpoint.cpp:544
Role
Represents the role of an endpoint that was specified during its creation.
Definition DXEndpoint.hpp:373
@ PUBLISHER
PUBLISHER endpoint connects to the remote publisher hub (also known as multiplexor) or creates a publ...
Definition DXEndpoint.hpp:418
@ STREAM_FEED
STREAM_FEED endpoint is similar to DXEndpoint::FEED and also connects to the remote data feed provide...
Definition DXEndpoint.hpp:406
@ LOCAL_HUB
LOCAL_HUB endpoint is a local hub without the ability to establish network connections.
Definition DXEndpoint.hpp:434
@ ON_DEMAND_FEED
ON_DEMAND_FEED endpoint is similar to DXEndpoint::FEED, but it is designed to be used with OnDemandSe...
Definition DXEndpoint.hpp:397
@ STREAM_PUBLISHER
STREAM_PUBLISHER endpoint is similar to DXEndpoint::PUBLISHER and also connects to the remote publish...
Definition DXEndpoint.hpp:427
@ FEED
FEED endpoint connects to the remote data feed provider and is optimized for real-time or delayed dat...
Definition DXEndpoint.hpp:384
std::string toString() const override
Returns a string representation of the current object.
Definition DXEndpoint.cpp:401
void awaitProcessed() const
Waits until this endpoint stops processing data (becomes quiescent).
Definition DXEndpoint.cpp:209
std::shared_ptr< DXPublisher > getPublisher() const
Definition DXEndpoint.cpp:236
static const std::string DXFEED_WILDCARD_ENABLE_PROPERTY
"dxfeed.wildcard.enable"
Definition DXEndpoint.hpp:274
std::size_t addStateChangeListener(std::function< void(State, State)> listener) noexcept
Adds a listener notified about changes in state property.
Definition DXEndpoint.hpp:619
static const std::string DXENDPOINT_EVENT_TIME_PROPERTY
"dxendpoint.eventTime"
Definition DXEndpoint.hpp:319
static const std::string DXPUBLISHER_THREAD_POOL_SIZE_PROPERTY
"dxpublisher.threadPoolSize"
Definition DXEndpoint.hpp:302
State getState() const
Returns the state of this endpoint.
Definition DXEndpoint.cpp:143
static const std::string DXENDPOINT_STORE_EVERYTHING_PROPERTY
"dxendpoint.storeEverything"
Definition DXEndpoint.hpp:332
void awaitNotConnected() const
Waits while this endpoint state becomes NOT_CONNECTED or CLOSED.
Definition DXEndpoint.cpp:200
static std::shared_ptr< DXEndpoint > getInstance(Role role)
Returns a default application-wide singleton instance of DXEndpoint for a specific role.
Definition DXEndpoint.cpp:500
static const std::string DXFEED_AGGREGATION_PERIOD_PROPERTY
"dxfeed.aggregationPeriod"
Definition DXEndpoint.hpp:265
void close() const
Closes this endpoint.
Definition DXEndpoint.cpp:556
static const std::string DXFEED_THREAD_POOL_SIZE_PROPERTY
"dxfeed.threadPoolSize"
Definition DXEndpoint.hpp:255
void disconnect() const
Terminates all remote network connections.
Definition DXEndpoint.cpp:182
void closeAndAwaitTermination() const
Closes this endpoint and wait until all pending data processing tasks are completed.
Definition DXEndpoint.cpp:218
static std::shared_ptr< DXEndpoint > getInstance()
Returns a default application-wide singleton instance of DXEndpoint with a FEED role.
Definition DXEndpoint.cpp:491
static const std::string DXPUBLISHER_ADDRESS_PROPERTY
"dxpublisher.address"
Definition DXEndpoint.hpp:293
static const std::string DXFEED_USER_PROPERTY
"dxfeed.user"
Definition DXEndpoint.hpp:236
static const std::string NAME_PROPERTY
"name"
Definition DXEndpoint.hpp:196
static const std::string DXSCHEME_ENABLED_PROPERTY_PREFIX
"dxscheme.enabled."
Definition DXEndpoint.hpp:366
static const std::string DXPUBLISHER_PROPERTIES_PROPERTY
"dxpublisher.properties"
Definition DXEndpoint.hpp:283
static const std::string DXSCHEME_NANO_TIME_PROPERTY
"dxscheme.nanoTime"
Definition DXEndpoint.hpp:352
static const std::string DXFEED_ADDRESS_PROPERTY
"dxfeed.address"
Definition DXEndpoint.hpp:226
std::shared_ptr< DXEndpoint > executor(const std::shared_ptr< Executor > &executor)
Changes the executor that is used for notifications (events, state changes, etc.) of this endpoint.
Definition DXEndpoint.hpp:655
void disconnectAndClear() const
Terminates all remote network connections and clears stored data.
Definition DXEndpoint.cpp:191
Role getRole() const noexcept
Returns the role of this endpoint.
Definition DXEndpoint.cpp:536
static const std::string DXFEED_PROPERTIES_PROPERTY
"dxfeed.properties"
Definition DXEndpoint.hpp:207
static std::shared_ptr< Builder > newBuilder()
Creates a new Builder instance.
Definition DXEndpoint.cpp:509
std::shared_ptr< DXEndpoint > connect(const StringLike &address)
Connects to the specified remote address.
Definition DXEndpoint.cpp:161
Main entry class for dxFeed API (read it first).
Definition DXFeed.hpp:141
void detachSubscriptionAndClear(const std::shared_ptr< DXFeedSubscription > &subscription) const
Detaches the given subscription from this feed and clears data delivered to this subscription by publ...
Definition DXFeed.cpp:68
Collection getLastEvents(Collection &&events)
Returns the last events for the specified list of event instances.
Definition DXFeed.hpp:294
std::shared_ptr< PromiseList< E > > getLastEventsPromises(std::initializer_list< SymbolWrapper > collection) const
Requests the last events for the specified event type and a collection of symbols.
Definition DXFeed.hpp:749
std::vector< std::shared_ptr< E > > getTimeSeriesIfSubscribed(const SymbolWrapper &symbol, std::chrono::milliseconds fromTime, std::chrono::milliseconds toTime) const
Returns time series of events for the specified event type, symbol and a range of time if there is a ...
Definition DXFeed.hpp:1017
std::shared_ptr< DXFeedSubscription > createSubscription(const EventTypeEnum &eventType) const
Creates a new subscription for a single event type that is attached to this feed.
Definition DXFeed.cpp:88
std::shared_ptr< DXFeedTimeSeriesSubscription > createTimeSeriesSubscription(std::initializer_list< EventTypeEnum > eventTypes) const
Creates new subscription for multiple event types that is attached to this feed.
Definition DXFeed.cpp:137
std::shared_ptr< DXFeedSubscription > createSubscription(EventTypeIt begin, EventTypeIt end) const
Creates new subscription for multiple event types that is attached to this feed.
Definition DXFeed.hpp:388
std::shared_ptr< PromiseList< E > > getLastEventsPromises(const SymbolsCollection &collection) const
Requests the last events for the specified event type and a collection of symbols.
Definition DXFeed.hpp:703
std::shared_ptr< E > getLastEventIfSubscribed(const SymbolWrapper &symbol)
Returns the last event for the specified event type and symbol if there is a subscription for it.
Definition DXFeed.hpp:328
std::shared_ptr< DXFeedSubscription > createSubscription(std::initializer_list< EventTypeEnum > eventTypes) const
Creates new subscription for multiple event types that is attached to this feed.
Definition DXFeed.cpp:101
std::vector< std::shared_ptr< E > > getTimeSeriesIfSubscribed(const SymbolWrapper &symbol, std::chrono::milliseconds fromTime) const
Returns time series of events for the specified event type, symbol and a range of time (without an up...
Definition DXFeed.hpp:1048
std::shared_ptr< DXFeedTimeSeriesSubscription > createTimeSeriesSubscription(EventTypeIt begin, EventTypeIt end) const
Creates new subscription for multiple event types that is attached to this feed.
Definition DXFeed.hpp:500
static std::shared_ptr< DXFeed > getInstance()
Returns a default application-wide singleton instance of feed.
Definition DXFeed.cpp:19
std::shared_ptr< E > getLastEvent(std::shared_ptr< E > event)
Returns the last event for the specified event instance.
Definition DXFeed.hpp:270
std::shared_ptr< PromiseList< E > > getLastEventsPromises(SymbolIt begin, SymbolIt end) const
Requests the last events for the specified event type and a collection of symbols.
Definition DXFeed.hpp:656
std::shared_ptr< DXFeedSubscription > createSubscription(const EventTypesCollection &eventTypes) const
Creates new subscription for multiple event types that is attached to this feed.
Definition DXFeed.hpp:438
std::shared_ptr< Promise< std::shared_ptr< E > > > getLastEventPromise(const SymbolWrapper &symbol) const
Requests the last event for the specified event type and symbol.
Definition DXFeed.hpp:608
std::shared_ptr< DXFeedTimeSeriesSubscription > createTimeSeriesSubscription(const EventTypesCollection &eventTypes) const
Creates new subscription for multiple event types that is attached to this feed.
Definition DXFeed.hpp:567
std::string toString() const override
Returns a string representation of the current object.
Definition DXFeed.cpp:226
std::shared_ptr< Promise< std::vector< std::shared_ptr< E > > > > getIndexedEventsPromise(const SymbolWrapper &symbol, const IndexedEventSource &source) const
Requests a container of indexed events for the specified event type, symbol and source.
Definition DXFeed.hpp:802
void detachSubscription(const std::shared_ptr< DXFeedSubscription > &subscription) const
Detaches the given subscription from this feed.
Definition DXFeed.cpp:48
std::vector< std::shared_ptr< E > > getIndexedEventsIfSubscribed(const SymbolWrapper &symbol, const IndexedEventSource &source) const
Returns a vector of indexed events for the specified event type, symbol and source if there is a subs...
Definition DXFeed.hpp:858
void attachSubscription(const std::shared_ptr< DXFeedSubscription > &subscription) const
Attaches the given subscription to this feed.
Definition DXFeed.cpp:28
std::shared_ptr< DXFeedTimeSeriesSubscription > createTimeSeriesSubscription(const EventTypeEnum &eventType) const
Creates a new subscription for a single event type that is attached to this feed.
Definition DXFeed.cpp:116
Provides API for publishing of events to local or remote DXFeed.
Definition DXPublisher.hpp:60
void publishEvents(EventIt begin, EventIt end) const
Publishes events to the corresponding feed.
Definition DXPublisher.hpp:200
std::shared_ptr< ObservableSubscription > getSubscription(const EventTypeEnum &eventType)
Returns an observable set of subscribed symbols for the specified event type.
Definition DXPublisher.cpp:50
std::string toString() const override
Returns a string representation of the current object.
Definition DXPublisher.cpp:65
void publishEvents(std::initializer_list< std::shared_ptr< EventType > > events) const
Publishes events to the corresponding feed.
Definition DXPublisher.hpp:182
void publishEvents(EventsCollection &&events) const
Publishes events to the corresponding feed.
Definition DXPublisher.hpp:164
static std::shared_ptr< DXPublisher > getInstance()
Returns a default application-wide singleton instance of DXPublisher.
Definition DXPublisher.cpp:20
void publishEvents(std::shared_ptr< EventType > event) const
Publishes an event to the corresponding feed.
Definition DXPublisher.cpp:46
Mixin for wrapping Promise method calls for a single event.
Definition Promise.hpp:244
std::shared_ptr< E > getResult() const
Returns result of computation.
Definition Promise.hpp:252
std::shared_ptr< E > await() const
Wait for the computation to complete and return its result or throw an exception in case of exception...
Definition Promise.hpp:262
std::shared_ptr< E > await(const std::chrono::milliseconds &timeoutInMilliseconds) const &
Wait for computation to complete or timeout and return its result or throw an exception in case of ex...
Definition Promise.hpp:292
std::shared_ptr< E > await(std::int32_t timeoutInMilliseconds) const &
Wait for computation to complete or timeout and return its result or throw an exception in case of ex...
Definition Promise.hpp:277
const DataType & getData() const noexcept
Definition EventSourceWrapper.cpp:119
bool isOrderSource() const noexcept
Definition EventSourceWrapper.cpp:106
std::unique_ptr< void, decltype(&EventSourceWrapper::freeGraal)> toGraalUnique() const noexcept
Allocates memory for the dxFeed Graal SDK structure (recursively if necessary).
Definition EventSourceWrapper.cpp:80
std::string toStringUnderlying() const
Returns a string representation of the underlying object.
Definition EventSourceWrapper.cpp:94
std::string toString() const
Returns a string representation of the current object.
Definition EventSourceWrapper.cpp:84
void * toGraal() const noexcept
Allocates memory for the dxFeed Graal SDK structure (recursively if necessary).
Definition EventSourceWrapper.cpp:71
static EventSourceWrapper fromGraal(void *graalNative)
Creates an object of the current type and fills it with data from the dxFeed Graal SDK structure.
Definition EventSourceWrapper.cpp:62
EventSourceWrapper(const IndexedEventSource &data) noexcept
Constructs a wrapper from IndexedEventSource.
Definition EventSourceWrapper.cpp:47
bool isIndexedEventSource() const noexcept
Definition EventSourceWrapper.cpp:102
std::optional< IndexedEventSource > asIndexedEventSource() const noexcept
Definition EventSourceWrapper.cpp:110
std::optional< OrderSource > asOrderSource() const noexcept
Definition EventSourceWrapper.cpp:115
EventSourceWrapper(const OrderSource &data) noexcept
Constructs a wrapper from OrderSource.
Definition EventSourceWrapper.cpp:51
static void freeGraal(void *graalNative)
Releases the memory occupied by the dxFeed Graal SDK structure (recursively if necessary).
Definition EventSourceWrapper.cpp:55
Event type parametrized by a symbol.
Definition EventType.hpp:114
virtual const std::optional< Symbol > & getEventSymbolOpt() const &noexcept=0
Returns the event symbol that identifies this event type in subscription.
virtual void setEventSymbol(const Symbol &eventSymbol) noexcept=0
Changes the event symbol that identifies this event type in subscription.
virtual const Symbol & getEventSymbol() const &noexcept=0
Returns the event symbol that identifies this event type in subscription.
Marks all event types that can be received via dxFeed API.
Definition EventType.hpp:37
std::string toString() const override
Returns a string representation of the current object.
Definition api.cpp:67
virtual void * toGraal() const =0
Allocates memory for the dxFeed Graal SDK structure (recursively if necessary).
virtual std::int64_t getEventTime() const noexcept
Returns time when an event was created or zero when time is not available.
Definition api.cpp:54
virtual void assign(std::shared_ptr< EventType > event)
Replaces the contents of the event.
Definition api.cpp:63
virtual void setEventTime(std::int64_t eventTime) noexcept
Changes event creation time.
Definition api.cpp:58
This marker interface marks subscription symbol classes (like TimeSeriesSubscriptionSymbol) that atta...
Definition FilteredSubscriptionSymbol.hpp:32
The wrapper over CEntryPointErrorsEnum, the error code returned by GraalVM.
Definition GraalException.hpp:26
GraalException(CEntryPointErrorsEnum entryPointErrorsEnum)
Constructs an exception.
Definition GraalException.cpp:8
void handle(ArgTypes... args)
Calls the listeners and pass the args to them.
Definition Handler.hpp:122
std::size_t add(ListenerType &&listener)
Adds the listener to "main" group.
Definition Handler.hpp:156
std::size_t operator%=(ListenerType &&listener)
Adds the low priority listener (to the "low priority" group).
Definition Handler.hpp:208
std::size_t operator+=(ListenerType &&listener)
Adds the listener to "main" group.
Definition Handler.hpp:197
void operator()(ArgTypes... args)
Calls the listeners and pass the ars to them.
Definition Handler.hpp:146
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:84
void operator-=(std::size_t id)
Removes a listener by the id.
Definition Handler.hpp:236
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:177
void remove(std::size_t id)
Removes a listener by the id.
Definition Handler.hpp:217
static std::shared_ptr< Builder > newBuilder()
Creates a new instance of HistoryEndpoint::Builder with default configurations.
Definition HistoryEndpoint.cpp:83
Compression
The Compression enum represents different compression algorithms that can be applied to data during t...
Definition HistoryEndpoint.hpp:76
Format
The Format enum represents different formats that can be used to handle data.
Definition HistoryEndpoint.hpp:91
std::vector< std::shared_ptr< E > > getTimeSeries(const SymbolWrapper &symbol, std::int64_t from, std::int64_t to)
Retrieves a list of time series events for a specific type of event and symbol within the given time ...
Definition HistoryEndpoint.hpp:201
Represents an indexed collection of up-to-date information about some condition or state of an extern...
Definition IndexedEvent.hpp:46
virtual EventFlagsMask getEventFlagsMask() const noexcept=0
Returns transactional event flags.
virtual const IndexedEventSource & getSource() const &noexcept=0
Returns the source of this event.
static const EventFlag TX_PENDING
0x01 - A bitmask to get transaction pending indicator from the value of eventFlags property.
Definition IndexedEvent.hpp:53
virtual std::int64_t getIndex() const noexcept=0
Returns unique per-symbol index of this event.
static const EventFlag SNAPSHOT_END
0x08 - A bitmask to get snapshot end indicator from the value of eventFlags property.
Definition IndexedEvent.hpp:62
virtual std::int32_t getEventFlags() const noexcept=0
Returns transactional event flags.
static const EventFlag SNAPSHOT_MODE
0x40 - A bitmask to set snapshot mode indicator into the value of eventFlags property.
Definition IndexedEvent.hpp:68
static const EventFlag SNAPSHOT_SNIP
0x10 - A bitmask to get snapshot snip indicator from the value of eventFlags property.
Definition IndexedEvent.hpp:65
static const EventFlag REMOVE_EVENT
0x02 - A bitmask to get removal indicator from the value of eventFlags property.
Definition IndexedEvent.hpp:56
virtual void setIndex(std::int64_t index)=0
Changes unique per-symbol index of this event.
static const EventFlag SNAPSHOT_BEGIN
0x04 - A bitmask to get snapshot begin indicator from the value of eventFlags property.
Definition IndexedEvent.hpp:59
virtual void setEventFlags(std::int32_t eventFlags) noexcept=0
Changes transactional event flags.
virtual void setEventFlags(const EventFlagsMask &eventFlags) noexcept=0
Changes transactional event flags.
Thrown to indicate that a method has been passed an illegal or inappropriate argument.
Definition InvalidArgumentException.hpp:23
A wrapper over the interceptable Java exceptions thrown by the dxFeed Native Graal SDK.
Definition JavaException.hpp:26
static void throwIfJavaThreadExceptionExists()
Throws a JavaException if it exists (i.e. intercepted by Graal SDK)
Definition JavaException.cpp:78
JavaException(const StringLike &message, const StringLike &className, const StringLike &stackTrace)
Creates an exception using Java message, className and stack trace.
Definition JavaException.cpp:52
static JavaException createAndRelease(void *exceptionHandle)
Creates an exception from a native Java exception handle and releases the native representation.
Definition JavaException.cpp:70
static JavaException create(void *exceptionHandle)
Creates an exception using native (GraalVM) Java exception handle.
Definition JavaException.cpp:60
Represents up-to-date information about some condition or state of an external entity that updates in...
Definition LastingEvent.hpp:33
Helper class to compose and parse symbols for market events.
Definition MarketEventSymbols.hpp:45
static std::optional< std::string > getAttributeStringByKey(const StringLike &symbol, const StringLike &key) noexcept
Returns value of the attribute with the specified key.
Definition MarketEventSymbols.cpp:48
static std::string changeBaseSymbol(const StringLike &symbol, const StringLike &baseSymbol) noexcept
Changes base symbol while leaving exchange code and attributes intact.
Definition MarketEventSymbols.cpp:33
static bool hasExchangeCode(const StringLike &symbol) noexcept
Returns true if the specified symbol has the exchange code specification.
Definition MarketEventSymbols.cpp:8
static std::string changeExchangeCode(const StringLike &symbol, char exchangeCode) noexcept
Changes exchange code of the specified symbol or removes it if the new exchange code is ‘’\0'`.
Definition MarketEventSymbols.cpp:16
static std::string getBaseSymbol(const StringLike &symbol) noexcept
Returns base symbol without exchange code and attributes.
Definition MarketEventSymbols.cpp:29
static std::string changeAttributeStringByKey(const StringLike &symbol, const StringLike &key, const StringLike &value) noexcept
Changes the value of one attribute value while leaving exchange code and other attributes intact.
Definition MarketEventSymbols.cpp:53
static std::string removeAttributeStringByKey(const StringLike &symbol, const StringLike &key) noexcept
Removes one attribute with the specified key while leaving exchange code and other attributes intact.
Definition MarketEventSymbols.cpp:64
static char getExchangeCode(const StringLike &symbol) noexcept
Returns exchange code of the specified symbol or ‘’\0'` if none is defined.
Definition MarketEventSymbols.cpp:12
Base class for all market events.
Definition MarketEvent.hpp:29
The listener interface for receiving notifications on the changes of observed subscription.
Definition ObservableSubscriptionChangeListener.hpp:32
void notifySubscriptionClosed(Key)
Delivers a subscription-closed notification from an owning subscription implementation.
Definition ObservableSubscriptionChangeListener.cpp:124
void notifySymbolsAdded(Key, const std::unordered_set< SymbolWrapper > &symbols)
Delivers an added-symbol notification from an owning subscription implementation.
Definition ObservableSubscriptionChangeListener.cpp:114
const JavaObjectHandle< ObservableSubscriptionChangeListener > & getHandle(Key) const
Returns the native listener handle to an owning subscription implementation.
Definition ObservableSubscriptionChangeListener.cpp:108
void notifySymbolsRemoved(Key, const std::unordered_set< SymbolWrapper > &symbols)
Delivers a removed-symbol notification from an owning subscription implementation.
Definition ObservableSubscriptionChangeListener.cpp:119
static std::shared_ptr< ObservableSubscriptionChangeListener > create(std::function< void(const std::unordered_set< SymbolWrapper > &symbols)> onSymbolsAdded)
Creates a listener that will notify the callback about added symbols.
Definition ObservableSubscriptionChangeListener.cpp:72
~ObservableSubscriptionChangeListener() noexcept override
Destroys this listener and invalidates its native callback registration context.
Definition ObservableSubscriptionChangeListener.cpp:68
static std::shared_ptr< ObservableSubscriptionChangeListener > create(std::function< void(const std::unordered_set< SymbolWrapper > &symbols)> onSymbolsAdded, std::function< void(const std::unordered_set< SymbolWrapper > &symbols)> onSymbolsRemoved, std::function< void()> onSubscriptionClosed)
Creates a listener that will notify callbacks about events of adding and deleting symbols,...
Definition ObservableSubscriptionChangeListener.cpp:88
Observable set of subscription symbols.
Definition ObservableSubscription.hpp:26
virtual std::size_t addChangeListener(std::shared_ptr< ObservableSubscriptionChangeListener > listener)=0
Adds subscription change listener.
virtual bool containsEventType(const EventTypeEnum &eventType)=0
Returns true if this subscription contains the corresponding event type.
virtual void removeChangeListener(std::size_t id)=0
Removes subscription change listener by id.
virtual bool isClosed()=0
virtual std::unordered_set< EventTypeEnum > getEventTypes()=0
Provides on-demand historical tick data replay controls.
Definition OnDemandService.hpp:77
A list of event receiving results that will be completed normally or exceptionally in the future.
Definition Promise.hpp:442
Result of a computation that will be completed normally or exceptionally in the future.
Definition Promise.hpp:358
A class that represents a promise-based implementation often used for handling asynchronous operation...
Definition Promises.hpp:46
A helper class needed to construct smart pointers to objects and does not allow explicit construction...
Definition SharedEntity.hpp:89
static auto createShared(Args &&...args)
Creates a smart pointer to an object.
Definition SharedEntity.hpp:104
A runtime axception with stacktrace.
Definition RuntimeException.hpp:26
const std::string & getStackTrace() const &
Definition RuntimeException.cpp:83
RuntimeException(const StringLike &message, const StringLike &additionalStackTrace="")
Constructs a runtime exception.
Definition RuntimeException.cpp:67
static const SessionFilter TRADING
Accepts trading sessions only - those with (Session::isTrading() == true).
Definition SessionFilter.hpp:122
static const SessionFilter ANY
Accepts any session - useful for pure schedule navigation.
Definition SessionFilter.hpp:121
SessionFilter(SessionFilterEnum code, const StringLike &name, std::optional< SessionType > type, std::optional< bool > trading) noexcept
Creates a filter with specified type and trading flag conditions.
Definition CandleSession.cpp:52
static const SessionFilter AFTER_MARKET
Accepts any session with type SessionType::AFTER_MARKET.
Definition SessionFilter.hpp:130
static const SessionFilter REGULAR
Accepts any session with type SessionType::REGULAR.
Definition SessionFilter.hpp:129
static const SessionFilter NO_TRADING
Accepts any session with type SessionType::NO_TRADING.
Definition SessionFilter.hpp:125
static const SessionFilter NON_TRADING
Accepts non-trading sessions only - those with (Session::isTrading() == false).
Definition SessionFilter.hpp:123
static const SessionFilter PRE_MARKET
Accepts any session with type SessionType::PRE_MARKET.
Definition SessionFilter.hpp:127
bool accept(Session session) const noexcept
Tests whether or not the specified session is an acceptable result.
Definition SessionFilter.hpp:110
std::optional< bool > trading_
Required trading flag, std::nullopt if not relevant.
Definition SessionFilter.hpp:76
std::optional< SessionType > type_
Required type, std::nullopt if not relevant.
Definition SessionFilter.hpp:74
Defines type of session - what kind of trading activity is allowed (if any), what rules are used,...
Definition SessionType.hpp:45
static const SessionType AFTER_MARKET
After-market session type marks extended trading session after regular trading hours.
Definition SessionType.hpp:117
static const SessionType PRE_MARKET
Pre-market session type marks extended trading session before regular trading hours.
Definition SessionType.hpp:115
static const SessionType REGULAR
Regular session type marks regular trading hours session.
Definition SessionType.hpp:116
static const SessionType NO_TRADING
Non-trading session type is used to mark periods of time during which trading is not allowed.
Definition SessionType.hpp:114
bool isTrading() const noexcept
Returns true if trading activity is allowed for this type of session.
Definition CandleSession.cpp:34
A base abstract "shared entity" class. Has some helpers for dynamic polymorphism.
Definition SharedEntity.hpp:25
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 or std::shared_ptr<T>{nu...
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 or std::shared_ptr<T>{nu...
Definition SharedEntity.hpp:58
bool is() const noexcept
Checks that the pointer to the current type could be converted to type T* In other words: whether typ...
Definition SharedEntity.hpp:39
std::size_t operator+=(ListenerType &&listener)
Adds the listener to "main" group.
Definition Handler.hpp:379
void remove(std::size_t id)
Removes a listener by the id.
Definition Handler.hpp:399
void handle(ArgTypes... args)
Calls the listeners and pass the args to them.
Definition Handler.hpp:317
void operator()(ArgTypes... args)
Calls the listeners and pass the ars to them.
Definition Handler.hpp:328
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:359
void operator-=(std::size_t id)
Removes a listener by the id.
Definition Handler.hpp:418
std::size_t operator%=(ListenerType &&listener)
Adds the low priority listener (to the "low priority" group).
Definition Handler.hpp:390
SimpleHandler() noexcept
Creates the new handler.
Definition Handler.hpp:289
std::size_t add(ListenerType &&listener)
Adds the listener to "main" group.
Definition Handler.hpp:338
Universal functional object that allows searching std::unordered_map for string-like keys.
Definition StringUtils.hpp:120
A simple wrapper around strings or something similar to strings to reduce the amount of code for meth...
Definition Common.hpp:728
A lightweight wrapper around strings or string-like inputs.
Definition StringUtils.hpp:28
StringSymbol(std::string_view stringView) noexcept
Constructs StringSymbol from a std::string_view.
Definition StringSymbol.cpp:55
StringSymbol(const char *chars) noexcept
Constructs StringSymbol from a char array.
Definition StringSymbol.cpp:46
static void freeGraal(void *graalNative)
Releases the memory occupied by the dxFeed Graal SDK structure (recursively if necessary).
Definition StringSymbol.cpp:84
std::string toString() const
Returns a string representation of the current object.
Definition StringSymbol.cpp:115
static StringSymbol fromGraal(void *graalNative)
Creates an object of the current type and fills it with data from the dxFeed Graal SDK structure.
Definition StringSymbol.cpp:100
void * toGraal() const
Allocates memory for the dxFeed Graal SDK structure (recursively if necessary).
Definition StringSymbol.cpp:73
Common string constants used across the library.
Definition StringUtils.hpp:137
static const std::string NUL
Textual representation of a null / missing string: "<null>".
Definition StringUtils.hpp:142
static const std::string EMPTY
Empty string constant: "".
Definition StringUtils.hpp:139
std::optional< CandleSymbol > asCandleSymbol() const noexcept
Definition SymbolWrapper.cpp:239
SymbolWrapper(Symbol &&symbol) noexcept
Constructor for any wrapped symbol.
Definition SymbolWrapper.hpp:161
bool isIndexedEventSubscriptionSymbol() const noexcept
Definition SymbolWrapper.cpp:215
std::string toString() const
Returns a string representation of the current object.
Definition SymbolWrapper.cpp:181
static SymbolWrapper fromGraal(void *graalNative)
Creates an object of the current type and fills it with data from the dxFeed Graal SDK structure.
Definition SymbolWrapper.cpp:133
std::string toStringUnderlying() const
Returns a string representation of the underlying object.
Definition SymbolWrapper.cpp:191
std::unique_ptr< void, decltype(&SymbolWrapper::freeGraal)> toGraalUnique() const noexcept
Allocates memory for the dxFeed Graal SDK structure (recursively if necessary).
Definition SymbolWrapper.cpp:177
bool isStringSymbol() const noexcept
Definition SymbolWrapper.cpp:199
std::optional< IndexedEventSubscriptionSymbol > asIndexedEventSubscriptionSymbol() const noexcept
Definition SymbolWrapper.cpp:219
bool isWildcardSymbol() const noexcept
Definition SymbolWrapper.cpp:207
void * toGraal() const noexcept
Allocates memory for the dxFeed Graal SDK structure (recursively if necessary).
Definition SymbolWrapper.cpp:165
SymbolWrapper(const IndexedEventSubscriptionSymbol &indexedEventSubscriptionSymbol) noexcept
Constructor for IndexedEventSubscriptionSymbol.
Definition SymbolWrapper.cpp:66
std::string asStringSymbol() const noexcept
Definition SymbolWrapper.cpp:203
SymbolWrapper(const StringSymbol &stringSymbol) noexcept
Constructor for any wrapped string symbol.
Definition SymbolWrapper.cpp:50
std::optional< WildcardSymbol > asWildcardSymbol() const noexcept
Definition SymbolWrapper.cpp:211
SymbolWrapper(const CandleSymbol &candleSymbol) noexcept
Constructor for CandleSymbol.
Definition SymbolWrapper.cpp:84
SymbolWrapper(const WildcardSymbol &wildcardSymbol) noexcept
Constructor for any wrapped wildcard (*) symbol.
Definition SymbolWrapper.cpp:58
bool isTimeSeriesSubscriptionSymbol() const noexcept
Definition SymbolWrapper.cpp:225
SymbolWrapper(const TimeSeriesSubscriptionSymbol &timeSeriesSubscriptionSymbol) noexcept
Constructor for TimeSeriesSubscriptionSymbol.
Definition SymbolWrapper.cpp:75
bool isCandleSymbol() const noexcept
Definition SymbolWrapper.cpp:235
std::optional< TimeSeriesSubscriptionSymbol > asTimeSeriesSubscriptionSymbol() const noexcept
Definition SymbolWrapper.cpp:229
static void freeGraal(void *graalNative)
Releases the memory occupied by the dxFeed Graal SDK structure (recursively if necessary).
Definition SymbolWrapper.cpp:95
const DataType & getData() const noexcept
Definition SymbolWrapper.cpp:243
Value class for a period of time with support for ISO8601 duration format.
Definition TimePeriod.hpp:29
static TimePeriod valueOf(const StringLike &value)
Returns TimePeriod represented with a given string.
Definition TimePeriod.cpp:28
static TimePeriod valueOf(std::chrono::milliseconds value)
Returns TimePeriod with value milliseconds.
Definition TimePeriod.cpp:24
std::int64_t getNanos() const
Returns value in nanoseconds.
Definition TimePeriod.cpp:48
static const TimePeriod ZERO
Time-period of zero.
Definition TimePeriod.hpp:33
std::int32_t getSeconds() const
Returns value in seconds.
Definition TimePeriod.cpp:40
std::int64_t getTime() const
Returns value in milliseconds.
Definition TimePeriod.cpp:32
static const TimePeriod UNLIMITED
Time-period of "infinity" (time of std::numeric_limits<std::int64_t>::max() or LLONG_MAX).
Definition TimePeriod.hpp:36
static TimePeriod valueOf(std::int64_t value)
Returns TimePeriod with value milliseconds.
Definition TimePeriod.cpp:20
Represents time-series snapshots of some process that is evolving in time or actual events in some ex...
Definition TimeSeriesEvent.hpp:84
const IndexedEventSource & getSource() const &noexcept override
Returns the source identifier for this event, which is always DEFAULT for time-series events.
Definition TimeSeriesEvent.cpp:8
std::int64_t getIndex() const noexcept override
Returns unique per-symbol index of this event.
Definition TimeSeriesEvent.cpp:12
virtual std::int64_t getEventId() const noexcept
Returns unique per-symbol index of this event.
Definition TimeSeriesEvent.cpp:16
virtual std::int64_t getTime() const noexcept=0
Returns timestamp of the event.
Mixin for wrapping Promise method calls for a void.
Definition Promise.hpp:185
void await(std::int32_t timeoutInMilliseconds) const &
Wait for the computation to complete or timeout and return its result or throw an exception in case o...
Definition Promise.hpp:217
void await(const std::chrono::milliseconds &timeoutInMilliseconds) const &
Wait for the computation to complete or timeout and return its result or throw an exception in case o...
Definition Promise.hpp:232
void await() const
Wait for the computation to complete and return its result or throw an exception in case of exception...
Definition Promise.hpp:202
void getResult() const
Returns result of computation.
Definition Promise.hpp:192
static void freeGraal(void *graalNative)
Releases the memory occupied by the dxFeed Graal SDK structure (recursively if necessary).
Definition WildcardSymbol.cpp:43
static const WildcardSymbol & fromGraal(void *graalNative)
Creates an object of the current type and fills it with data from the dxFeed Graal SDK structure.
Definition WildcardSymbol.cpp:49
void * toGraal() const noexcept
Allocates memory for the dxFeed Graal SDK structure (recursively if necessary).
Definition WildcardSymbol.cpp:33
static const WildcardSymbol ALL
Represents [wildcard] subscription to all events of the specific event type.
Definition WildcardSymbol.hpp:12
std::string toString() const
Returns string representation of this wildcard subscription symbol.
Definition WildcardSymbol.cpp:57
static const std::string RESERVED_PREFIX
Symbol prefix that is reserved for wildcard subscriptions.
Definition WildcardSymbol.hpp:32
Whether T is std::shared_ptr<E>, where E is a descendant of LastingEvent (the elements of DXFeed::get...
Definition DXFeed.hpp:40
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