dxFeed Graal CXX API v4.2.0
Loading...
Searching...
No Matches
DXEndpoint.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 "../executors/InPlaceExecutor.hpp"
11#include "../internal/CEntryPointErrors.hpp"
12#include "../internal/Common.hpp"
13#include "../internal/Handler.hpp"
14#include "../internal/Isolate.hpp"
15#include "../internal/JavaObjectHandle.hpp"
16#include "DXFeed.hpp"
17#include "DXPublisher.hpp"
18
19#include <filesystem>
20#include <iostream>
21#include <string>
22#include <type_traits>
23#include <unordered_map>
24#include <unordered_set>
25#include <variant>
26
28
29struct DXPublisher;
30struct DXFeed;
31struct OnDemandService;
32
33/**
34 * Manages network connections to @ref DXFeed "feed" or
35 * @ref DXPublisher "publisher". There are per-process (per GraalVM Isolate for now) ready-to-use singleton instances
36 * that are available with DXEndpoint::getInstance() and DXEndpoint::getInstance(Role) methods as well as
37 * factory methods DXEndpoint::create() and DXEndpoint::create(Role), and a number of configuration methods. Advanced
38 * properties can be configured using
39 * @ref DXEndpoint::newBuilder() "newBuilder()".@ref DXEndpoint::Builder::withProperty(const std::string&, const
40 * std::string&) "withProperty(key, value)".@ref DXEndpoint::Builder::build() "build()".
41 *
42 * See DXFeed for details on how to subscribe to symbols and receive events.
43 *
44 * <h3>Endpoint role</h3>
45 *
46 * Each endpoint has a role that is specified on its creation and cannot be changed afterwards.
47 * The default factory method DXEndpoint::create() creates an endpoint with a @ref Role::FEED "FEED" role.
48 * Endpoints with other roles are created with DXEndpoint::create(Role) factory method. Endpoint role is
49 * represented by @ref Role "DXEndpoint::Role" enumeration.
50 *
51 * Endpoint role defines the behavior of its @ref DXEndpoint::connect(const std::string&) "connect" method:
52 *
53 * - @ref Role::FEED "FEED" connects to the remote data feed provider and is optimized for real-time or
54 * delayed data processing (<b>this is a default role</b>).
55 * DXEndpoint::getFeed() method returns a feed object that subscribes to this remote data feed provider and receives
56 * events from it. When event processing threads cannot keep up (don't have enough CPU time), data is dynamically
57 * conflated to minimize latency between received events and their processing time. For example:
58 * - <b>`DXEndpoint::create()->connect("demo.dxfeed.com:7300")->getFeed()`</b> returns a demo feed from dxFeed with
59 * sample market quotes.
60 * - <b>`DXEndpoint::create()->connect("localhost:7400")->getFeed()`</b> returns a feed that is connected to a
61 * publisher that is running on the same host. See example below.
62 * - <b>`DXEndpoint::create()->connect("file:demo-sample.data")->getFeed()`</b> returns a feed that is connected to
63 * a "demo-sample.data" file and plays back it as if it was received in real time.
64 *
65 * This endpoint is automatically connected to the configured data feed as explained in default properties section.
66 * - @ref Role::ON_DEMAND_FEED "ON_DEMAND_FEED" is similar to @ref Role::FEED "FEED", but it is designed to be used with
67 * OnDemandService for historical data replay only. It is configured with default properties, but is not connected
68 * automatically to the data provider until @ref OnDemandService::replay(std::int64_t,double)
69 * "OnDemandService::replay" method is invoked.
70 * - @ref Role::STREAM_FEED "STREAM_FEED" is similar to @ref Role::FEED "FEED" and also connects to the remote data
71 * feed provider, but is designed for bulk parsing of data from files. DXEndpoint::getFeed() method returns feed
72 * object that subscribes to the data from the opened files and receives events from them. Events from the files are
73 * not conflated and are processed as fast as possible. Note, that in this role, DXFeed::getLastEvent() method does
74 * not work and time-series subscription is not supported. For example:
75 * ```cpp
76 * auto endpoint = DXEndpoint::create(DXEndpoint::Role::STREAM_FEED);
77 * auto feed = endpoint->getFeed();
78 * ```
79 * creates a feed that is ready to read data from file as soon as the following code is invoked:
80 * ```cpp
81 * endpoint->connect("file:demo-sample.data[speed=max]");
82 * ```
83 * "[speed=max]" clause forces to the file reader to play back all the data from "demo-sample.data" file as fast as
84 * data subscribers are processing it.
85 * - @ref Role::PUBLISHER "PUBLISHER" connects to the remote publisher hub (also known as multiplexor) or creates a
86 * publisher on the local host. DXEndpoint::getPublisher() method returns a publisher object that publishes events to
87 * all connected feeds. For example:
88 * <b>`DXEndpoint->create(DXEndpoint::Role::PUBLISHER)->connect(":7400")->getPublisher()`</b> returns a publisher that
89 * is waiting for connections on TCP/IP port 7400. The published events will be delivered to all feeds that are
90 * connected to this publisher. This endpoint is automatically connected to the configured data feed as explained in
91 * default properties section.
92 * - @ref Role::LOCAL_HUB "LOCAL_HUB" creates a local hub without ability to establish network connections.
93 * Events that are published via @ref DXEndpoint::getPublisher() "publisher" are delivered to local @ref
94 * DXEndpoint::getFeed() "feed" only.
95 *
96 * <h3>Endpoint state</h3>
97 *
98 * Each endpoint has a state that can be retrieved with DXEndpoint::getState() method.
99 * When endpoint is created with any role and default address is not specified in default properties, then it is not
100 * connected to any remote endpoint.
101 * Its state is @ref State::NOT_CONNECTED "NOT_CONNECTED".
102 *
103 * @ref Role::FEED "Feed" and @ref Role::PUBLISHER "publisher" endpoints can connect to remote endpoints of the opposite
104 * role. Connection is initiated by @ref DXEndpoint::connect(const std::string&) "connect" method.
105 * The endpoint state becomes @ref State::CONNECTING "CONNECTING".
106 *
107 * When the actual connection to the remote endpoint is established, the endpoint state becomes
108 * @ref State::CONNECTED "CONNECTED".
109 *
110 * Network connections can temporarily break and return endpoint back into @ref State::CONNECTING "CONNECTING" state.
111 * File connections can be completed and return endpoint into @ref State::NOT_CONNECTED "NOT_CONNECTED" state.
112 *
113 * Connection to the remote endpoint can be terminated with DXEndpoint::disconnect() method.
114 * The endpoint state becomes @ref State::NOT_CONNECTED "NOT_CONNECTED".
115 *
116 * Endpoint can be closed with DXEndpoint::close() method. The endpoint state becomes @ref State::CLOSED "CLOSED". This
117 * is a final state. All connection are terminated and all internal resources that are held by this endpoint are freed.
118 * No further connections can be initiated.
119 *
120 * <h3>Event times</h3>
121 *
122 * The EventType::getEventTime() on received events is available only when the endpoint is created with
123 * DXEndpoint::DXENDPOINT_EVENT_TIME_PROPERTY property and the data source has embedded event times. This is typically
124 * true only for data events that are read from historical tape files (see above) and from OnDemandService. Events that
125 * are coming from a network connections do not have an embedded event time information and event time is not available
126 * for them anyway.
127 *
128 * <h3><a name="defaultPropertiesSection">Default properties</a></h3>
129 *
130 * Default properties are loaded from "dxfeed.properties" or "dxpublisher.properties" file depending on
131 * the @ref Role "role" of created endpoint. "dxfeed.properties" is used for
132 * @ref Role::FEED "FEED" and @ref Role::ON_DEMAND_FEED "ON_DEMAND_FEED",
133 * "dxpublisher.properties" is used for @ref Role::PUBLISHER "PUBLISHER"}.
134 * @ref Role::STREAM_FEED "STREAM_FEED" and @ref Role::LOCAL_HUB "LOCAL_HUB" do not support properties file.
135 *
136 * The location of this file can be specified using
137 * @ref Builder::withProperty(const std::string&, const std::string&) "withProperty"(::DXFEED_PROPERTIES_PROPERTY, path)
138 * or
139 * @ref Builder::withProperty(const std::string&, const std::string&) "withProperty"(::DXPUBLISHER_PROPERTIES_PROPERTY,
140 * path) correspondingly. When the location of this file is not explicitly specified using
141 * @ref Builder::withProperty(const std::string&, const std::string&) "withProperty" method, then the file path is taken
142 * from a system property with the corresponding name.
143 *
144 * When the path to the above properties file is not provided, then a resource named "dxfeed.properties" or
145 * "dxpublisher.properties" is loaded from classpath. When classpath is set to "." (current directory),
146 * it means that the corresponding file can be placed into the current directory with any need to specify additional
147 * properties.
148 *
149 * Defaults for individual properties can be also provided using system properties when they are not specified
150 * in the configuration file. System properties override configuration loaded from classpath resource, but don't
151 * override configuration from the user-specified configuration file.
152 *
153 * The DXEndpoint::NAME_PROPERTY is the exception from the above rule. It is never loaded from system properties.
154 * It can be only specified in configuration file or programmatically. There is a convenience
155 * @ref Builder::withName(const std::string&) "Builder.withName" method for it. It is recommended to assign short and
156 * meaningful endpoint names when multiple endpoints are used in the same process (one GraalVM Isolate for now).
157 * The name of the endpoint shall describe its role in the particular application.
158 *
159 * Note, that individual properties that are programmatically set using @ref Builder::withProperty(const std::string&,
160 * const std::string&) "withProperty" method always take precedence.
161 *
162 * @ref Role::FEED "FEED" and @ref Role::PUBLISHER "PUBLISHER" automatically establish connection on creation
163 * when the corresponding DXEndpoint::DXFEED_ADDRESS_PROPERTY or DXEndpoint::DXPUBLISHER_ADDRESS_PROPERTY is specified.
164 *
165 * <h3>Permanent subscription</h3>
166 *
167 * Endpoint properties can define permanent subscription for specific sets of symbols and event types in
168 * the data feed, so that DXFeed methods like @ref DXFeed::getLastEventIfSubscribed "getLastEventIfSubscribed",
169 * @ref DXFeed::getIndexedEventsIfSubscribed "getIndexedEventsIfSubscribed", and
170 * @ref DXFeed::getTimeSeriesIfSubscribed "getTimeSeriesIfSubscribed" can be used without a need to create a
171 * separate DXFeedSubscription object. Please, contact dxFeed support for details
172 * on the required configuration.
173 *
174 * <h3>Threads and locks</h3>
175 *
176 * This class is thread-safe and can be used concurrently from multiple threads without external synchronization.
177 *
178 * [Javadoc.](https://docs.dxfeed.com/dxfeed/api/com/dxfeed/api/DXEndpoint.html)
179 *
180 * Some methods that are not marked `noexcept` may throw exceptions:
181 *
182 * @throws InvalidArgumentException if handle is invalid.
183 * @throws JavaException if something happened with the dxFeed API backend
184 * @throws GraalException if something happened with the GraalVM
185 */
187 /// The alias to a type of shared pointer to the DXEndpoint object
188 using Ptr = std::shared_ptr<DXEndpoint>;
189
190 /// The alias to a type of unique pointer to the DXEndpoint object
192
193 friend struct OnDemandService;
194
195 /**
196 * `"name"`
197 *
198 * Defines property for endpoint name that is used to distinguish multiple endpoints
199 * in the same process in logs and in other diagnostic means.
200 * Use Builder::withProperty(const std::string&, const std::string&) method.
201 * This property is also changed by Builder::withName(const std::string&) method.
202 */
203 static const std::string NAME_PROPERTY;
204
205 /**
206 * `"dxfeed.properties"`
207 *
208 * Defines path to a file with properties for an endpoint with role @ref Role::FEED "FEED" or
209 * @ref Role::ON_DEMAND_FEED "ON_DEMAND_FEED".
210 * By default, properties a loaded from a path resource named "dxfeed.properties".
211 *
212 * @see Builder::withProperty(const std::string&, const std::string&)
213 */
214 static const std::string DXFEED_PROPERTIES_PROPERTY;
215
216 /**
217 * `"dxfeed.address"`
218 *
219 * Defines default connection address for an endpoint with role @ref Role::FEED "FEED"
220 * or @ref Role::ON_DEMAND_FEED "ON_DEMAND_FEED".
221 * Connection is established to this address by role @ref Role::FEED "FEED" as soon as endpoint is created, while
222 * role @ref Role::ON_DEMAND_FEED "ON_DEMAND_FEED" waits until OnDemandService::(std::int64_t,double) is invoked
223 * before connecting.
224 *
225 * By default, without this property, connection is not established until @ref DXEndpoint::connect(const
226 * std::string&) "connect(address)" is invoked.
227 *
228 * Credentials for access to premium services may be configured with
229 * DXEndpoint::DXFEED_USER_PROPERTY and DXEndpoint::DXFEED_PASSWORD_PROPERTY.
230 *
231 * @see Builder::withProperty(const std::string&, const std::string&)
232 */
233 static const std::string DXFEED_ADDRESS_PROPERTY;
234
235 /**
236 * `"dxfeed.user"`
237 *
238 * Defines default user name for an endpoint with role @ref Role::FEED "FEED" or @ref Role::ON_DEMAND_FEED
239 * "ON_DEMAND_FEED".
240 *
241 * @see DXEndpoint::user(const std::string&)
242 */
243 static const std::string DXFEED_USER_PROPERTY;
244
245 /**
246 * `"dxfeed.password"`
247 *
248 * Defines default password for an endpoint with role @ref Role::FEED "FEED" or @ref Role::ON_DEMAND_FEED
249 * "ON_DEMAND_FEED".
250 *
251 * @see DXEndpoint::password(const std::string&)
252 */
253 static const std::string DXFEED_PASSWORD_PROPERTY;
254
255 /**
256 * `"dxfeed.threadPoolSize"`
257 *
258 * Defines thread pool size for an endpoint with role @ref Role::FEED "FEED".
259 * By default, the thread pool size is equal to the number of available processors.
260 * @see Builder::withProperty(const std::string&, const std::string&)
261 */
262 static const std::string DXFEED_THREAD_POOL_SIZE_PROPERTY;
263
264 /**
265 * `"dxfeed.aggregationPeriod"`
266 *
267 * Defines data aggregation period an endpoint with role @ref Role::FEED "FEED" that
268 * limits the rate of data notifications. For example, setting the value of this property
269 * to "0.1s" limits notification to once every 100ms (at most 10 per second).
270 * @see Builder::withProperty(const std::string&, const std::string&)
271 */
272 static const std::string DXFEED_AGGREGATION_PERIOD_PROPERTY;
273
274 /**
275 * `"dxfeed.wildcard.enable"`
276 *
277 * Set this property to `true` to turns on wildcard support.
278 * By default, the endpoint does not support wildcards. This property is needed for
279 * WildcardSymbol support and for the use of "tape:..." address in DXPublisher.
280 */
281 static const std::string DXFEED_WILDCARD_ENABLE_PROPERTY;
282
283 /**
284 * `"dxpublisher.properties"`
285 *
286 * Defines path to a file with properties for an endpoint with role @ref Role::PUBLISHER "PUBLISHER".
287 * By default, properties a loaded from a classpath resource named "dxpublisher.properties".
288 * @see Builder::withProperty(const std::string&, const std::string&)
289 */
290 static const std::string DXPUBLISHER_PROPERTIES_PROPERTY;
291
292 /**
293 * `"dxpublisher.address"`
294 *
295 * Defines default connection address for an endpoint with role @ref Role::PUBLISHER "PUBLISHER".
296 * Connection is established to this address as soon as endpoint is created.
297 * By default, connection is not established until DXEndpoint::connect(const std::string&) is invoked.
298 * @see Builder::withProperty(const std::string&, const std::string&)
299 */
300 static const std::string DXPUBLISHER_ADDRESS_PROPERTY;
301
302 /**
303 * `"dxpublisher.threadPoolSize"`
304 *
305 * Defines thread pool size for an endpoint with role @ref Role::PUBLISHER "PUBLISHER".
306 * By default, the thread pool size is equal to the number of available processors.
307 * @see Builder#withProperty(const std::string&, const std::string&)
308 */
310
311 /**
312 * `"dxendpoint.eventTime"`
313 *
314 * Set this property to `true` to enable @ref EventType::getEventTime() "event time" support.
315 * By default, the endpoint does not support event time.
316 *
317 * The event time is available only when the corresponding DXEndpoint is created with this property and
318 * the data source has embedded event times. This is typically true only for data events
319 * that are read from historical tape files and from OnDemandService.
320 * Events that are coming from a network connections do not have an embedded event time information and
321 * event time is not available for them anyway.
322 *
323 * Use this property if you need to work with historical data coming from files
324 * or from OnDemandService or writing data with times to file via DXPublisher using "tape:..." address.
325 */
326 static const std::string DXENDPOINT_EVENT_TIME_PROPERTY;
327
328 /**
329 * `"dxendpoint.storeEverything"`
330 *
331 * Set this property to to store all @ref LastingEvent "lasting" and @ref IndexedEvent "indexed" events even when
332 * there is no subscription on them. By default, the endpoint stores only events from subscriptions. It works in
333 * the same way both for DXFeed and DXPublisher.
334 *
335 * Use this property with extreme care,
336 * since API does not currently provide any means to remove those events from the storage and there might
337 * be an effective memory leak if the spaces of symbols on which events are published grows without bound.
338 */
339 static const std::string DXENDPOINT_STORE_EVERYTHING_PROPERTY;
340
341 /**
342 * `"dxscheme.nanoTime"`
343 *
344 * Set this property to `true` to turn on nanoseconds precision business time.
345 * By default, this feature is turned off.
346 * Business time in most events is available with
347 * millisecond precision by default, while Quote events business @ref Quote::getTime() "time" is available with
348 * seconds precision.
349 *
350 * This method provides a higher-level control than turning on individual properties that are responsible
351 * for nano-time via DXEndpoint::DXSCHEME_ENABLED_PROPERTY_PREFIX. The later can be used to override of fine-time
352 * nano-time support for individual fields. Setting this property to `true` is essentially
353 * equivalent to setting:
354 * ```ini
355 * dxscheme.enabled.Sequence=*
356 * dxscheme.enabled.TimeNanoPart=*
357 * ```
358 */
359 static const std::string DXSCHEME_NANO_TIME_PROPERTY;
360
361 /**
362 * `"dxscheme.enabled."`
363 *
364 * Defines whether a specified field from the scheme should be enabled instead of it's default behaviour.
365 * Use it according to following format:<br>
366 * <b>`dxscheme.enabled.<field_property_name>=<event_name_mask_glob>`</b>
367 *
368 * For example, <b>`dxscheme.enabled.TimeNanoPart=Trade`</b> enables `NanoTimePart` internal field
369 * only in Trade events.
370 *
371 * There is a shortcut for turning on nano-time support using DXEndpoint::DXSCHEME_NANO_TIME_PROPERTY.
372 */
373 static const std::string DXSCHEME_ENABLED_PROPERTY_PREFIX;
374
375 /**
376 * Represents the role of endpoint that was specified during its @ref DXEndpoint::create() "creation".
377 *
378 * @see DXEndpoint
379 */
380 enum class Role : std::int32_t {
381 /**
382 * `FEED` endpoint connects to the remote data feed provider and is optimized for real-time or
383 * delayed data processing (<b>this is a default role</b>). DXEndpoint::getFeed() method
384 * returns feed object that subscribes to the remote data feed provider and receives events from it.
385 * When event processing threads cannot keep up (don't have enough CPU time), data is dynamically conflated to
386 * minimize latency between received events and their processing time.
387 *
388 * This endpoint is automatically connected to the configured data feed as explained in
389 * <a href="#defaultPropertiesSection">default properties section</a>.
390 */
392
393 /**
394 * `ON_DEMAND_FEED` endpoint is similar to DXEndpoint::FEED, but it is designed to be used with OnDemandService
395 * for historical data replay only. It is configured with <a href="#defaultPropertiesSection">default
396 * properties</a>, but is not connected automatically to the data provider until @ref
397 * OnDemandService::(std::int64_t,double) "OnDemandService.replay" method is invoked.
398 *
399 * `ON_DEMAND_FEED` endpoint cannot be connected to an ordinary data feed at all.
400 * OnDemandService::stopAndResume() will have a similar effect to OnDemandService::stopAndClear().
401 *
402 * @see OnDemandService
403 */
405
406 /**
407 * `STREAM_FEED` endpoint is similar to DXEndpoint::FEED and also connects to the remote data feed provider,
408 * but is designed for bulk parsing of data from files. DXEndpoint::getFeed() method
409 * returns feed object that subscribes to the data from the opened files and receives events from them.
410 * Events from the files are not conflated, are not skipped, and are processed as fast as possible.
411 * Note, that in this role, DXFeed::getLastEvent method does not work.
412 */
414
415 /**
416 * `PUBLISHER` endpoint connects to the remote publisher hub (also known as multiplexor) or
417 * creates a publisher on the local host. DXEndpoint#getPublisher() method returns
418 * a publisher object that publishes events to all connected feeds.
419 * Note, that in this role, DXFeed::getLastEvent method does not work and
420 * time-series subscription is not supported.
421 *
422 * This endpoint is automatically connected to the configured data feed as explained in
423 * <a href="#defaultPropertiesSection">default properties section</a>.
424 */
426
427 /**
428 * `STREAM_PUBLISHER` endpoint is similar to DXEndpoint::PUBLISHER and also connects to the remote publisher
429 * hub, but is designed for bulk publishing of data. DXEndpoint::getPublisher() method returns a
430 * publisher object that publishes events to all connected feeds. Published events are not conflated, are not
431 * skipped, and are processed as fast as possible. Note, that in this role, DXFeed::getLastEvent method
432 * does not work and time-series subscription is not supported.
433 */
435
436 /**
437 * `LOCAL_HUB` endpoint is a local hub without ability to establish network connections.
438 * Events that are published via @ref DXEndpoint::getPublisher() "publisher" are delivered to local
439 * @ref DXEndpoint::getFeed() "feed" only.
440 */
442 };
443
444 static std::string roleToString(Role role);
445
446 /**
447 * Represents the current state of endpoint.
448 *
449 * @see DXEndpoint
450 */
451 enum class State : std::int32_t {
452 /**
453 * Endpoint was created by is not connected to remote endpoints.
454 */
456
457 /**
458 * The @ref DXEndpoint::connect(const std::string&) "connect" method was called to establish connection to
459 * remove endpoint, but connection is not actually established yet or was lost.
460 */
462
463 /**
464 * The connection to remote endpoint is established.
465 */
467
468 /**
469 * Endpoint was @ref DXEndpoint::close() "closed".
470 */
472 };
473
474 static std::string stateToString(State state);
475
476 private:
477 JavaObjectHandle<DXEndpoint> handle_;
478 Role role_ = Role::FEED;
479 std::string name_{};
480 JavaObjectHandle<DXEndpointStateChangeListener> stateChangeListenerHandle_;
481 SimpleHandler<void(State, State)> onStateChange_{};
482
483 // Throws:
484 // - std::bad_alloc if it was not possible to allocate the required amount of memory
485 // - InvalidArgumentException if endpointHandle is nullptr
486 // - JavaException if something happened with the dxFeed API backend
487 // - GraalException if something happened with the GraalVM
488 static std::shared_ptr<DXEndpoint> create(void *endpointHandle, Role role,
489 const std::unordered_map<std::string, std::string> &properties);
490
491 void executorImpl(const JavaObjectHandle<ExecutorTag> &executor) const;
492
493 struct Impl;
494
495 std::unique_ptr<Impl> impl_;
496
497 public:
498 explicit DXEndpoint(LockExternalConstructionTag);
499 DXEndpoint(LockExternalConstructionTag, JavaObjectHandle<DXEndpoint> &&handle, Role role, std::string name);
500
501 ~DXEndpoint() noexcept override;
502
503 /**
504 * Returns a default application-wide singleton instance of DXEndpoint with a @ref Role::FEED "FEED" role.
505 * Most applications use only a single data-source and should rely on this method to get one.
506 * This method creates an endpoint on the first use with a default
507 * configuration as explained in
508 * <a href="#defaultPropertiesSection">default properties section</a> of DXEndpoint class documentation.
509 * You can provide configuration via system properties as explained there.
510 *
511 * This is a shortcut to
512 * @ref DXEndpoint::getInstance(Role) "getInstance"(@ref DXEndpoint "DXEndpoint"::@ref DXEndpoint::Role "Role"::@ref
513 * DXEndpoint.Role::FEED "FEED").
514 * @see DXEndpoint::getInstance(Role)
515 * @throws InvalidArgumentException
516 * @throws JavaException
517 * @throws GraalException
518 */
519 static std::shared_ptr<DXEndpoint> getInstance();
520
521 /**
522 * Returns a default application-wide singleton instance of DXEndpoint for a specific role.
523 * Most applications use only a single data-source and should rely on this method to get one.
524 * This method creates an endpoint with the corresponding role on the first use with a default
525 * configuration as explained in
526 * <a href="#defaultPropertiesSection">default properties section</a> of DXEndpoint class documentation.
527 * You can provide configuration via system properties as explained there.
528 *
529 * The configuration does not have to include an address. You can use @ref DXEndpoint::connect(const std::string&)
530 * "connect(address)" and DXEndpoint::disconnect() methods on the instance that is returned by this method to
531 * programmatically establish and tear-down connection to a user-provided address.
532 *
533 * If you need a fully programmatic configuration and/or multiple endpoints of the same role in your
534 * application, then create a custom instance of DXEndpoint with DXEndpoint::newBuilder() method, configure it,
535 * and use Builder::build() method.
536 *
537 * @param role The role of DXEndpoint instance
538 * @return The DXEndpoint instance
539 * @throws InvalidArgumentException
540 * @throws JavaException
541 * @throws GraalException
542 */
543 static std::shared_ptr<DXEndpoint> getInstance(Role role);
544
545 class Builder;
546
547 /**
548 * Creates new Builder instance.
549 * Use Builder::build() to build an instance of DXEndpoint when all configuration properties were set.
550 *
551 * @return the created endpoint builder.
552 * @throws InvalidArgumentException
553 * @throws JavaException
554 * @throws GraalException
555 */
556 static std::shared_ptr<Builder> newBuilder();
557
558 /**
559 * Creates an endpoint with @ref Role::FEED "FEED" role.
560 * The result of this method is the same as <b>`create(DXEndpoint::Role::FEED)`</b>.
561 * This is a shortcut to
562 * @ref DXEndpoint::newBuilder() "newBuilder()"->@ref Builder::build() "build()"
563 *
564 * @return the created endpoint.
565 * @throws InvalidArgumentException
566 * @throws JavaException
567 * @throws GraalException
568 */
569 static std::shared_ptr<DXEndpoint> create();
570
571 /**
572 * Creates an endpoint with a specified role.
573 * This is a shortcut to
574 * @ref DXEndpoint::newBuilder() "newBuilder()"->@ref Builder::withRole(Role) "withRole(role)"->@ref
575 * Builder::build() "build()"
576 *
577 * @param role the role.
578 * @return the created endpoint.
579 * @throws InvalidArgumentException
580 * @throws JavaException
581 * @throws GraalException
582 */
583 static std::shared_ptr<DXEndpoint> create(Role role);
584
585 /**
586 * Returns the role of this endpoint.
587 *
588 * @return the role.
589 *
590 * @see DXEndpoint
591 */
592 Role getRole() const noexcept;
593
594 /**
595 * Returns the state of this endpoint.
596 *
597 * @return the state.
598 *
599 * @see DXEndpoint
600 * @throws InvalidArgumentException
601 * @throws JavaException
602 * @throws GraalException
603 */
604 State getState() const;
605
606 /**
607 * @return `true` if the endpoint is closed
608 * @throws InvalidArgumentException
609 * @throws JavaException
610 * @throws GraalException
611 */
612 bool isClosed() const;
613
614 /**
615 * @return The user defined endpoint's name
616 */
617 const std::string &getName() const & noexcept;
618
619 /**
620 * Adds listener that is notified about changes in @ref DXEndpoint::getState() "state" property.
621 *
622 * <p>Installed listener can be removed by `id` with DXEndpoint::removeStateChangeListener method or by call
623 * `::onStateChange() -= id`;
624 *
625 * @param listener The listener to add
626 * @return the listener id
627 */
628 std::size_t addStateChangeListener(std::function<void(State, State)> listener) noexcept {
629 return onStateChange_ += std::move(listener);
630 }
631
632 /**
633 * Removes listener that is notified about changes in @ref DXEndpoint::getState() "state" property.
634 * It removes the listener that was previously installed with DXEndpoint::addStateChangeListener method.
635 *
636 * @param listenerId The listener id to remove
637 */
638 void removeStateChangeListener(std::size_t listenerId) noexcept;
639
640 /**
641 * Returns the onStateChange @ref SimpleHandler<void(ArgTypes...)> "handler" that can be used to add or remove
642 * listeners.
643 *
644 * @return onStateChange handler with `void(State, State)` signature
645 */
646 SimpleHandler<void(DXEndpoint::State, DXEndpoint::State)> &onStateChange() noexcept;
647
648 template <typename Executor> std::shared_ptr<DXEndpoint> executor(const std::shared_ptr<Executor> &executor) {
649 executorImpl(executor->getHandle());
650
651 return sharedAs<DXEndpoint>();
652 }
653
654 /**
655 * Changes user name for this endpoint.
656 * This method shall be called before @ref DXEndpoint::connect(const std::string&) "connect" together
657 * with @ref DXEndpoint::password(const std::string&) "password" to configure service access credentials.
658 *
659 * @param user The user name.
660 *
661 * @return this DXEndpoint.
662 * @throws InvalidArgumentException
663 * @throws JavaException
664 * @throws GraalException
665 */
666 std::shared_ptr<DXEndpoint> user(const std::string &user);
667
668 /**
669 * Changes password for this endpoint.
670 * This method shall be called before @ref DXEndpoint::connect(const std::string&) "connect" together
671 * with @ref DXEndpoint::user(const std::string&) "user" to configure service access credentials.
672 *
673 * @param password The password.
674 *
675 * @return this DXEndpoint.
676 * @throws InvalidArgumentException
677 * @throws JavaException
678 * @throws GraalException
679 */
680 std::shared_ptr<DXEndpoint> password(const std::string &password);
681
682 /**
683 * Connects to the specified remote address. Previously established connections are closed if
684 * the new address is different from the old one.
685 * This method does nothing if address does not change or if this endpoint is @ref State::CLOSED "CLOSED".
686 * The endpoint @ref DXEndpoint::getState() "state" immediately becomes @ref State::CONNECTING "CONNECTING"
687 * otherwise.
688 *
689 * <p> The address string is provided with the market data vendor agreement.
690 * Use "demo.dxfeed.com:7300" for a demo quote feed.
691 *
692 * <p> The simplest address strings have the following format:
693 * * `host:port` to establish a TCP/IP connection.
694 * * `:port` to listen for a TCP/IP connection with a plain socket connector (good for up to a
695 * few hundred of connections).
696 *
697 * <p>For premium services access credentials must be configured before invocation of `connect` method
698 * using @ref ::user(const std::string&) "user" and @ref ::password(const std::string&) "password" methods.
699 *
700 * <p> <b>This method does not wait until connection actually gets established</b>. The actual connection
701 * establishment happens asynchronously after the invocation of this method. However, this method waits until
702 * notification about state transition from State::NOT_CONNECTED to State::CONNECTING gets processed by all
703 * listeners.
704 *
705 * [Javadoc.](https://docs.dxfeed.com/dxfeed/api/com/dxfeed/api/DXEndpoint.html#connect-java.lang.String-)
706 *
707 * @param address The data source address.
708 * @return this DXEndpoint.
709 *
710 * @throws InvalidArgumentException
711 * @throws JavaException if something happened with the dxFeed API backend or if address string is malformed.
712 * @throws GraalException
713 */
714 std::shared_ptr<DXEndpoint> connect(const std::string &address);
715
716 /**
717 * Terminates all established network connections and initiates connecting again with the same address.
718 *
719 * <p>The effect of the method is alike to invoking ::disconnect() and ::connect(const std::string&)
720 * with the current address, but internal resources used for connections may be reused by implementation.
721 * TCP connections with multiple target addresses will try switch to an alternative address, configured
722 * reconnect timeouts will apply.
723 *
724 * <p><b>Note:</b> The method will not connect endpoint that was not initially connected with
725 * ::connect(const std::string&) method or was disconnected with ::disconnect() method.
726 *
727 * <p>The method initiates a short-path way for reconnecting, so whether observers will have a chance to see
728 * an intermediate state State#NOT_CONNECTED depends on the implementation.
729 *
730 * [Javadoc.](https://docs.dxfeed.com/dxfeed/api/com/dxfeed/api/DXEndpoint.html#reconnect--)
731 *
732 * @throws InvalidArgumentException
733 * @throws JavaException
734 * @throws GraalException
735 */
736 void reconnect();
737
738 /**
739 * Terminates all remote network connections.
740 * This method does nothing if this endpoint is @ref State#CLOSED "CLOSED".
741 * The endpoint @ref ::getState() "state" immediately becomes @ref State::NOT_CONNECTED "NOT_CONNECTED" otherwise.
742 *
743 * <p>This method does not release all resources that are associated with this endpoint.
744 * Use ::close() method to release all resources.
745 *
746 * [Javadoc.](https://docs.dxfeed.com/dxfeed/api/com/dxfeed/api/DXEndpoint.html#disconnect--)
747 *
748 * @throws InvalidArgumentException
749 * @throws JavaException
750 * @throws GraalException
751 */
752 void disconnect();
753
754 /**
755 * Terminates all remote network connections and clears stored data.
756 * This method does nothing if this endpoint is @ref State::CLOSED "CLOSED".
757 * The endpoint @ref ::getState() "state" immediately becomes @ref State::NOT_CONNECTED "NOT_CONNECTED" otherwise.
758 *
759 * <p>This method does not release all resources that are associated with this endpoint.
760 * Use close() method to release all resources.
761 *
762 * [Javadoc.](https://docs.dxfeed.com/dxfeed/api/com/dxfeed/api/DXEndpoint.html#disconnectAndClear--)
763 *
764 * @throws InvalidArgumentException
765 * @throws JavaException
766 * @throws GraalException
767 */
768 void disconnectAndClear();
769
770 /**
771 * Closes this endpoint. All network connection are terminated as with ::disconnect() method and no further
772 * connections can be established.
773 *
774 * The endpoint @ref ::getState() "state" immediately becomes @ref State::CLOSED "CLOSED".
775 * All resources associated with this endpoint are released.
776 *
777 * [Javadoc.](https://docs.dxfeed.com/dxfeed/api/com/dxfeed/api/DXEndpoint.html#close--)
778 *
779 * @throws InvalidArgumentException
780 * @throws JavaException
781 * @throws GraalException
782 */
783 void close();
784
785 /**
786 * Waits while this endpoint @ref ::getState() "state" becomes @ref State::NOT_CONNECTED "NOT_CONNECTED" or
787 * @ref State::CLOSED "CLOSED". It is a signal that any files that were opened with
788 * @ref connect(const std::string&) "connect(\"file:...\")" method were finished reading, but not necessary were
789 * completely processed by the corresponding subscription listeners. Use closeAndAwaitTermination() after this
790 * method returns to make sure that all processing has completed.
791 *
792 * <p><b>This method is blocking.</b>
793 *
794 * [Javadoc.](https://docs.dxfeed.com/dxfeed/api/com/dxfeed/api/DXEndpoint.html#awaitNotConnected--)
795 *
796 * @throws InvalidArgumentException
797 * @throws JavaException
798 * @throws GraalException
799 */
800 void awaitNotConnected();
801
802 /**
803 * Waits until this endpoint stops processing data (becomes quiescent).
804 * This is important when writing data to file via "tape:..." connector to make sure that
805 * all published data was written before closing this endpoint.
806 *
807 * [Javadoc.](https://docs.dxfeed.com/dxfeed/api/com/dxfeed/api/DXEndpoint.html#awaitProcessed--)
808 *
809 * @throws InvalidArgumentException
810 * @throws JavaException
811 * @throws GraalException
812 */
813 void awaitProcessed();
814
815 /**
816 * Closes this endpoint and wait until all pending data processing tasks are completed.
817 * This method performs the same actions as close ::close(), but also awaits
818 * termination of all outstanding data processing tasks. It is designed to be used
819 * with @ref Role::STREAM_FEED "STREAM_FEED" role after ::awaitNotConnected() method returns
820 * to make sure that file was completely processed.
821 *
822 * <p><b>This method is blocking.</b>
823 *
824 * [Javadoc.](https://docs.dxfeed.com/dxfeed/api/com/dxfeed/api/DXEndpoint.html#closeAndAwaitTermination--)
825 *
826 * @throws InvalidArgumentException
827 * @throws JavaException
828 * @throws GraalException
829 */
831
832 // TODO: implement [EN-8234]
833 std::unordered_set<EventTypeEnum> getEventTypes() noexcept;
834
835 /**
836 * @return The feed that is associated with this endpoint.
837 * @throws InvalidArgumentException
838 * @throws JavaException
839 * @throws GraalException
840 */
841 std::shared_ptr<DXFeed> getFeed();
842
843 /**
844 * @return The publisher that is associated with this endpoint.
845 * @throws InvalidArgumentException
846 * @throws JavaException
847 * @throws GraalException
848 */
849 std::shared_ptr<DXPublisher> getPublisher();
850
851 /**
852 * Builder class for DXEndpoint that supports additional configuration properties.
853 *
854 * Some methods that are not marked `noexcept` may throw exceptions:
855 *
856 * @throws InvalidArgumentException if handle is invalid.
857 * @throws JavaException if something happened with the dxFeed API backend
858 * @throws GraalException if something happened with the GraalVM
859 */
861 friend DXEndpoint;
862
863 JavaObjectHandle<Builder> handle_;
864 Role role_ = Role::FEED;
865 std::unordered_map<std::string, std::string> properties_;
866
867 // Throws:
868 // - std::bad_alloc if it was not possible to allocate the required amount of memory
869 // - JavaException if something happened with the dxFeed API backend
870 // - GraalException if something happened with the GraalVM
871 static std::shared_ptr<Builder> create();
872
873 /**
874 * Tries to load the default properties file for Role::FEED, Role::ON_DEMAND_FEED or Role::PUBLISHER role.
875 *
876 * The default properties file is loaded only if there are no system properties or user properties set with the
877 * same key and the file itself exists and is readable.
878 *
879 * This file must be in the <a href="https://en.wikipedia.org/wiki/.properties">Java properties file format</a>.
880 * File be named "dxfeed.properties" for Role::FEED and Role::ON_DEMAND_FEED roles
881 * or "dxpublisher.properties" for the Role::PUBLISHER role.
882 *
883 * Non thread-safe.
884 * @throws InvalidArgumentException
885 * @throws JavaException
886 * @throws GraalException
887 */
888 void loadDefaultPropertiesImpl();
889
890 public:
891 explicit Builder(LockExternalConstructionTag) noexcept;
892
893 /// Releases the GraalVM handle
894 ~Builder() noexcept override;
895
896 /**
897 * Changes name that is used to distinguish multiple endpoints
898 * in the same process (GraalVM Isolate) in logs and in other diagnostic means.
899 * This is a shortcut for @ref ::withProperty "withProperty"(::NAME_PROPERTY, `name`)
900 *
901 * @param name The endpoint's name
902 *
903 * @return `this` endpoint builder.
904 * @throws InvalidArgumentException
905 * @throws JavaException
906 * @throws GraalException
907 */
908 std::shared_ptr<Builder> withName(const std::string &name);
909
910 /**
911 * Sets role for the created DXEndpoint.
912 * Default role is @ref Role::FEED "FEED".
913 *
914 * @param role The endpoint's role
915 *
916 * @return `this` endpoint builder.
917 * @throws InvalidArgumentException
918 * @throws JavaException
919 * @throws GraalException
920 */
921 std::shared_ptr<Builder> withRole(Role role);
922
923 /**
924 * Sets the specified property. Unsupported properties are ignored.
925 *
926 * @param key The endpoint's property key
927 * @param value The endpoint's property value
928 * @return `this` endpoint builder.
929 *
930 * @see ::supportsProperty(const std::string&)
931 * @throws InvalidArgumentException
932 * @throws JavaException
933 * @throws GraalException
934 */
935 std::shared_ptr<Builder> withProperty(const std::string &key, const std::string &value);
936
937 /**
938 * Sets all supported properties from the provided properties object.
939 *
940 * @tparam Properties The properties' type (std::map, std::unordered_map etc)
941 * @param properties The endpoint's properties
942 * @return `this` endpoint builder.
943 *
944 * @see ::withProperty(const std::string&, const std::string&)
945 * @throws InvalidArgumentException
946 * @throws JavaException
947 * @throws GraalException
948 */
949 template <typename Properties> std::shared_ptr<Builder> withProperties(Properties &&properties) {
950 if constexpr (Debugger::isDebug) {
951 Debugger::debug("DXEndpoint::Builder{" + handle_.toString() + "}::withProperties(properties[" +
952 std::to_string(properties.size()) + "])");
953 }
954
955 for (auto &&[k, v] : properties) {
957 }
958
959 return sharedAs<Builder>();
960 }
961
962 /**
963 * Checks if a property is supported
964 *
965 * @param key The property's key to be checked for support
966 * @return `true` if the corresponding property key is supported.
967 *
968 * @see ::withProperty(const std::string&, const std::string&)
969 * @throws InvalidArgumentException
970 * @throws JavaException
971 * @throws GraalException
972 */
973 bool supportsProperty(const std::string &key);
974
975 /**
976 * Builds DXEndpoint instance.
977 *
978 * @return the created endpoint.
979 * @throws InvalidArgumentException
980 * @throws JavaException
981 * @throws GraalException
982 */
983 std::shared_ptr<DXEndpoint> build();
984 };
985
986 std::string toString() const override;
987};
988
990
991template <typename OS> OS &operator<<(OS &os, dxfcpp::DXEndpoint::State state) {
992 os << dxfcpp::DXEndpoint::stateToString(state);
993
994 return os;
995}
996
#define DXFCXX_DISABLE_MSC_WARNINGS_POP()
Definition Conf.hpp:22
#define DXFCPP_CXX20_CONSTEXPR_STRING
Definition Conf.hpp:121
#define DXFCPP_END_NAMESPACE
Definition Conf.hpp:70
#define DXFCPP_BEGIN_NAMESPACE
Definition Conf.hpp:67
#define DXFCXX_DISABLE_GCC_WARNINGS_PUSH(warnings)
Definition Conf.hpp:38
#define DXFCXX_DISABLE_GCC_WARNINGS_POP()
Definition Conf.hpp:40
#define DXFCXX_DISABLE_MSC_WARNINGS_PUSH(warnings)
Definition Conf.hpp:21
#define DXFCPP_TRACE_ISOLATES
Definition Debug.hpp:19
#define DXFCPP_DEBUG
Definition Debug.hpp:15
#define DXFCPP_TRACE_LISTS
Definition Debug.hpp:22
DXFCPP_EXPORT dxfc_error_code_t dxfc_dxendpoint_builder_with_properties(dxfc_dxendpoint_builder_t builder, const dxfc_dxendpoint_property_t **properties, size_t size)
Sets all supported properties from the provided properties object.
Definition DXEndpoint.cpp:700
DXFCPP_EXPORT dxfc_error_code_t dxfc_dxendpoint_password(dxfc_dxendpoint_t endpoint, const char *password)
Changes password for this endpoint.
Definition DXEndpoint.cpp:943
DXFCPP_EXPORT dxfc_error_code_t dxfc_dxendpoint_get_publisher(dxfc_dxendpoint_t endpoint, DXFC_OUT dxfc_dxpublisher_t *publisher)
Definition DXEndpoint.cpp:1133
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:727
DXFCPP_EXPORT dxfc_error_code_t dxfc_dxendpoint_add_state_change_listener(dxfc_dxendpoint_t endpoint, dxfc_dxendpoint_state_change_listener listener)
Adds listener that is notified about changes in state property.
Definition DXEndpoint.cpp:1079
DXFCPP_EXPORT dxfc_error_code_t dxfc_dxendpoint_disconnect(dxfc_dxendpoint_t endpoint)
Terminates all remote network connections.
Definition DXEndpoint.cpp:994
#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:892
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:1045
dxfc_dxendpoint_state_t
Represents the current state of endpoint.
Definition api.h:149
@ DXFC_DXENDPOINT_STATE_CLOSED
Endpoint was closed.
Definition api.h:169
@ DXFC_DXENDPOINT_STATE_NOT_CONNECTED
Endpoint was created by is not connected to remote endpoints.
Definition api.h:153
@ DXFC_DXENDPOINT_STATE_CONNECTING
The connect function was called to establish connection to remove endpoint, but connection is not act...
Definition api.h:159
@ DXFC_DXENDPOINT_STATE_CONNECTED
The connection to remote endpoint is established.
Definition api.h:164
DXFCPP_EXPORT dxfc_error_code_t dxfc_dxendpoint_get_instance(void *user_data, DXFC_OUT dxfc_dxendpoint_t *endpoint)
Returns a default application-wide singleton instance of dxFeed endpoint with a FEED role.
Definition DXEndpoint.cpp:785
#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:1062
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:683
DXFCPP_EXPORT dxfc_error_code_t dxfc_dxendpoint_builder_free(dxfc_dxendpoint_builder_t builder)
Removes a builder from the registry.
Definition DXEndpoint.cpp:773
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:960
dxfc_error_code_t
List of error codes.
Definition api.h:49
@ DXFC_EC_ERROR
The error returned if the current operation cannot be completed.
Definition api.h:60
@ DXFC_EC_SUCCESS
OK.
Definition api.h:53
@ DXFC_EC_G_ERR
dxFeed Graal Native API error.
Definition api.h:57
DXFCPP_EXPORT dxfc_error_code_t dxfc_dxendpoint_remove_state_change_listener(dxfc_dxendpoint_t endpoint, dxfc_dxendpoint_state_change_listener listener)
Removes listener that is notified about changes in state property.
Definition DXEndpoint.cpp:1105
DXFCPP_EXPORT dxfc_error_code_t dxfc_dxendpoint_builder_with_name(dxfc_dxendpoint_builder_t builder, const char *name)
Changes name that is used to distinguish multiple endpoints in the same process (GraalVM Isolate) in ...
Definition DXEndpoint.cpp:667
DXFCPP_EXPORT dxfc_error_code_t dxfc_system_set_property(const char *key, const char *value)
Sets the system property indicated by the specified key.
Definition System.cpp:68
DXFCPP_EXPORT dxfc_error_code_t dxfc_dxendpoint_builder_build(dxfc_dxendpoint_builder_t builder, void *user_data, DXFC_OUT dxfc_dxendpoint_t *endpoint)
Builds the new dxFeed endpoint instance.
Definition DXEndpoint.cpp:744
DXFCPP_EXPORT dxfc_error_code_t dxfc_dxendpoint_get_feed(dxfc_dxendpoint_t endpoint, DXFC_OUT dxfc_dxfeed_t *feed)
Definition DXEndpoint.cpp:1128
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:1028
DXFCPP_EXPORT dxfc_error_code_t dxfc_dxendpoint_close(dxfc_dxendpoint_t endpoint)
Closes this endpoint.
Definition DXEndpoint.cpp:875
DXFCPP_EXPORT dxfc_error_code_t dxfc_dxendpoint_new_builder(DXFC_OUT dxfc_dxendpoint_builder_t *builder)
Creates new dxFeed endpoint's builder instance.
Definition DXEndpoint.cpp:634
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:977
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:909
DXFCPP_EXPORT dxfc_error_code_t dxfc_dxendpoint_user(dxfc_dxendpoint_t endpoint, const char *user)
Changes username for this endpoint.
Definition DXEndpoint.cpp:926
DXFCPP_EXPORT dxfc_error_code_t dxfc_system_get_property(const char *key, DXFC_OUT char *buffer, size_t buffer_size)
Gets the system property indicated by the specified key.
dxfc_dxendpoint_role_t
Represents the role of endpoint that was specified during its creation.
Definition api.h:89
@ DXFC_DXENDPOINT_ROLE_PUBLISHER
PUBLISHER endpoint connects to the remote publisher hub (also known as multiplexor) or creates a publ...
Definition api.h:127
@ DXFC_DXENDPOINT_ROLE_STREAM_FEED
STREAM_FEED endpoint is similar to DXFC_DXENDPOINT_ROLE_FEED and also connects to the remote data fee...
Definition api.h:116
@ DXFC_DXENDPOINT_ROLE_FEED
FEED endpoint connects to the remote data feed provider and is optimized for real-time or delayed dat...
Definition api.h:99
@ DXFC_DXENDPOINT_ROLE_STREAM_PUBLISHER
STREAM_PUBLISHER endpoint is similar to DXFC_DXENDPOINT_ROLE_PUBLISHER and also connects to the remot...
Definition api.h:136
@ DXFC_DXENDPOINT_ROLE_LOCAL_HUB
LOCAL_HUB endpoint is a local hub without ability to establish network connections.
Definition api.h:143
@ DXFC_DXENDPOINT_ROLE_ON_DEMAND_FEED
ON_DEMAND_FEED endpoint is similar to DXFC_DXENDPOINT_ROLE_FEED, but it is designed to be used with d...
Definition api.h:107
void * dxfc_dxpublisher_t
The dxFeed publisher handle.
Definition api.h:217
DXFCPP_EXPORT dxfc_error_code_t dxfc_dxendpoint_create(void *user_data, DXFC_OUT dxfc_dxendpoint_t *endpoint)
Creates an endpoint with FEED role.
Definition DXEndpoint.cpp:830
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:807
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:650
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:852
DXFCPP_EXPORT dxfc_error_code_t dxfc_dxendpoint_free(dxfc_dxendpoint_t endpoint)
Removes the dxFeed endpoint from the registry.
Definition DXEndpoint.cpp:1138
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:1011
Builder class for DXEndpoint that supports additional configuration properties.
Definition DXEndpoint.hpp:860
bool supportsProperty(const std::string &key)
Checks if a property is supported.
Definition DXEndpoint.cpp:323
std::shared_ptr< DXEndpoint > build()
Builds DXEndpoint instance.
Definition DXEndpoint.cpp:332
std::shared_ptr< Builder > withProperty(const std::string &key, const std::string &value)
Sets the specified property.
Definition DXEndpoint.cpp:308
std::shared_ptr< Builder > withName(const std::string &name)
Changes name that is used to distinguish multiple endpoints in the same process (GraalVM Isolate) in ...
Definition DXEndpoint.cpp:362
std::shared_ptr< Builder > withProperties(Properties &&properties)
Sets all supported properties from the provided properties object.
Definition DXEndpoint.hpp:949
~Builder() noexcept override
Releases the GraalVM handle.
Definition DXEndpoint.cpp:352
std::shared_ptr< Builder > withRole(Role role)
Sets role for the created DXEndpoint.
Definition DXEndpoint.cpp:296
Subscription for a set of symbols and event types.
Definition DXFeedSubscription.hpp:40
The enumeration type that provides additional information about the dxFeed Graal C++-API event type.
Definition EventTypeEnum.hpp:21
bool isTimeSeries() const noexcept
Definition EventTypeEnum.hpp:174
const std::string & getClassName() const &noexcept
Definition EventTypeEnum.hpp:117
bool isLasting() const noexcept
Definition EventTypeEnum.hpp:160
bool isOnlyIndexed() const noexcept
Definition EventTypeEnum.hpp:181
bool isIndexed() const noexcept
Definition EventTypeEnum.hpp:167
std::uint32_t getId() const noexcept
Definition EventTypeEnum.hpp:103
bool isMarket() const noexcept
Definition EventTypeEnum.hpp:188
const std::string & getName() const &noexcept
Definition EventTypeEnum.hpp:110
Source identifier for IndexedEvent.
Definition IndexedEventSource.hpp:22
static void freeGraal(void *graalNative)
Releases the memory occupied by the dxFeed Graal SDK structure (recursively if necessary).
Definition IndexedEventSource.cpp:21
const std::string & name() const noexcept
Returns the string representation of the object.
Definition IndexedEventSource.hpp:90
static IndexedEventSource fromGraal(void *graalNative)
Creates an object of the current type and fills it with data from the the dxFeed Graal SDK structure.
Definition IndexedEventSource.cpp:32
static const IndexedEventSource DEFAULT
The default source with zero identifier for all events that do not support multiple sources.
Definition IndexedEventSource.hpp:13
std::int32_t id() const noexcept
Returns the source identifier.
Definition IndexedEventSource.hpp:81
virtual void * toGraal() const
Allocates memory for the dxFeed Graal SDK structure (recursively if necessary).
Definition IndexedEventSource.cpp:15
std::string toString() const
Returns the string representation of the object.
Definition IndexedEventSource.hpp:99
IndexedEventSource(std::int32_t id, std::string name) noexcept
Creates the new IndexedEvent's source by id and name.
Definition IndexedEventSource.hpp:73
Represents subscription to a specific source of indexed events.
Definition IndexedEventSubscriptionSymbol.hpp:40
virtual const std::unique_ptr< SymbolWrapper > & getEventSymbol() const
Returns the wrapped event symbol (CandleSymbol, WildcardSymbol, etc).
Definition IndexedEventSubscriptionSymbol.cpp:16
virtual void * toGraal() const
Allocates memory for the dxFeed Graal SDK structure (recursively if necessary).
Definition IndexedEventSubscriptionSymbol.cpp:24
static IndexedEventSubscriptionSymbol fromGraal(void *graalNative)
Creates an object of the current type and fills it with data from the the dxFeed Graal SDK structure ...
Definition IndexedEventSubscriptionSymbol.cpp:46
virtual const std::unique_ptr< IndexedEventSource > & getSource() const
Returns indexed event source.
Definition IndexedEventSubscriptionSymbol.cpp:20
IndexedEventSubscriptionSymbol(const SymbolWrapper &eventSymbol, const IndexedEventSource &source)
Creates indexed event subscription symbol with a specified event symbol and source.
Definition IndexedEventSubscriptionSymbol.cpp:10
static void freeGraal(void *graalNative)
Releases the memory occupied by the dxFeed Graal SDK structure (recursively if necessary).
Definition IndexedEventSubscriptionSymbol.cpp:33
virtual std::string toString() const
Returns string representation of this indexed event subscription symbol.
Definition IndexedEventSubscriptionSymbol.cpp:61
static const OrderSource GLBX
CME Globex.
Definition OrderSource.hpp:307
static const OrderSource smfe
Small Exchange.
Definition OrderSource.hpp:371
static const OrderSource bzx
Bats BZX Exchange.
Definition OrderSource.hpp:235
static const OrderSource DEX
Direct-Edge EDGX Exchange.
Definition OrderSource.hpp:202
static const OrderSource NTV
NASDAQ Total View.
Definition OrderSource.hpp:138
static const OrderSource AGGREGATE_ASK
Ask side of an aggregate order book (futures depth and NASDAQ Level II).
Definition OrderSource.hpp:123
static const OrderSource & valueOf(std::int32_t sourceId)
Returns order source for the specified source identifier.
Definition OrderSource.cpp:178
static const OrderSource ESPD
NASDAQ eSpeed.
Definition OrderSource.hpp:162
static const OrderSource CFE
CBOE Futures Exchange.
Definition OrderSource.hpp:347
static const OrderSource ntv
NASDAQ Total View.
Definition OrderSource.hpp:146
static const OrderSource ICE
Intercontinental Exchange.
Definition OrderSource.hpp:178
static const OrderSource BZX
Bats BZX Exchange.
Definition OrderSource.hpp:227
static const OrderSource C2OX
CBOE Options C2 Exchange.
Definition OrderSource.hpp:355
static const OrderSource REGIONAL_ASK
Ask side of a regional Quote.
Definition OrderSource.hpp:111
static const OrderSource REGIONAL_BID
Bid side of a regional Quote.
Definition OrderSource.hpp:104
static const OrderSource ABE
ABE (abe.io) exchange.
Definition OrderSource.hpp:291
static const OrderSource CEUX
Bats Europe DXE Exchange.
Definition OrderSource.hpp:259
static const OrderSource OCEA
Blue Ocean Technologies Alternative Trading System.
Definition OrderSource.hpp:403
static const OrderSource AGGREGATE_BID
Bid side of an aggregate order book (futures depth and NASDAQ Level II).
Definition OrderSource.hpp:117
static const OrderSource BXTR
Bats Europe TRF.
Definition OrderSource.hpp:267
static const OrderSource dex
Direct-Edge EDGX Exchange.
Definition OrderSource.hpp:211
static const OrderSource cedx
Cboe European Derivatives.
Definition OrderSource.hpp:444
static const OrderSource COMPOSITE_ASK
Ask side of a composite Quote.
Definition OrderSource.hpp:97
static const OrderSource XNFI
NASDAQ Fixed Income.
Definition OrderSource.hpp:170
static const OrderSource iex
Investors exchange.
Definition OrderSource.hpp:379
static const OrderSource xeur
Eurex Exchange.
Definition OrderSource.hpp:339
static const OrderSource CEDX
Cboe European Derivatives.
Definition OrderSource.hpp:436
static const OrderSource ISE
International Securities Exchange.
Definition OrderSource.hpp:186
static const OrderSource DEA
Direct-Edge EDGA Exchange.
Definition OrderSource.hpp:194
static const OrderSource glbx
CME Globex.
Definition OrderSource.hpp:315
static const OrderSource BI20
Borsa Istanbul Exchange.
Definition OrderSource.hpp:283
static const OrderSource BYX
Bats BYX Exchange.
Definition OrderSource.hpp:219
static const OrderSource FAIR
FAIR (FairX) exchange.
Definition OrderSource.hpp:299
static const OrderSource BATE
Bats Europe BXE Exchange.
Definition OrderSource.hpp:243
static const OrderSource pink
Pink Sheets.
Definition OrderSource.hpp:412
static const OrderSource DEFAULT
Default source for publishing custom order books.
Definition OrderSource.hpp:130
static const OrderSource NFX
NASDAQ Futures Exchange.
Definition OrderSource.hpp:154
static const OrderSource memx
Members Exchange.
Definition OrderSource.hpp:395
static bool isSpecialSourceId(std::int32_t sourceId) noexcept
Determines whether specified source identifier refers to special order source.
Definition OrderSource.cpp:174
static const OrderSource IST
Borsa Istanbul Exchange.
Definition OrderSource.hpp:275
static const OrderSource ARCA
NYSE Arca traded securities.
Definition OrderSource.hpp:420
static const OrderSource CHIX
Bats Europe CXE Exchange.
Definition OrderSource.hpp:251
static const OrderSource & valueOf(const std::string &name)
Returns order source for the specified source name.
Definition OrderSource.cpp:192
static const OrderSource ERIS
Eris Exchange group of companies.
Definition OrderSource.hpp:323
static const OrderSource XEUR
Eurex Exchange.
Definition OrderSource.hpp:331
static const OrderSource MEMX
Members Exchange.
Definition OrderSource.hpp:387
static const OrderSource COMPOSITE_BID
Bid side of a composite Quote.
Definition OrderSource.hpp:90
static const OrderSource arca
NYSE Arca traded securities.
Definition OrderSource.hpp:428
static const OrderSource SMFE
Small Exchange.
Definition OrderSource.hpp:363
TimeSeriesSubscriptionSymbol(const SymbolWrapper &eventSymbol, std::int64_t fromTime)
Creates 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:63
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 the dxFeed Graal SDK structure ...
Definition TimeSeriesSubscriptionSymbol.cpp:48
static void freeGraal(void *graalNative)
Releases the memory occupied by the dxFeed Graal SDK structure (recursively if necessary).
Definition TimeSeriesSubscriptionSymbol.cpp:32
Candle alignment attribute of CandleSymbol defines how candle are aligned with respect to time.
Definition CandleAlignment.hpp:32
static const CandleAlignment DEFAULT
Default alignment is CandleAlignment::MIDNIGHT.
Definition CandleAlignment.hpp:46
static const CandleAlignment MIDNIGHT
Align candles on midnight.
Definition CandleAlignment.hpp:12
static std::reference_wrapper< const CandleAlignment > getAttributeForSymbol(const dxfcpp::StringLikeWrapper &symbol)
Returns candle alignment of the given candle symbol string.
Definition CandleAlignment.cpp:79
static const CandleAlignment SESSION
Align candles on trading sessions.
Definition CandleAlignment.hpp:13
std::string toString() const
Returns string representation of this candle alignment.
Definition CandleAlignment.cpp:37
static std::string normalizeAttributeForSymbol(const dxfcpp::StringLikeWrapper &symbol)
Returns candle symbol string with the normalized representation of the candle alignment attribute.
Definition CandleAlignment.cpp:91
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:15
std::string changeAttributeForSymbol(const dxfcpp::StringLikeWrapper &symbol) const override
Returns candle event symbol string with this candle alignment set.
Definition CandleAlignment.cpp:32
static std::reference_wrapper< const CandleAlignment > parse(const dxfcpp::StringLikeWrapper &s)
Parses string representation of candle alignment into object.
Definition CandleAlignment.cpp:53
Exchange attribute of CandleSymbol defines exchange identifier where data is taken from to build the ...
Definition CandleExchange.hpp:30
std::string changeAttributeForSymbol(const dxfcpp::StringLikeWrapper &symbol) const override
Returns candle event symbol string with this exchange set.
Definition CandleExchange.hpp:65
static const CandleExchange COMPOSITE
Composite exchange where data is taken from all exchanges.
Definition CandleExchange.hpp:11
char getExchangeCode() const noexcept
Returns exchange code.
Definition CandleExchange.hpp:55
static CandleExchange getAttributeForSymbol(const dxfcpp::StringLikeWrapper &symbol)
Returns exchange attribute object of the given candle symbol string.
Definition CandleExchange.hpp:101
static const CandleExchange DEFAULT
Default exchange is CandleExchange::COMPOSITE.
Definition CandleExchange.hpp:39
std::string toString() const
Returns string representation of this exchange.
Definition CandleExchange.hpp:76
static CandleExchange valueOf(char exchangeCode) noexcept
Returns exchange attribute object that corresponds to the specified exchange code character.
Definition CandleExchange.hpp:90
Period attribute of CandleSymbol defines aggregation period of the candles.
Definition CandlePeriod.hpp:37
static CandlePeriod parse(const dxfcpp::StringLikeWrapper &s)
Parses string representation of aggregation period into object.
Definition CandlePeriod.hpp:155
double getValue() const noexcept
Returns aggregation period value.
Definition CandlePeriod.hpp:109
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:53
static const CandlePeriod TICK
Tick aggregation where each candle represents an individual tick.
Definition CandlePeriod.hpp:50
static const CandlePeriod DEFAULT
Default period is CandlePeriod::TICK.
Definition CandlePeriod.hpp:51
std::int64_t getPeriodIntervalMillis() const noexcept
Returns aggregation period in milliseconds as closely as possible.
Definition CandlePeriod.hpp:88
static const CandlePeriod DAY
Day aggregation where each candle represents a day.
Definition CandlePeriod.hpp:51
static CandlePeriod valueOf(double value, const CandleType &type) noexcept
Returns candle period with the given value and type.
Definition CandlePeriod.hpp:188
const CandleType & getType() const &noexcept
Returns aggregation period type.
Definition CandlePeriod.hpp:117
const std::string & toString() const &
Returns string representation of this aggregation period.
Definition CandlePeriod.hpp:131
std::string changeAttributeForSymbol(const dxfcpp::StringLikeWrapper &symbol) const override
Returns candle event symbol string with this aggregation period set.
Definition CandlePeriod.hpp:97
static std::string normalizeAttributeForSymbol(const dxfcpp::StringLikeWrapper &symbol)
Returns candle symbol string with the normalized representation of the candle period attribute.
Definition CandlePeriod.hpp:219
static CandlePeriod getAttributeForSymbol(const dxfcpp::StringLikeWrapper &symbol) noexcept
Returns candle period of the given candle symbol string.
Definition CandlePeriod.hpp:207
Candle price level attribute of CandleSymbol defines how candles shall be aggregated in respect to pr...
Definition CandlePriceLevel.hpp:40
std::string toString() const
Returns string representation of this price level.
Definition CandlePriceLevel.hpp:80
double getValue() const noexcept
Returns price level value.
Definition CandlePriceLevel.hpp:69
static CandlePriceLevel parse(const dxfcpp::StringLikeWrapper &s)
Parses string representation of candle price level into object.
Definition CandlePriceLevel.hpp:111
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:13
static CandlePriceLevel valueOf(double value)
Returns candle price level with the given value.
Definition CandlePriceLevel.hpp:122
static std::string normalizeAttributeForSymbol(const dxfcpp::StringLikeWrapper &symbol)
Returns candle symbol string with the normalized representation of the candle price level attribute.
Definition CandlePriceLevel.hpp:149
std::string changeAttributeForSymbol(const dxfcpp::StringLikeWrapper &symbol) const override
Returns candle event symbol string with this candle price level set.
Definition CandlePriceLevel.hpp:98
static const CandlePriceLevel DEFAULT
Default price level corresponds to NaN (std::numeric_limits<double>::quiet_NaN())
Definition CandlePriceLevel.hpp:11
static CandlePriceLevel getAttributeForSymbol(const dxfcpp::StringLikeWrapper &symbol)
Returns candle price level of the given candle symbol string.
Definition CandlePriceLevel.hpp:137
Price type attribute of CandleSymbol defines price that is used to build the candles.
Definition CandlePrice.hpp:34
static std::string normalizeAttributeForSymbol(const dxfcpp::StringLikeWrapper &symbol)
Returns candle symbol string with the normalized representation of the candle price type attribute.
Definition CandlePrice.hpp:165
static const CandlePrice BID
Quote bid price.
Definition CandlePrice.hpp:12
static const CandlePrice ASK
Quote ask price.
Definition CandlePrice.hpp:13
static const CandlePrice LAST
Last trading price.
Definition CandlePrice.hpp:11
static std::reference_wrapper< const CandlePrice > getAttributeForSymbol(const dxfcpp::StringLikeWrapper &symbol) noexcept
Returns candle price type of the given candle symbol string.
Definition CandlePrice.hpp:153
static const CandlePrice MARK
Market price defined as average between quote bid and ask prices.
Definition CandlePrice.hpp:14
static std::reference_wrapper< const CandlePrice > parse(const dxfcpp::StringLikeWrapper &s)
Parses string representation of candle price type into object.
Definition CandlePrice.hpp:123
const std::string & toString() const &noexcept
Returns string representation of this candle price type.
Definition CandlePrice.hpp:107
static const CandlePrice DEFAULT
Default price type is CandlePrice::LAST.
Definition CandlePrice.hpp:65
static const CandlePrice SETTLEMENT
Official settlement price that is defined by exchange or last trading price otherwise.
Definition CandlePrice.hpp:15
std::string changeAttributeForSymbol(const dxfcpp::StringLikeWrapper &symbol) const override
Returns candle event symbol string with this candle price type set.
Definition CandlePrice.hpp:95
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:18
const std::string & toString() const &noexcept
Returns string representation of this candle session attribute.
Definition CandleSession.hpp:102
std::string changeAttributeForSymbol(const dxfcpp::StringLikeWrapper &symbol) const override
Returns candle event symbol string with this session attribute set.
Definition CandleSession.hpp:90
static const CandleSession REGULAR
Only regular trading session data is used to build candles.
Definition CandleSession.hpp:45
static std::string normalizeAttributeForSymbol(const dxfcpp::StringLikeWrapper &symbol) noexcept
Returns candle symbol string with the normalized representation of the candle session attribute.
Definition CandleSession.hpp:159
const SessionFilter & getSessionFilter() const &noexcept
Returns session filter that corresponds to this session attribute.
Definition CandleSession.hpp:81
static std::reference_wrapper< const CandleSession > parse(const dxfcpp::StringLikeWrapper &s)
Parses string representation of candle session attribute into object.
Definition CandleSession.hpp:118
static const CandleSession ANY
All trading sessions are used to build candles.
Definition CandleSession.hpp:44
static std::reference_wrapper< const CandleSession > getAttributeForSymbol(const dxfcpp::StringLikeWrapper &symbol)
Returns candle session attribute of the given candle symbol string.
Definition CandleSession.hpp:147
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:60
static const CandleSession DEFAULT
Default trading session is CandleSession::ANY.
Definition CandleSession.hpp:51
Attribute of the CandleSymbol.
Definition CandleSymbolAttribute.hpp:19
virtual std::string changeAttributeForSymbol(const dxfcpp::StringLikeWrapper &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:83
static CandleSymbol valueOf(std::string symbol, CandleSymbolAttributesCollection &&attributes) noexcept
Converts the given string symbol into the candle symbol object with the specified attributes set.
Definition CandleSymbol.hpp:347
const std::optional< CandlePeriod > & getPeriod() const &noexcept
Returns aggregation period of this symbol.
Definition CandleSymbol.hpp:210
const std::optional< CandlePriceLevel > & getPriceLevel() const &noexcept
Returns price level attribute of this symbol.
Definition CandleSymbol.hpp:228
static CandleSymbol valueOf(std::string symbol, std::initializer_list< CandleSymbolAttributeVariant > attributes) noexcept
Converts the given string symbol into the candle symbol object with the specified attributes set (ini...
Definition CandleSymbol.hpp:329
const std::optional< CandleExchange > & getExchange() const &noexcept
Returns exchange attribute of this symbol.
Definition CandleSymbol.hpp:183
const std::string & getBaseSymbol() const &noexcept
Returns base market symbol without attributes.
Definition CandleSymbol.hpp:174
static CandleSymbol valueOf(std::string symbol, CandleSymbolAttributeIt begin, CandleSymbolAttributeIt end) noexcept
Converts the given string symbol into the candle symbol object with the specified attribute set (iter...
Definition CandleSymbol.hpp:316
const std::optional< CandlePrice > & getPrice() const &noexcept
Returns price type attribute of this symbol.
Definition CandleSymbol.hpp:192
static CandleSymbol valueOf(std::string symbol) noexcept
Converts the given string symbol into the candle symbol object.
Definition CandleSymbol.hpp:291
static CandleSymbol valueOf(std::string symbol, const CandleSymbolAttributeVariant &attribute) noexcept
Converts the given string symbol into the candle symbol object with the specified attribute set.
Definition CandleSymbol.hpp:302
virtual void * toGraal() const
Allocates memory for the dxFeed Graal SDK structure (recursively if necessary).
Definition CandleSymbol.cpp:11
const std::string & toString() const &noexcept
Returns string representation of this symbol.
Definition CandleSymbol.hpp:239
static void freeGraal(void *graalNative)
Releases the memory occupied by the dxFeed Graal SDK structure (recursively if necessary).
Definition CandleSymbol.cpp:21
const std::optional< CandleSession > & getSession() const &noexcept
Returns session attribute of this symbol.
Definition CandleSymbol.hpp:201
static CandleSymbol fromGraal(void *graalNative)
Creates an object of the current type and fills it with data from the the dxFeed Graal SDK structure.
Definition CandleSymbol.cpp:36
const std::optional< CandleAlignment > & getAlignment() const &noexcept
Returns alignment attribute of this symbol.
Definition CandleSymbol.hpp:219
Type of the candle aggregation period constitutes CandlePeriod type together its actual value.
Definition CandleType.hpp:27
static const CandleType VOLUME
Certain volume of trades.
Definition CandleType.hpp:76
static const CandleType MONTH
Certain number of months.
Definition CandleType.hpp:61
static const CandleType PRICE_RENKO
Certain price change, calculated according to the following rules:
Definition CandleType.hpp:111
static std::reference_wrapper< const CandleType > parse(const dxfcpp::StringLikeWrapper &s)
Parses string representation of candle type into object.
Definition CandleType.hpp:177
static const CandleType DAY
Certain number of days.
Definition CandleType.hpp:15
std::int64_t getPeriodIntervalMillis() const noexcept
Returns candle type period in milliseconds as closely as possible.
Definition CandleType.hpp:141
static const CandleType WEEK
Certain number of weeks.
Definition CandleType.hpp:16
static const CandleType HOUR
Certain number of hours.
Definition CandleType.hpp:14
static const CandleType PRICE
Certain price change, calculated according to the following rules:
Definition CandleType.hpp:87
static const CandleType TICK
Certain number of ticks.
Definition CandleType.hpp:11
const std::string & toString() const &noexcept
Returns string representation of this candle type.
Definition CandleType.hpp:164
static const CandleType OPTEXP
Certain number of option expirations.
Definition CandleType.hpp:66
static const CandleType SECOND
Certain number of seconds.
Definition CandleType.hpp:12
static const CandleType MINUTE
Certain number of minutes.
Definition CandleType.hpp:13
const std::string & getName() const &noexcept
Returns a name of this candle type.
Definition CandleType.hpp:150
static const CandleType PRICE_MOMENTUM
Certain price change, calculated according to the following rules:
Definition CandleType.hpp:99
static const CandleType YEAR
Certain number of years.
Definition CandleType.hpp:71
Manages network connections to feed or publisher.
Definition DXEndpoint.hpp:186
bool isClosed() const
Definition DXEndpoint.cpp:488
SimpleHandler< void(DXEndpoint::State, DXEndpoint::State)> & onStateChange() noexcept
Returns the onStateChange handler that can be used to add or remove listeners.
Definition DXEndpoint.cpp:500
static const std::string DXFEED_PASSWORD_PROPERTY
"dxfeed.password"
Definition DXEndpoint.hpp:253
static std::shared_ptr< DXEndpoint > create(Role role)
Creates an endpoint with a specified role.
Definition DXEndpoint.cpp:476
void awaitProcessed()
Waits until this endpoint stops processing data (becomes quiescent).
Definition DXEndpoint.cpp:211
State
Represents the current state of endpoint.
Definition DXEndpoint.hpp:451
@ CLOSED
Endpoint was closed.
Definition DXEndpoint.hpp:471
@ CONNECTING
The connect method was called to establish connection to remove endpoint, but connection is not actua...
Definition DXEndpoint.hpp:461
@ CONNECTED
The connection to remote endpoint is established.
Definition DXEndpoint.hpp:466
@ NOT_CONNECTED
Endpoint was created by is not connected to remote endpoints.
Definition DXEndpoint.hpp:455
void disconnectAndClear()
Terminates all remote network connections and clears stored data.
Definition DXEndpoint.cpp:195
void reconnect()
Terminates all established network connections and initiates connecting again with the same address.
Definition DXEndpoint.cpp:179
static std::shared_ptr< DXEndpoint > create()
Creates an endpoint with FEED role.
Definition DXEndpoint.cpp:468
void removeStateChangeListener(std::size_t listenerId) noexcept
Removes listener that is notified about changes in state property.
Definition DXEndpoint.cpp:496
const std::string & getName() const &noexcept
Definition DXEndpoint.cpp:492
Role
Represents the role of endpoint that was specified during its creation.
Definition DXEndpoint.hpp:380
@ PUBLISHER
PUBLISHER endpoint connects to the remote publisher hub (also known as multiplexor) or creates a publ...
Definition DXEndpoint.hpp:425
@ STREAM_FEED
STREAM_FEED endpoint is similar to DXEndpoint::FEED and also connects to the remote data feed provide...
Definition DXEndpoint.hpp:413
@ LOCAL_HUB
LOCAL_HUB endpoint is a local hub without ability to establish network connections.
Definition DXEndpoint.hpp:441
@ ON_DEMAND_FEED
ON_DEMAND_FEED endpoint is similar to DXEndpoint::FEED, but it is designed to be used with OnDemandSe...
Definition DXEndpoint.hpp:404
@ STREAM_PUBLISHER
STREAM_PUBLISHER endpoint is similar to DXEndpoint::PUBLISHER and also connects to the remote publish...
Definition DXEndpoint.hpp:434
@ FEED
FEED endpoint connects to the remote data feed provider and is optimized for real-time or delayed dat...
Definition DXEndpoint.hpp:391
std::string toString() const override
Returns a string representation of the current object.
Definition DXEndpoint.cpp:371
std::shared_ptr< DXFeed > getFeed()
Definition DXEndpoint.cpp:227
static const std::string DXFEED_WILDCARD_ENABLE_PROPERTY
"dxfeed.wildcard.enable"
Definition DXEndpoint.hpp:281
std::size_t addStateChangeListener(std::function< void(State, State)> listener) noexcept
Adds listener that is notified about changes in state property.
Definition DXEndpoint.hpp:628
static const std::string DXENDPOINT_EVENT_TIME_PROPERTY
"dxendpoint.eventTime"
Definition DXEndpoint.hpp:326
static const std::string DXPUBLISHER_THREAD_POOL_SIZE_PROPERTY
"dxpublisher.threadPoolSize"
Definition DXEndpoint.hpp:309
std::shared_ptr< DXEndpoint > connect(const std::string &address)
Connects to the specified remote address.
Definition DXEndpoint.cpp:168
State getState() const
Returns the state of this endpoint.
Definition DXEndpoint.cpp:150
static const std::string DXENDPOINT_STORE_EVERYTHING_PROPERTY
"dxendpoint.storeEverything"
Definition DXEndpoint.hpp:339
static std::shared_ptr< DXEndpoint > getInstance(Role role)
Returns a default application-wide singleton instance of DXEndpoint for a specific role.
Definition DXEndpoint.cpp:452
std::shared_ptr< DXPublisher > getPublisher()
Definition DXEndpoint.cpp:235
static const std::string DXFEED_AGGREGATION_PERIOD_PROPERTY
"dxfeed.aggregationPeriod"
Definition DXEndpoint.hpp:272
std::shared_ptr< DXEndpoint > password(const std::string &password)
Changes password for this endpoint.
Definition DXEndpoint.cpp:161
void close()
Closes this endpoint.
Definition DXEndpoint.cpp:504
static const std::string DXFEED_THREAD_POOL_SIZE_PROPERTY
"dxfeed.threadPoolSize"
Definition DXEndpoint.hpp:262
void awaitNotConnected()
Waits while this endpoint state becomes NOT_CONNECTED or CLOSED.
Definition DXEndpoint.cpp:203
void closeAndAwaitTermination()
Closes this endpoint and wait until all pending data processing tasks are completed.
Definition DXEndpoint.cpp:219
std::shared_ptr< DXEndpoint > user(const std::string &user)
Changes user name for this endpoint.
Definition DXEndpoint.cpp:154
static std::shared_ptr< DXEndpoint > getInstance()
Returns a default application-wide singleton instance of DXEndpoint with a FEED role.
Definition DXEndpoint.cpp:444
static const std::string DXPUBLISHER_ADDRESS_PROPERTY
"dxpublisher.address"
Definition DXEndpoint.hpp:300
static const std::string DXFEED_USER_PROPERTY
"dxfeed.user"
Definition DXEndpoint.hpp:243
static const std::string NAME_PROPERTY
"name"
Definition DXEndpoint.hpp:203
static const std::string DXSCHEME_ENABLED_PROPERTY_PREFIX
"dxscheme.enabled."
Definition DXEndpoint.hpp:373
static const std::string DXPUBLISHER_PROPERTIES_PROPERTY
"dxpublisher.properties"
Definition DXEndpoint.hpp:290
static const std::string DXSCHEME_NANO_TIME_PROPERTY
"dxscheme.nanoTime"
Definition DXEndpoint.hpp:359
static const std::string DXFEED_ADDRESS_PROPERTY
"dxfeed.address"
Definition DXEndpoint.hpp:233
Role getRole() const noexcept
Returns the role of this endpoint.
Definition DXEndpoint.cpp:484
static const std::string DXFEED_PROPERTIES_PROPERTY
"dxfeed.properties"
Definition DXEndpoint.hpp:214
static std::shared_ptr< Builder > newBuilder()
Creates new Builder instance.
Definition DXEndpoint.cpp:460
void disconnect()
Terminates all remote network connections.
Definition DXEndpoint.cpp:187
Main entry class for dxFeed API (read it first).
Definition DXFeed.hpp:116
Provides API for publishing of events to local or remote DXFeed.
Definition DXPublisher.hpp:62
Base abstract class for all dxFeed C++ API entities.
Definition Entity.hpp:13
virtual ~Entity() noexcept=default
The default virtual d-tor.
bool isOrderSource() const noexcept
Definition EventSourceWrapper.hpp:242
std::unique_ptr< void, decltype(&EventSourceWrapper::freeGraal)> toGraalUnique() const noexcept
Allocates memory for the dxFeed Graal SDK structure (recursively if necessary).
Definition EventSourceWrapper.hpp:200
std::string toStringUnderlying() const
Returns a string representation of the underlying object.
Definition EventSourceWrapper.hpp:224
static void freeGraal(void *graalNative)
Releases the memory occupied by the dxFeed Graal SDK structure (recursively if necessary).
Definition EventSourceWrapper.hpp:163
std::string toString() const
Returns a string representation of the current object.
Definition EventSourceWrapper.hpp:209
void * toGraal() const noexcept
Allocates memory for the dxFeed Graal SDK structure (recursively if necessary).
Definition EventSourceWrapper.hpp:184
static EventSourceWrapper fromGraal(void *graalNative)
Creates an object of the current type and fills it with data from the the dxFeed Graal SDK structure.
Definition EventSourceWrapper.cpp:40
const DataType & getData() const noexcept
Definition EventSourceWrapper.hpp:266
EventSourceWrapper(const IndexedEventSource &data) noexcept
Constructs a wrapper from IndexedEventSource.
Definition EventSourceWrapper.hpp:145
bool isIndexedEventSource() const noexcept
Definition EventSourceWrapper.hpp:235
std::optional< IndexedEventSource > asIndexedEventSource() const noexcept
Definition EventSourceWrapper.hpp:250
std::optional< OrderSource > asOrderSource() const noexcept
Definition EventSourceWrapper.hpp:259
EventSourceWrapper(const OrderSource &data) noexcept
Constructs a wrapper from OrderSource.
Definition EventSourceWrapper.hpp:153
Event type parametrized by a symbol.
Definition EventType.hpp:116
virtual const std::optional< Symbol > & getEventSymbolOpt() const &noexcept=0
Returns event symbol that identifies this event type in subscription.
virtual void setEventSymbol(const Symbol &eventSymbol) noexcept=0
Changes event symbol that identifies this event type in subscription.
virtual const Symbol & getEventSymbol() const &noexcept=0
Returns event symbol that identifies this event type in subscription.
Marks all event types that can be received via dxFeed API.
Definition EventType.hpp:31
std::string toString() const override
Returns a string representation of the current object.
Definition EventType.hpp:89
virtual std::int64_t getEventTime() const noexcept
Returns time when event was created or zero when time is not available.
Definition EventType.hpp:54
virtual void assign(std::shared_ptr< EventType > event)
Replaces the contents of the event.
Definition EventType.hpp:84
virtual void * toGraal() const =0
Allocates memory for the dxFeed Graal SDK structure (recursively if necessary).
virtual void setEventTime(std::int64_t) noexcept
Changes event creation time.
Definition EventType.hpp:66
This marker interface marks subscription symbol classes (like TimeSeriesSubscriptionSymbol) that atta...
Definition FilteredSubscriptionSymbol.hpp:27
The wrapper over CEntryPointErrorsEnum, the error code returned by GraalVM.
Definition GraalException.hpp:22
GraalException(CEntryPointErrorsEnum entryPointErrorsEnum)
Constructs an exception.
Definition GraalException.cpp:10
void handle(ArgTypes... args)
Calls the listeners and pass the args to them.
Definition Handler.hpp:123
std::size_t add(ListenerType &&listener)
Adds the listener to "main" group.
Definition Handler.hpp:157
std::size_t operator%=(ListenerType &&listener)
Adds the low priority listener (to the "low priority" group).
Definition Handler.hpp:209
std::size_t operator+=(ListenerType &&listener)
Adds the listener to "main" group.
Definition Handler.hpp:198
void operator()(ArgTypes... args)
Calls the listeners and pass the ars to them.
Definition Handler.hpp:147
Handler(std::size_t mainFuturesSize=MAIN_FUTURES_DEFAULT_SIZE) noexcept
Creates the new handler by specified size of circular buffer of futures.
Definition Handler.hpp:85
void operator-=(std::size_t id)
Removes a listener by the id.
Definition Handler.hpp:237
std::size_t addLowPriority(ListenerType &&listener)
Adds the low priority listener (to the "low priority" group) It will be called after the "main" liste...
Definition Handler.hpp:178
void remove(std::size_t id)
Removes a listener by the id.
Definition Handler.hpp:218
Thrown to indicate that a method has been passed an illegal or inappropriate argument.
Definition InvalidArgumentException.hpp:21
Helper class to compose and parse symbols for market events.
Definition MarketEventSymbols.hpp:39
static bool hasExchangeCode(const std::string &symbol) noexcept
Returns true is the specified symbol has the exchange code specification.
Definition MarketEventSymbols.hpp:46
static DXFCPP_CXX20_CONSTEXPR_STRING std::string changeBaseSymbol(const std::string &symbol, const std::string &baseSymbol) noexcept
Changes base symbol while leaving exchange code and attributes intact.
Definition MarketEventSymbols.hpp:91
static DXFCPP_CXX20_CONSTEXPR_STRING std::string changeExchangeCode(const std::string &symbol, char exchangeCode) noexcept
Changes exchange code of the specified symbol or removes it if new exchange code is ‘’\0'`.
Definition MarketEventSymbols.hpp:67
static DXFCPP_CXX20_CONSTEXPR_STRING std::string getBaseSymbol(const std::string &symbol) noexcept
Returns base symbol without exchange code and attributes.
Definition MarketEventSymbols.hpp:81
static DXFCPP_CXX20_CONSTEXPR_STRING std::optional< std::string > getAttributeStringByKey(const std::string &symbol, const std::string &key) noexcept
Returns value of the attribute with the specified key.
Definition MarketEventSymbols.hpp:110
static DXFCPP_CXX20_CONSTEXPR_STRING std::string removeAttributeStringByKey(const std::string &symbol, const std::string &key) noexcept
Removes one attribute with the specified key while leaving exchange code and other attributes intact.
Definition MarketEventSymbols.hpp:139
static DXFCPP_CXX20_CONSTEXPR_STRING std::string changeAttributeStringByKey(const std::string &symbol, const std::string &key, const std::string &value) noexcept
Changes value of one attribute value while leaving exchange code and other attributes intact.
Definition MarketEventSymbols.hpp:124
static char getExchangeCode(const std::string &symbol) noexcept
Returns exchange code of the specified symbol or ‘’\0'` if none is defined.
Definition MarketEventSymbols.hpp:56
Provides on-demand historical tick data replay controls.
Definition OnDemandService.hpp:76
A helper class needed to construct smart pointers to objects, and does not allow explicit constructio...
Definition SharedEntity.hpp:89
static auto createShared(Args &&...args)
Creates smart pointer to object.
Definition SharedEntity.hpp:103
A runtime axception with stacktrace.
Definition RuntimeException.hpp:20
RuntimeException(const StringLikeWrapper &message, const StringLikeWrapper &additionalStackTrace="")
Constructs a runtime exception.
Definition RuntimeException.cpp:71
const std::string & getStackTrace() const &
Definition RuntimeException.cpp:85
static const SessionFilter TRADING
Accepts trading sessions only - those with (Session::isTrading() == true).
Definition SessionFilter.hpp:33
static const SessionFilter ANY
Accepts any session - useful for pure schedule navigation.
Definition SessionFilter.hpp:32
static const SessionFilter AFTER_MARKET
Accepts any session with type SessionType::AFTER_MARKET.
Definition SessionFilter.hpp:41
static const SessionFilter REGULAR
Accepts any session with type SessionType::REGULAR.
Definition SessionFilter.hpp:40
SessionFilter(SessionFilterEnum code, std::string name, std::optional< SessionType > type, std::optional< bool > trading) noexcept
Creates filter with specified type and trading flag conditions.
Definition CandleSession.cpp:17
static const SessionFilter NO_TRADING
Accepts any session with type SessionType::NO_TRADING.
Definition SessionFilter.hpp:36
static const SessionFilter NON_TRADING
Accepts non-trading sessions only - those with (Session::isTrading() == false).
Definition SessionFilter.hpp:34
static const SessionFilter PRE_MARKET
Accepts any session with type SessionType::PRE_MARKET.
Definition SessionFilter.hpp:38
bool accept(Session session) const noexcept
Tests whether or not the specified session is an acceptable result.
Definition SessionFilter.hpp:104
std::optional< bool > trading_
Required trading flag, std::nullopt if not relevant.
Definition SessionFilter.hpp:70
std::optional< SessionType > type_
Required type, std::nullopt if not relevant.
Definition SessionFilter.hpp:68
Defines type of session - what kind of trading activity is allowed (if any), what rules are used,...
Definition SessionType.hpp:33
static const SessionType AFTER_MARKET
After-market session type marks extended trading session after regular trading hours.
Definition SessionType.hpp:15
static const SessionType PRE_MARKET
Pre-market session type marks extended trading session before regular trading hours.
Definition SessionType.hpp:13
static const SessionType REGULAR
Regular session type marks regular trading hours session.
Definition SessionType.hpp:14
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:12
bool isTrading() const noexcept
Returns true if trading activity is allowed for this type of session.
Definition SessionType.hpp:70
Base abstract "shared entity" class. Has some helpers for dynamic polymorphism.
Definition SharedEntity.hpp:21
virtual std::string toString() const
Returns a string representation of the current object.
Definition SharedEntity.hpp:78
std::shared_ptr< T > sharedAs() const noexcept
Returns a pointer to the current object wrapped in a smart pointer to type T.
Definition SharedEntity.hpp:69
std::shared_ptr< T > sharedAs() noexcept
Returns a pointer to the current object wrapped in a smart pointer to type T.
Definition SharedEntity.hpp:56
bool is() const noexcept
Checks that pointer to the current type could be converted to type T* In other words: whether type T ...
Definition SharedEntity.hpp:35
std::size_t operator+=(ListenerType &&listener)
Adds the listener to "main" group.
Definition Handler.hpp:378
void remove(std::size_t id)
Removes a listener by the id.
Definition Handler.hpp:398
void handle(ArgTypes... args)
Calls the listeners and pass the args to them.
Definition Handler.hpp:316
void operator()(ArgTypes... args)
Calls the listeners and pass the ars to them.
Definition Handler.hpp:327
SimpleHandler() noexcept=default
Creates the new handler.
std::size_t addLowPriority(ListenerType &&listener)
Adds the low priority listener (to the "low priority" group) It will be called after the "main" liste...
Definition Handler.hpp:358
void operator-=(std::size_t id)
Removes a listener by the id.
Definition Handler.hpp:417
std::size_t operator%=(ListenerType &&listener)
Adds the low priority listener (to the "low priority" group).
Definition Handler.hpp:389
std::size_t add(ListenerType &&listener)
Adds the listener to "main" group.
Definition Handler.hpp:337
Universal functional object that allows searching std::unordered_map for string-like keys.
Definition Common.hpp:911
A simple wrapper around strings or something similar to strings to reduce the amount of code for meth...
Definition Common.hpp:794
StringSymbol(std::string_view stringView) noexcept
Constructs StringSymbol from a std::string_view.
Definition StringSymbol.hpp:53
StringSymbol(const char *chars) noexcept
Constructs StringSymbol from a char array.
Definition StringSymbol.hpp:40
static void freeGraal(void *graalNative)
Releases the memory occupied by the dxFeed Graal SDK structure (recursively if necessary).
Definition StringSymbol.cpp:54
std::string toString() const
Returns a string representation of the current object.
Definition StringSymbol.hpp:100
static StringSymbol fromGraal(void *graalNative)
Creates an object of the current type and fills it with data from the the dxFeed Graal SDK structure.
Definition StringSymbol.cpp:69
void * toGraal() const
Allocates memory for the dxFeed Graal SDK structure (recursively if necessary).
Definition StringSymbol.cpp:44
std::optional< CandleSymbol > asCandleSymbol() const noexcept
Definition SymbolWrapper.hpp:382
SymbolWrapper(Symbol &&symbol) noexcept
Constructor for any wrapped symbol.
Definition SymbolWrapper.hpp:158
bool isIndexedEventSubscriptionSymbol() const noexcept
Definition SymbolWrapper.hpp:340
std::string toString() const
Returns a string representation of the current object.
Definition SymbolWrapper.hpp:286
static SymbolWrapper fromGraal(void *graalNative)
Creates an object of the current type and fills it with data from the the dxFeed Graal SDK structure.
Definition SymbolWrapper.cpp:79
std::string toStringUnderlying() const
Returns a string representation of the underlying object.
Definition SymbolWrapper.hpp:301
std::unique_ptr< void, decltype(&SymbolWrapper::freeGraal)> toGraalUnique() const noexcept
Allocates memory for the dxFeed Graal SDK structure (recursively if necessary).
Definition SymbolWrapper.hpp:277
bool isStringSymbol() const noexcept
Definition SymbolWrapper.hpp:312
std::optional< IndexedEventSubscriptionSymbol > asIndexedEventSubscriptionSymbol() const noexcept
Definition SymbolWrapper.hpp:348
bool isWildcardSymbol() const noexcept
Definition SymbolWrapper.hpp:326
void * toGraal() const noexcept
Allocates memory for the dxFeed Graal SDK structure (recursively if necessary).
Definition SymbolWrapper.hpp:258
SymbolWrapper(const IndexedEventSubscriptionSymbol &indexedEventSubscriptionSymbol) noexcept
Constructor for IndexedEventSubscriptionSymbol.
Definition SymbolWrapper.hpp:197
const DataType & getData() const noexcept
Definition SymbolWrapper.hpp:389
std::string asStringSymbol() const noexcept
Definition SymbolWrapper.hpp:319
SymbolWrapper(const StringSymbol &stringSymbol) noexcept
Constructor for any wrapped string symbol.
Definition SymbolWrapper.hpp:171
std::optional< WildcardSymbol > asWildcardSymbol() const noexcept
Definition SymbolWrapper.hpp:333
SymbolWrapper(const CandleSymbol &candleSymbol) noexcept
Constructor for CandleSymbol.
Definition SymbolWrapper.hpp:225
SymbolWrapper(const WildcardSymbol &wildcardSymbol) noexcept
Constructor for any wrapped wildcard (*) symbol.
Definition SymbolWrapper.hpp:184
bool isTimeSeriesSubscriptionSymbol() const noexcept
Definition SymbolWrapper.hpp:357
SymbolWrapper(const TimeSeriesSubscriptionSymbol &timeSeriesSubscriptionSymbol) noexcept
Constructor for TimeSeriesSubscriptionSymbol.
Definition SymbolWrapper.hpp:211
bool isCandleSymbol() const noexcept
Definition SymbolWrapper.hpp:374
std::optional< TimeSeriesSubscriptionSymbol > asTimeSeriesSubscriptionSymbol() const noexcept
Definition SymbolWrapper.hpp:365
static void freeGraal(void *graalNative)
Releases the memory occupied by the dxFeed Graal SDK structure (recursively if necessary).
Definition SymbolWrapper.cpp:42
Utility class for parsing and formatting dates and times in ISO-compatible format.
Definition TimeFormat.hpp:29
std::string format(std::int64_t timestamp) const
Converts timestamp into string according to the format.
Definition TimeFormat.cpp:55
static const TimeFormat GMT
An instance of TimeFormat that corresponds to GMT timezone as returned by TimeZone::getTimeZone("GMT"...
Definition TimeFormat.hpp:41
std::int64_t parse(const StringLikeWrapper &value) const
Reads Date from String and returns timestamp.
Definition TimeFormat.cpp:49
static const TimeFormat DEFAULT
An instance of TimeFormat that corresponds to default timezone as returned by TimeZone::getDefault() ...
Definition TimeFormat.hpp:33
Value class for period of time with support for ISO8601 duration format.
Definition TimePeriod.hpp:19
static TimePeriod valueOf(std::chrono::milliseconds value)
Returns TimePeriod with value milliseconds.
Definition TimePeriod.hpp:42
static TimePeriod valueOf(const StringLikeWrapper &value)
Returns TimePeriod represented with a given string.
Definition TimePeriod.cpp:31
std::int64_t getNanos() const
Returns value in nanoseconds.
Definition TimePeriod.cpp:47
static const TimePeriod ZERO
Time-period of zero.
Definition TimePeriod.hpp:23
std::int32_t getSeconds() const
Returns value in seconds.
Definition TimePeriod.cpp:41
std::int64_t getTime() const
Returns value in milliseconds.
Definition TimePeriod.cpp:35
static const TimePeriod UNLIMITED
Time-period of "infinity" (time of std::numeric_limits<std::int64_t>::max() or LLONG_MAX).
Definition TimePeriod.hpp:26
static TimePeriod valueOf(std::int64_t value)
Returns TimePeriod with value milliseconds.
Definition TimePeriod.cpp:27
static void freeGraal(void *graalNative)
Releases the memory occupied by the dxFeed Graal SDK structure (recursively if necessary).
Definition WildcardSymbol.cpp:25
static const WildcardSymbol & fromGraal(void *graalNative)
Creates an object of the current type and fills it with data from the the dxFeed Graal SDK structure.
Definition WildcardSymbol.cpp:31
void * toGraal() const noexcept
Allocates memory for the dxFeed Graal SDK structure (recursively if necessary).
Definition WildcardSymbol.cpp:15
static const WildcardSymbol ALL
Represents [wildcard] subscription to all events of the specific event type.
Definition WildcardSymbol.hpp:13
std::string toString() const
Returns string representation of this wildcard subscription symbol.
Definition WildcardSymbol.hpp:94
static const std::string RESERVED_PREFIX
Symbol prefix that is reserved for wildcard subscriptions.
Definition WildcardSymbol.hpp:28
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