diff --git a/include/dxfeed_graal_cpp_api/api/ApiModule.hpp b/include/dxfeed_graal_cpp_api/api/ApiModule.hpp index 17b2c934..259abc2b 100644 --- a/include/dxfeed_graal_cpp_api/api/ApiModule.hpp +++ b/include/dxfeed_graal_cpp_api/api/ApiModule.hpp @@ -5,9 +5,9 @@ #include "../internal/Conf.hpp" -#include "osub/OsubModule.hpp" #include "DXEndpoint.hpp" #include "DXFeed.hpp" #include "DXFeedSubscription.hpp" #include "DXPublisher.hpp" -#include "FilteredSubscriptionSymbol.hpp" \ No newline at end of file +#include "FilteredSubscriptionSymbol.hpp" +#include "osub/OsubModule.hpp" \ No newline at end of file diff --git a/include/dxfeed_graal_cpp_api/api/DXEndpoint.hpp b/include/dxfeed_graal_cpp_api/api/DXEndpoint.hpp index db91f35f..d39e896b 100644 --- a/include/dxfeed_graal_cpp_api/api/DXEndpoint.hpp +++ b/include/dxfeed_graal_cpp_api/api/DXEndpoint.hpp @@ -32,8 +32,8 @@ struct DXFeed; * that are available with DXEndpoint::getInstance() and DXEndpoint::getInstance(Role) methods as well as * factory methods DXEndpoint::create() and DXEndpoint::create(Role), and a number of configuration methods. Advanced * properties can be configured using - * @ref DXEndpoint::newBuilder() "newBuilder()".@ref DXEndpoint::Builder::withProperty(const std::string&, const std::string&) - * "withProperty(key, value)".@ref DXEndpoint::Builder::build() "build()". + * @ref DXEndpoint::newBuilder() "newBuilder()".@ref DXEndpoint::Builder::withProperty(const std::string&, const + * std::string&) "withProperty(key, value)".@ref DXEndpoint::Builder::build() "build()". * * See DXFeed for details on how to subscribe to symbols and receive events. * @@ -48,10 +48,9 @@ struct DXFeed; * * - @ref Role::FEED "FEED" connects to the remote data feed provider and is optimized for real-time or * delayed data processing (this is a default role). - * DXEndpoint::getFeed() method returns a feed object that subscribes to this remote data feed provider and receives events - * from it. When event processing threads cannot keep up (don't have enough CPU time), data is dynamically conflated - * to minimize latency between received events and their processing time. - * For example: + * DXEndpoint::getFeed() method returns a feed object that subscribes to this remote data feed provider and receives + * events from it. When event processing threads cannot keep up (don't have enough CPU time), data is dynamically + * conflated to minimize latency between received events and their processing time. For example: * - `DXEndpoint::create()->connect("demo.dxfeed.com:7300")->getFeed()` returns a demo feed from dxFeed with * sample market quotes. * - `DXEndpoint::create()->connect("localhost:7400")->getFeed()` returns a feed that is connected to a @@ -62,13 +61,13 @@ struct DXFeed; * This endpoint is automatically connected to the configured data feed as explained in default properties section. * - @ref Role::ON_DEMAND_FEED "ON_DEMAND_FEED" is similar to @ref Role::FEED "FEED", but it is designed to be used with * OnDemandService for historical data replay only. It is configured with default properties, but is not connected - * automatically to the data provider until @ref OnDemandService::replay(Date, double) "OnDemandService->replay" method is invoked. + * automatically to the data provider until @ref OnDemandService::replay(Date, double) "OnDemandService->replay" + * method is invoked. * - @ref Role::STREAM_FEED "STREAM_FEED" is similar to @ref Role::FEED "FEED" and also connects to the remote data * feed provider, but is designed for bulk parsing of data from files. DXEndpoint::getFeed() method returns feed * object that subscribes to the data from the opened files and receives events from them. Events from the files are - * not conflated and are processed as fast as possible. Note, that in this role, DXFeed::getLastEvent() method does not - * work and time-series subscription is not supported. - * For example: + * not conflated and are processed as fast as possible. Note, that in this role, DXFeed::getLastEvent() method does + * not work and time-series subscription is not supported. For example: * ```cpp * auto endpoint = DXEndpoint::create(DXEndpoint::Role::STREAM_FEED); * auto feed = endpoint->getFeed(); @@ -80,15 +79,15 @@ struct DXFeed; * "[speed=max]" clause forces to the file reader to play back all the data from "demo-sample.data" file as fast as * data subscribers are processing it. * - @ref Role::PUBLISHER "PUBLISHER" connects to the remote publisher hub (also known as multiplexor) or creates a - * publisher on the local host. DXEndpoint::getPublisher() method returns a publisher object that publishes events to all - * connected feeds. - * For example: `DXEndpoint->create(DXEndpoint::Role::PUBLISHER)->connect(":7400")->getPublisher()` - * returns a publisher that is waiting for connections on TCP/IP port 7400. The published events will be delivered to - * all feeds that are connected to this publisher. - * This endpoint is automatically connected to the configured data feed as explained in default properties section. + * publisher on the local host. DXEndpoint::getPublisher() method returns a publisher object that publishes events to + * all connected feeds. For example: + * `DXEndpoint->create(DXEndpoint::Role::PUBLISHER)->connect(":7400")->getPublisher()` returns a publisher that + * is waiting for connections on TCP/IP port 7400. The published events will be delivered to all feeds that are + * connected to this publisher. This endpoint is automatically connected to the configured data feed as explained in + * default properties section. * - @ref Role::LOCAL_HUB "LOCAL_HUB" creates a local hub without ability to establish network connections. - * Events that are published via @ref DXEndpoint::getPublisher() "publisher" are delivered to local @ref DXEndpoint::getFeed() "feed" - * only. + * Events that are published via @ref DXEndpoint::getPublisher() "publisher" are delivered to local @ref + * DXEndpoint::getFeed() "feed" only. * *

Endpoint state

* @@ -110,17 +109,17 @@ struct DXFeed; * Connection to the remote endpoint can be terminated with DXEndpoint::disconnect() method. * The endpoint state becomes @ref State::NOT_CONNECTED "NOT_CONNECTED". * - * Endpoint can be closed with DXEndpoint::close() method. The endpoint state becomes @ref State::CLOSED "CLOSED". This is a - * final state. All connection are terminated and all internal resources that are held by this endpoint are freed. + * Endpoint can be closed with DXEndpoint::close() method. The endpoint state becomes @ref State::CLOSED "CLOSED". This + * is a final state. All connection are terminated and all internal resources that are held by this endpoint are freed. * No further connections can be initiated. * *

Event times

* * The EventType::getEventTime() on received events is available only when the endpoint is created with - * DXEndpoint::DXENDPOINT_EVENT_TIME_PROPERTY property and the data source has embedded event times. This is typically true only - * for data events that are read from historical tape files (see above) and from OnDemandService. - * Events that are coming from a network connections do not have an embedded event time information and - * event time is not available for them anyway. + * DXEndpoint::DXENDPOINT_EVENT_TIME_PROPERTY property and the data source has embedded event times. This is typically + * true only for data events that are read from historical tape files (see above) and from OnDemandService. Events that + * are coming from a network connections do not have an embedded event time information and event time is not available + * for them anyway. * *

Default properties

* @@ -205,8 +204,8 @@ struct DXFCPP_EXPORT DXEndpoint : SharedEntity { * role @ref Role::ON_DEMAND_FEED "ON_DEMAND_FEED" waits until OnDemandService::replay(Date, double) is invoked * before connecting. * - * By default, without this property, connection is not established until @ref DXEndpoint::connect(const std::string&) - * "connect(address)" is invoked. + * By default, without this property, connection is not established until @ref DXEndpoint::connect(const + * std::string&) "connect(address)" is invoked. * * Credentials for access to premium services may be configured with * DXEndpoint::DXFEED_USER_PROPERTY and DXEndpoint::DXFEED_PASSWORD_PROPERTY. @@ -374,11 +373,10 @@ struct DXFCPP_EXPORT DXEndpoint : SharedEntity { FEED, /** - * `ON_DEMAND_FEED` endpoint is similar to DXEndpoint::FEED, but it is designed to be used with OnDemandService for - * historical data replay only. It is configured with - * default properties, but is not connected automatically - * to the data provider until @ref OnDemandService::replay(Date, double) "OnDemandService.replay" - * method is invoked. + * `ON_DEMAND_FEED` endpoint is similar to DXEndpoint::FEED, but it is designed to be used with OnDemandService + * for historical data replay only. It is configured with default + * properties, but is not connected automatically to the data provider until @ref + * OnDemandService::replay(Date, double) "OnDemandService.replay" method is invoked. * * `ON_DEMAND_FEED` endpoint cannot be connected to an ordinary data feed at all. * OnDemandService::stopAndResume() will have a similar effect to OnDemandService::stopAndClear(). @@ -550,8 +548,8 @@ struct DXFCPP_EXPORT DXEndpoint : SharedEntity { * You can provide configuration via system properties as explained there. * * The configuration does not have to include an address. You can use @ref DXEndpoint::connect(const std::string&) - * "connect(address)" and DXEndpoint::disconnect() methods on the instance that is returned by this method to programmatically - * establish and tear-down connection to a user-provided address. + * "connect(address)" and DXEndpoint::disconnect() methods on the instance that is returned by this method to + * programmatically establish and tear-down connection to a user-provided address. * * If you need a fully programmatic configuration and/or multiple endpoints of the same role in your * application, then create a custom instance of DXEndpoint with DXEndpoint::newBuilder() method, configure it, @@ -593,8 +591,8 @@ struct DXFCPP_EXPORT DXEndpoint : SharedEntity { /** * Creates an endpoint with a specified role. * This is a shortcut to - * @ref DXEndpoint::newBuilder() "newBuilder()"->@ref Builder::withRole(Role) "withRole(role)"->@ref Builder::build() - * "build()" + * @ref DXEndpoint::newBuilder() "newBuilder()"->@ref Builder::withRole(Role) "withRole(role)"->@ref + * Builder::build() "build()" * * @param role the role. * @return the created endpoint. @@ -710,7 +708,8 @@ struct DXFCPP_EXPORT DXEndpoint : SharedEntity { * Connects to the specified remote address. Previously established connections are closed if * the new address is different from the old one. * This method does nothing if address does not change or if this endpoint is @ref State::CLOSED "CLOSED". - * The endpoint @ref DXEndpoint::getState() "state" immediately becomes @ref State::CONNECTING "CONNECTING" otherwise. + * The endpoint @ref DXEndpoint::getState() "state" immediately becomes @ref State::CONNECTING "CONNECTING" + * otherwise. * *

The address string is provided with the market data vendor agreement. * Use "demo.dxfeed.com:7300" for a demo quote feed. diff --git a/include/dxfeed_graal_cpp_api/api/DXFeed.hpp b/include/dxfeed_graal_cpp_api/api/DXFeed.hpp index 8b890f42..72474792 100644 --- a/include/dxfeed_graal_cpp_api/api/DXFeed.hpp +++ b/include/dxfeed_graal_cpp_api/api/DXFeed.hpp @@ -51,27 +51,31 @@ class EventTypeEnum; * The following code creates listener that prints mid price for each quote * and subscribes for quotes on SPDR S&P 500 ETF symbol: *


- * auto sub = @ref DXFeed "DXFeed"::@ref DXFeed::getInstance() "getInstance"()->@ref DXFeed::createSubscription() "createSubscription"(Quote::TYPE);
+ * auto sub = @ref DXFeed "DXFeed"::@ref DXFeed::getInstance() "getInstance"()->@ref DXFeed::createSubscription()
+ * "createSubscription"(Quote::TYPE);
  *
  * sub->@ref DXFeedSubscription::addEventListener() "addEventListener"([](const auto& quotes) {
  *     for (const auto& quote : quotes) {
- *         std::cout << "Mid = " + (quote->@ref Quote::getBidPrice() "getBidPrice"() + quote->@ref Quote::getAskPrice() "getAskPrice"()) / 2) << std::endl;
+ *         std::cout << "Mid = " + (quote->@ref Quote::getBidPrice() "getBidPrice"() + quote->@ref Quote::getAskPrice()
+ * "getAskPrice"()) / 2) << std::endl;
  *     }
  * });
  *
  * sub->@ref DXFeedSubscription::addSymbols() "addSymbols"("SPY");
* * Note, that order of calls is important here. By attaching listeners first and then setting - * subscription we ensure that the current quote gets received by the listener. See DXFeedSubscription::addSymbols() for details. - * If a set of symbols is changed first, then @ref DXFeedSubscription::addEventListener() "sub->addEventListener" - * raises an IllegalStateException in JVM to protected from hard-to-catch bugs with potentially missed events. + * subscription we ensure that the current quote gets received by the listener. See DXFeedSubscription::addSymbols() for + * details. If a set of symbols is changed first, then @ref DXFeedSubscription::addEventListener() + * "sub->addEventListener" raises an IllegalStateException in JVM to protected from hard-to-catch bugs with potentially + * missed events. * *

Subscribe for multiple event types

* * The following code creates listener that prints each received event and * subscribes for quotes and trades on SPDR S&P 500 ETF symbol: *

- * auto sub = @ref DXFeed "DXFeed"::@ref DXFeed::getInstance() "getInstance"()->@ref DXFeed::createSubscription() "createSubscription"({Quote::TYPE, Trade::TYPE});
+ * auto sub = @ref DXFeed "DXFeed"::@ref DXFeed::getInstance() "getInstance"()->@ref DXFeed::createSubscription()
+ * "createSubscription"({Quote::TYPE, Trade::TYPE});
  *
  * sub->@ref DXFeedSubscription::addEventListener() "addEventListener"([](auto&& events) {
  *     for (const auto& event : events) {
@@ -89,7 +93,8 @@ class EventTypeEnum;
  * 

  * using namespace std::chrono_literals;
  *
- * auto sub = @ref DXFeed "DXFeed"::@ref DXFeed::getInstance() "getInstance"()->@ref DXFeed::createSubscription() "createSubscription"({Trade::TYPE});
+ * auto sub = @ref DXFeed "DXFeed"::@ref DXFeed::getInstance() "getInstance"()->@ref DXFeed::createSubscription()
+ * "createSubscription"({Trade::TYPE});
  *
  * sub->@ref DXFeedSubscription::addSymbols() "addSymbols"("SPY");
  *
@@ -271,8 +276,7 @@ struct DXFCPP_EXPORT DXFeed : SharedEntity {
      * @return The new subscription
      */
     template 
-    std::shared_ptr createSubscription(EventTypesCollection &&eventTypes) noexcept
-    {
+    std::shared_ptr createSubscription(EventTypesCollection &&eventTypes) noexcept {
         if constexpr (Debugger::isDebug) {
             Debugger::debug(toString() + "::createSubscription(eventTypes = " +
                             namesToString(std::begin(eventTypes), std::end(eventTypes)) + ")");
diff --git a/include/dxfeed_graal_cpp_api/api/DXFeedSubscription.hpp b/include/dxfeed_graal_cpp_api/api/DXFeedSubscription.hpp
index d852910c..54943962 100644
--- a/include/dxfeed_graal_cpp_api/api/DXFeedSubscription.hpp
+++ b/include/dxfeed_graal_cpp_api/api/DXFeedSubscription.hpp
@@ -266,8 +266,8 @@ class DXFCPP_EXPORT DXFeedSubscription : public SharedEntity {
      * Adds listener for events.
      * Event lister can be added only when subscription is not producing any events.
      * The subscription must be either empty
-     * (its set of @ref DXFeedSubscription::getSymbols() "symbols" is empty or not @ref DXFeedSubscription::attach() "attached" to any feed
-     * (its set of change listeners is empty).
+     * (its set of @ref DXFeedSubscription::getSymbols() "symbols" is empty or not @ref DXFeedSubscription::attach()
+     * "attached" to any feed (its set of change listeners is empty).
      *
      * This method does nothing if this subscription is closed.
      *
@@ -308,8 +308,8 @@ class DXFCPP_EXPORT DXFeedSubscription : public SharedEntity {
      * Adds typed listener for events.
      * Event lister can be added only when subscription is not producing any events.
      * The subscription must be either empty
-     * (its set of @ref DXFeedSubscription::getSymbols() "symbols" is empty or not @ref DXFeedSubscription::attach() "attached" to any feed
-     * (its set of change listeners is empty).
+     * (its set of @ref DXFeedSubscription::getSymbols() "symbols" is empty or not @ref DXFeedSubscription::attach()
+     * "attached" to any feed (its set of change listeners is empty).
      *
      * This method does nothing if this subscription is closed.
      *
@@ -412,8 +412,8 @@ class DXFCPP_EXPORT DXFeedSubscription : public SharedEntity {
      * Adds the specified symbol to the set of subscribed symbols.
      * This is a convenience method to subscribe to one symbol at a time that has a return fast-path for a case when
      * the symbol is already in the set.
-     * When subscribing to multiple symbols at once it is preferable to use @ref DXFeedSubscription::addSymbols(const SymbolsCollection
-     * &collection) "addSymbols(symbols)" method.
+     * When subscribing to multiple symbols at once it is preferable to use @ref DXFeedSubscription::addSymbols(const
+     * SymbolsCollection &collection) "addSymbols(symbols)" method.
      *
      * Example:
      * ```cpp
@@ -436,8 +436,8 @@ class DXFCPP_EXPORT DXFeedSubscription : public SharedEntity {
 
     /**
      * Removes the specified symbol from the set of subscribed symbols.
-     * To conveniently remove one or few symbols you can use @ref DXFeedSubscription::removeSymbols(const SymbolsCollection &collection)
-     * "removeSymbols(symbols)" method.
+     * To conveniently remove one or few symbols you can use @ref DXFeedSubscription::removeSymbols(const
+     * SymbolsCollection &collection) "removeSymbols(symbols)" method.
      *
      * Example:
      * ```cpp
diff --git a/include/dxfeed_graal_cpp_api/api/DXPublisher.hpp b/include/dxfeed_graal_cpp_api/api/DXPublisher.hpp
index 24e7676f..3a283e5d 100644
--- a/include/dxfeed_graal_cpp_api/api/DXPublisher.hpp
+++ b/include/dxfeed_graal_cpp_api/api/DXPublisher.hpp
@@ -50,7 +50,8 @@ class ObservableSubscription;
  * auto @ref Quote "quote" = std::make_shared<@ref Quote "Quote">("A:TEST");
  * quote->@ref Quote::setBidPrice "setBidPrice"(100);
  * quote->@ref Quote::setAskPrice "setAskPrice"(101);
- * @ref DXPublisher "DXPublisher"::@ref DXPublisher::getInstance() "getInstance"()->@ref DXPublisher::publishEvents() "publishEvents"(quote);
+ * @ref DXPublisher "DXPublisher"::@ref DXPublisher::getInstance() "getInstance"()->@ref DXPublisher::publishEvents() + * "publishEvents"(quote);
* *

Threads and locks

* @@ -87,7 +88,6 @@ struct DXFCPP_EXPORT DXPublisher : SharedEntity { */ static std::shared_ptr getInstance() noexcept; - /** * Publishes events to the corresponding feed. If the @ref DXEndpoint "endpoint" of this publisher has * @ref DXEndpoint::getRole() "role" of DXEndpoint::Role::PUBLISHER and it is connected, the @@ -170,8 +170,7 @@ struct DXFCPP_EXPORT DXPublisher : SharedEntity { #endif { this->template publishEvents(events)))>( - std::begin(std::forward(events)), - std::end(std::forward(events))); + std::begin(std::forward(events)), std::end(std::forward(events))); } /** @@ -210,7 +209,7 @@ struct DXFCPP_EXPORT DXPublisher : SharedEntity { EventMapper::freeGraalList(list); } - std::shared_ptr getSubscription(const EventTypeEnum&); + std::shared_ptr getSubscription(const EventTypeEnum &); std::string toString() const noexcept override; }; diff --git a/include/dxfeed_graal_cpp_api/api/osub/IndexedEventSubscriptionSymbol.hpp b/include/dxfeed_graal_cpp_api/api/osub/IndexedEventSubscriptionSymbol.hpp index e328abdb..641d8f79 100644 --- a/include/dxfeed_graal_cpp_api/api/osub/IndexedEventSubscriptionSymbol.hpp +++ b/include/dxfeed_graal_cpp_api/api/osub/IndexedEventSubscriptionSymbol.hpp @@ -58,7 +58,8 @@ class DXFCPP_EXPORT IndexedEventSubscriptionSymbol { static void freeGraal(void *graalNative) noexcept; /** - * Creates an object of the current type and fills it with data from the the dxFeed Graal SDK structure (recursively if necessary). + * Creates an object of the current type and fills it with data from the the dxFeed Graal SDK structure (recursively + * if necessary). * * @param graalNative The pointer to the dxFeed Graal SDK structure. * @return The object of current type. diff --git a/include/dxfeed_graal_cpp_api/api/osub/ObservableSubscription.hpp b/include/dxfeed_graal_cpp_api/api/osub/ObservableSubscription.hpp index 6d530c42..1df26004 100644 --- a/include/dxfeed_graal_cpp_api/api/osub/ObservableSubscription.hpp +++ b/include/dxfeed_graal_cpp_api/api/osub/ObservableSubscription.hpp @@ -16,4 +16,4 @@ namespace dxfcpp { class ObservableSubscription {}; -} \ No newline at end of file +} // namespace dxfcpp \ No newline at end of file diff --git a/include/dxfeed_graal_cpp_api/api/osub/TimeSeriesSubscriptionSymbol.hpp b/include/dxfeed_graal_cpp_api/api/osub/TimeSeriesSubscriptionSymbol.hpp index 63ef17e2..6e03efd4 100644 --- a/include/dxfeed_graal_cpp_api/api/osub/TimeSeriesSubscriptionSymbol.hpp +++ b/include/dxfeed_graal_cpp_api/api/osub/TimeSeriesSubscriptionSymbol.hpp @@ -34,9 +34,9 @@ class IndexedEventSubscriptionSymbol; *

Equality and hash codes

* * This is a FilteredSubscriptionSymbol. - * Time-series subscription symbols are compared based on their @ref TimeSeriesSubscriptionSymbol::getEventSymbol() "eventSymbol" only. - * It means, that a set of time-series subscription symbols can contain at most one time-series subscription - * for each event symbol. + * Time-series subscription symbols are compared based on their @ref TimeSeriesSubscriptionSymbol::getEventSymbol() + * "eventSymbol" only. It means, that a set of time-series subscription symbols can contain at most one time-series + * subscription for each event symbol. */ class DXFCPP_EXPORT TimeSeriesSubscriptionSymbol final : public IndexedEventSubscriptionSymbol, public FilteredSubscriptionSymbol { diff --git a/include/dxfeed_graal_cpp_api/api/osub/WildcardSymbol.hpp b/include/dxfeed_graal_cpp_api/api/osub/WildcardSymbol.hpp index a7477e13..4b3f76ee 100644 --- a/include/dxfeed_graal_cpp_api/api/osub/WildcardSymbol.hpp +++ b/include/dxfeed_graal_cpp_api/api/osub/WildcardSymbol.hpp @@ -15,8 +15,8 @@ namespace dxfcpp { /** * Represents [wildcard] subscription to all events of the specific event type. * The @ref WildcardSymbol::ALL constant can be added to any DXFeedSubscription instance with - * @ref DXFeedSubscription::addSymbols() "addSymbols" method to the effect of subscribing to all possible event symbols. The - * corresponding subscription will start receiving all published events of the corresponding types. + * @ref DXFeedSubscription::addSymbols() "addSymbols" method to the effect of subscribing to all possible event symbols. + * The corresponding subscription will start receiving all published events of the corresponding types. */ struct DXFCPP_EXPORT WildcardSymbol final { /** diff --git a/include/dxfeed_graal_cpp_api/entity/SharedEntity.hpp b/include/dxfeed_graal_cpp_api/entity/SharedEntity.hpp index 511862d5..226efd40 100644 --- a/include/dxfeed_graal_cpp_api/entity/SharedEntity.hpp +++ b/include/dxfeed_graal_cpp_api/entity/SharedEntity.hpp @@ -36,7 +36,8 @@ struct DXFCPP_EXPORT SharedEntity : public Entity, std::enable_shared_from_this< /** * Returns a pointer to the current object wrapped in a smart pointer to type T * - * @warning Please do not use this method unless the object was created with `std::shared_ptr(new T(...))` or `std::make_shared(...)` + * @warning Please do not use this method unless the object was created with `std::shared_ptr(new T(...))` or + * `std::make_shared(...)` * * @tparam T The type to convert to a pointer to * @return a smart pointer to type T @@ -48,7 +49,8 @@ struct DXFCPP_EXPORT SharedEntity : public Entity, std::enable_shared_from_this< /** * Returns a pointer to the current object wrapped in a smart pointer to type T * - * @warning Please do not use this method unless the object was created with `std::shared_ptr(new T(...))` or `std::make_shared(...)` + * @warning Please do not use this method unless the object was created with `std::shared_ptr(new T(...))` or + * `std::make_shared(...)` * * @tparam T The type to convert to a pointer to * @return a smart pointer to type T diff --git a/include/dxfeed_graal_cpp_api/event/EventMapper.hpp b/include/dxfeed_graal_cpp_api/event/EventMapper.hpp index 66df5cb3..8c964257 100644 --- a/include/dxfeed_graal_cpp_api/event/EventMapper.hpp +++ b/include/dxfeed_graal_cpp_api/event/EventMapper.hpp @@ -35,9 +35,9 @@ struct DXFCPP_EXPORT EventMapper { bool needToFree = false; for (auto it = begin; it != end && elementIdx < size; it++, elementIdx++) { - if constexpr (requires { it->toGraal(); }) { //It + if constexpr (requires { it->toGraal(); }) { // It needToFree = setGraalListElement(list, elementIdx, it->toGraal()) == false; - } else if constexpr (requires { (*it)->toGraal(); }) { //It> + } else if constexpr (requires { (*it)->toGraal(); }) { // It> needToFree = setGraalListElement(list, elementIdx, (*it)->toGraal()) == false; } diff --git a/include/dxfeed_graal_cpp_api/event/EventModule.hpp b/include/dxfeed_graal_cpp_api/event/EventModule.hpp index e0e29bef..6867f74f 100644 --- a/include/dxfeed_graal_cpp_api/event/EventModule.hpp +++ b/include/dxfeed_graal_cpp_api/event/EventModule.hpp @@ -5,10 +5,6 @@ #include "../internal/Conf.hpp" -#include "candle/CandleModule.hpp" -#include "market/MarketModule.hpp" -#include "misc/MiscModule.hpp" -#include "option/OptionModule.hpp" #include "EventFlag.hpp" #include "EventMapper.hpp" #include "EventType.hpp" @@ -16,4 +12,8 @@ #include "IndexedEvent.hpp" #include "IndexedEventSource.hpp" #include "LastingEvent.hpp" -#include "TimeSeriesEvent.hpp" \ No newline at end of file +#include "TimeSeriesEvent.hpp" +#include "candle/CandleModule.hpp" +#include "market/MarketModule.hpp" +#include "misc/MiscModule.hpp" +#include "option/OptionModule.hpp" \ No newline at end of file diff --git a/include/dxfeed_graal_cpp_api/event/EventType.hpp b/include/dxfeed_graal_cpp_api/event/EventType.hpp index d48ca9cd..347c1174 100644 --- a/include/dxfeed_graal_cpp_api/event/EventType.hpp +++ b/include/dxfeed_graal_cpp_api/event/EventType.hpp @@ -68,7 +68,7 @@ struct DXFCPP_EXPORT EventType : public SharedEntity { * * @return The pointer to the filled dxFeed Graal SDK structure */ - virtual void* toGraal() const noexcept = 0; + virtual void *toGraal() const noexcept = 0; /// std::string toString() const noexcept override { diff --git a/include/dxfeed_graal_cpp_api/event/TimeSeriesEvent.hpp b/include/dxfeed_graal_cpp_api/event/TimeSeriesEvent.hpp index e46f0cf2..e380dba7 100644 --- a/include/dxfeed_graal_cpp_api/event/TimeSeriesEvent.hpp +++ b/include/dxfeed_graal_cpp_api/event/TimeSeriesEvent.hpp @@ -54,15 +54,18 @@ namespace dxfcpp { * When publishing time-series event with DXPublisher::publishEvents() method on incoming TimeSeriesSubscriptionSymbol * the snapshot of currently known events for the requested time range has to be published first. * - * A snapshot is published in the descending order of @ref TimeSeriesEvent::getIndex() "index" (which is the same as the - * descending order of @ref TimeSeriesEvent::getTime() "time"), starting with an event with the largest index and marking it - * with TimeSeriesEvent::SNAPSHOT_BEGIN bit in @ref TimeSeriesEvent::getEventFlags "eventFlags". All other event follow with default, zero - * @ref TimeSeriesEvent::getEventFlags() "eventFlags". If there is no actual event at the time that was specified in subscription + * A snapshot is published in the descending order of @ref TimeSeriesEvent::getIndex() "index" (which is the + * same as the descending order of @ref TimeSeriesEvent::getTime() "time"), starting with an event with the largest + * index and marking it with TimeSeriesEvent::SNAPSHOT_BEGIN bit in @ref TimeSeriesEvent::getEventFlags "eventFlags". + * All other event follow with default, zero + * @ref TimeSeriesEvent::getEventFlags() "eventFlags". If there is no actual event at the time that was specified in + * subscription * @ref TimeSeriesSubscriptionSymbol::getFromTime() "fromTime" property, then event with the corresponding time * has to be created anyway and published. To distinguish it from the actual event, it has to be marked with - * TimeSeriesEvent::REMOVE_EVENT bit in @ref TimeSeriesEvent::getEventFlags() "eventFlags". TimeSeriesEvent::SNAPSHOT_END bit in this event's - * @ref TimeSeriesEvent::getEventFlags() "eventFlags" s optional during publishing. It will be properly set on receiving end anyway. - * Note, that publishing any event with time that is below subscription + * TimeSeriesEvent::REMOVE_EVENT bit in @ref TimeSeriesEvent::getEventFlags() "eventFlags". + * TimeSeriesEvent::SNAPSHOT_END bit in this event's + * @ref TimeSeriesEvent::getEventFlags() "eventFlags" s optional during publishing. It will be properly set on receiving + * end anyway. Note, that publishing any event with time that is below subscription * @ref TimeSeriesSubscriptionSymbol::getFromTime() "fromTime" also works as a legal indicator for the end of the * snapshot. * diff --git a/include/dxfeed_graal_cpp_api/event/candle/Candle.hpp b/include/dxfeed_graal_cpp_api/event/candle/Candle.hpp index e1711d7e..877d4310 100644 --- a/include/dxfeed_graal_cpp_api/event/candle/Candle.hpp +++ b/include/dxfeed_graal_cpp_api/event/candle/Candle.hpp @@ -39,8 +39,8 @@ struct EventMapper; * Some candle sources provide a consistent view of the set of known candles. * The corresponding information is carried in @ref Candle::getEventFlags() "eventFlags" property. * The logic behind this property is detailed in IndexedEvent class documentation. - * Multiple event sources for the same symbol are not supported for candles, thus @ref Candle::getSource() "source" property - * is always @ref IndexedEventSource::DEFAULT "DEFAULT". + * Multiple event sources for the same symbol are not supported for candles, thus @ref Candle::getSource() "source" + * property is always @ref IndexedEventSource::DEFAULT "DEFAULT". * *

TimeSeriesEventModel class handles all the snapshot and transaction logic and conveniently represents a list * current of time-series events order by their @ref Candle::getTime() "time". @@ -103,7 +103,6 @@ class DXFCPP_EXPORT Candle final : public EventTypeWithSymbol, static void freeGraalData(void *graalNative) noexcept; public: - static std::shared_ptr fromGraal(void *graalNative) noexcept; /** @@ -113,14 +112,14 @@ class DXFCPP_EXPORT Candle final : public EventTypeWithSymbol, * * @return The pointer to the filled dxFeed Graal SDK structure */ - void* toGraal() const noexcept override; + void *toGraal() const noexcept override; /** * Releases the memory occupied by the dxFeed Graal SDK structure (recursively if necessary). * * @param graalNative The pointer to the dxFeed Graal SDK structure. */ - static void freeGraal(void* graalNative) noexcept; + static void freeGraal(void *graalNative) noexcept; public: /** @@ -258,7 +257,7 @@ class DXFCPP_EXPORT Candle final : public EventTypeWithSymbol, * Changes total number of original trade (or quote) events in this candle. * @param count total number of original trade (or quote) events in this candle. */ - void setCount(std::int64_t count) noexcept{ + void setCount(std::int64_t count) noexcept { data_.count = count; } @@ -274,7 +273,7 @@ class DXFCPP_EXPORT Candle final : public EventTypeWithSymbol, * Changes the first (open) price of this candle. * @param open the first (open) price of this candle. */ - void setOpen(double open) noexcept{ + void setOpen(double open) noexcept { data_.open = open; } @@ -290,7 +289,7 @@ class DXFCPP_EXPORT Candle final : public EventTypeWithSymbol, * Changes the maximal (high) price of this candle. * @param high the maximal (high) price of this candle. */ - void setHigh(double high) noexcept{ + void setHigh(double high) noexcept { data_.high = high; } @@ -306,7 +305,7 @@ class DXFCPP_EXPORT Candle final : public EventTypeWithSymbol, * Changes the minimal (low) price of this candle. * @param low the minimal (low) price of this candle. */ - void setLow(double low) noexcept{ + void setLow(double low) noexcept { data_.low = low; } @@ -322,7 +321,7 @@ class DXFCPP_EXPORT Candle final : public EventTypeWithSymbol, * Changes the last (close) price of this candle. * @param close the last (close) price of this candle. */ - void setClose(double close) noexcept{ + void setClose(double close) noexcept { data_.close = close; } @@ -338,16 +337,17 @@ class DXFCPP_EXPORT Candle final : public EventTypeWithSymbol, * Changes total volume in this candle. * @param volume total volume in this candle. */ - void setVolume(double volume) noexcept{ + void setVolume(double volume) noexcept { data_.volume = volume; } /** * Returns volume-weighted average price (VWAP) in this candle. - * Total turnover in this candle can be computed with getVWAP() * @ref Candle::getVolume() "getVolume"(). + * Total turnover in this candle can be computed with getVWAP() * @ref Candle::getVolume() + * "getVolume"(). * @return volume-weighted average price (VWAP) in this candle. */ - double getVWAP() const noexcept { + double getVWAP() const noexcept { return data_.vwap; } @@ -355,7 +355,7 @@ class DXFCPP_EXPORT Candle final : public EventTypeWithSymbol, * Changes volume-weighted average price (VWAP) in this candle. * @param vwap volume-weighted average price (VWAP) in this candle. */ - void setVWAP(double vwap) noexcept{ + void setVWAP(double vwap) noexcept { data_.vwap = vwap; } @@ -371,7 +371,7 @@ class DXFCPP_EXPORT Candle final : public EventTypeWithSymbol, * Changes bid volume in this candle. * @param bidVolume bid volume in this candle. */ - void setBidVolume(double bidVolume) noexcept{ + void setBidVolume(double bidVolume) noexcept { data_.bidVolume = bidVolume; } @@ -387,7 +387,7 @@ class DXFCPP_EXPORT Candle final : public EventTypeWithSymbol, * Changes ask volume in this candle. * @param askVolume ask volume in this candle. */ - void setAskVolume(double askVolume) noexcept{ + void setAskVolume(double askVolume) noexcept { data_.askVolume = askVolume; } @@ -419,7 +419,7 @@ class DXFCPP_EXPORT Candle final : public EventTypeWithSymbol, * Changes open interest. * @param openInterest open interest. */ - void setOpenInterest(double openInterest) noexcept{ + void setOpenInterest(double openInterest) noexcept { data_.openInterest = openInterest; } }; diff --git a/include/dxfeed_graal_cpp_api/event/candle/CandleAlignment.hpp b/include/dxfeed_graal_cpp_api/event/candle/CandleAlignment.hpp index 50a9ddbf..194a4dcc 100644 --- a/include/dxfeed_graal_cpp_api/event/candle/CandleAlignment.hpp +++ b/include/dxfeed_graal_cpp_api/event/candle/CandleAlignment.hpp @@ -56,7 +56,6 @@ struct DXFCPP_EXPORT CandleAlignment : public CandleSymbolAttribute { static const std::vector> VALUES; private: - std::string string_{}; explicit CandleAlignment(const std::string &string) noexcept : string_{string} { @@ -78,7 +77,8 @@ struct DXFCPP_EXPORT CandleAlignment : public CandleSymbolAttribute { /** * Returns string representation of this candle alignment. - * The string representation of candle alignment "m" for CandleAlignment::MIDNIGHT and "s" for CandleAlignment::SESSION. + * The string representation of candle alignment "m" for CandleAlignment::MIDNIGHT and "s" for + * CandleAlignment::SESSION. * * @return string representation of this candle alignment. */ @@ -105,22 +105,22 @@ struct DXFCPP_EXPORT CandleAlignment : public CandleSymbolAttribute { } for (const auto &alignmentRef : VALUES) { - const auto& alignmentStr = alignmentRef.get().toString(); + const auto &alignmentStr = alignmentRef.get().toString(); if (iEquals(alignmentStr, s)) { return alignmentRef; } } - //TODO: error handling throw IllegalArgumentException("Unknown candle alignment: " + s); + // TODO: error handling throw IllegalArgumentException("Unknown candle alignment: " + s); return std::nullopt; } /** * Returns candle alignment of the given candle symbol string. - * The result is CandleAlignment::DEFAULT if the symbol does not have candle alignment attribute or std::nullopt if there is no - * supported attribute's value. + * The result is CandleAlignment::DEFAULT if the symbol does not have candle alignment attribute or std::nullopt if + * there is no supported attribute's value. * * @param symbol The candle symbol string. * @return candle alignment of the given candle symbol string or std::nullopt if there is no supported attribute's diff --git a/include/dxfeed_graal_cpp_api/event/candle/CandlePeriod.hpp b/include/dxfeed_graal_cpp_api/event/candle/CandlePeriod.hpp index c686e011..d84d3d77 100644 --- a/include/dxfeed_graal_cpp_api/event/candle/CandlePeriod.hpp +++ b/include/dxfeed_graal_cpp_api/event/candle/CandlePeriod.hpp @@ -18,7 +18,8 @@ namespace dxfcpp { /** * Period attribute of CandleSymbol defines aggregation period of the candles. - * Aggregation period is defined as pair of a @ref CandlePeriod::getValue() "value" and @ref CandlePeriod::getType() "type". + * Aggregation period is defined as pair of a @ref CandlePeriod::getValue() "value" and @ref CandlePeriod::getType() + * "type". * *

Implementation details

* @@ -27,7 +28,8 @@ namespace dxfcpp { * @ref MarketEventSymbols::changeAttributeStringByKey() "changeAttributeStringByKey", and * @ref MarketEventSymbols::removeAttributeStringByKey() "removeAttributeStringByKey" methods. * The key to use with these methods is available via CandlePeriod::ATTRIBUTE_KEY constant. - * The value that this key shall be set to is equal to the corresponding CandlePeriod::toString() "CandlePeriod.toString()" + * The value that this key shall be set to is equal to the corresponding CandlePeriod::toString() + * "CandlePeriod.toString()" */ struct DXFCPP_EXPORT CandlePeriod : public CandleSymbolAttribute { /** diff --git a/include/dxfeed_graal_cpp_api/event/candle/CandlePrice.hpp b/include/dxfeed_graal_cpp_api/event/candle/CandlePrice.hpp index cf3f76db..9c83992b 100644 --- a/include/dxfeed_graal_cpp_api/event/candle/CandlePrice.hpp +++ b/include/dxfeed_graal_cpp_api/event/candle/CandlePrice.hpp @@ -73,7 +73,6 @@ struct DXFCPP_EXPORT CandlePrice : public CandleSymbolAttribute { static const std::vector> VALUES; private: - std::string string_; explicit CandlePrice(std::string string) noexcept : string_{std::move(string)} { @@ -145,8 +144,8 @@ struct DXFCPP_EXPORT CandlePrice : public CandleSymbolAttribute { /** * Returns candle price type of the given candle symbol string. - * The result is CandlePrice::DEFAULT if the symbol does not have candle price type attribute or std::nullopt if there is no - * supported attribute's value. + * The result is CandlePrice::DEFAULT if the symbol does not have candle price type attribute or std::nullopt if + * there is no supported attribute's value. * * @param symbol The candle symbol string. * @return candle price type of the given candle symbol string or std::nullopt if there is no supported attribute's diff --git a/include/dxfeed_graal_cpp_api/event/candle/CandlePriceLevel.hpp b/include/dxfeed_graal_cpp_api/event/candle/CandlePriceLevel.hpp index 96390e4b..6f384c47 100644 --- a/include/dxfeed_graal_cpp_api/event/candle/CandlePriceLevel.hpp +++ b/include/dxfeed_graal_cpp_api/event/candle/CandlePriceLevel.hpp @@ -122,7 +122,7 @@ struct DXFCPP_EXPORT CandlePriceLevel : public CandleSymbolAttribute { */ static std::optional valueOf(double value) noexcept { if (std::isinf(value) || (value == 0.0 && std::signbit(value))) { - //TODO: error handling throw IllegalArgumentException("Incorrect candle price level: " + value); + // TODO: error handling throw IllegalArgumentException("Incorrect candle price level: " + value); return std::nullopt; } @@ -164,8 +164,7 @@ struct DXFCPP_EXPORT CandlePriceLevel : public CandleSymbolAttribute { } if (a.value() != other.value().toString()) { - return MarketEventSymbols::changeAttributeStringByKey(symbol, ATTRIBUTE_KEY, - other.value().toString()); + return MarketEventSymbols::changeAttributeStringByKey(symbol, ATTRIBUTE_KEY, other.value().toString()); } } diff --git a/include/dxfeed_graal_cpp_api/event/candle/CandleSession.hpp b/include/dxfeed_graal_cpp_api/event/candle/CandleSession.hpp index 2478c67f..bd3cc459 100644 --- a/include/dxfeed_graal_cpp_api/event/candle/CandleSession.hpp +++ b/include/dxfeed_graal_cpp_api/event/candle/CandleSession.hpp @@ -61,7 +61,6 @@ struct DXFCPP_EXPORT CandleSession : public CandleSymbolAttribute { static const std::vector> VALUES; private: - SessionFilter sessionFilter_; std::string string_; @@ -129,7 +128,7 @@ struct DXFCPP_EXPORT CandleSession : public CandleSymbolAttribute { } for (const auto &sessionRef : VALUES) { - const auto& sessionStr = sessionRef.get().toString(); + const auto &sessionStr = sessionRef.get().toString(); if (sessionStr.length() >= n && iEquals(sessionStr.substr(0, n), s)) { return sessionRef; @@ -143,8 +142,8 @@ struct DXFCPP_EXPORT CandleSession : public CandleSymbolAttribute { /** * Returns candle session attribute of the given candle symbol string. - * The result is CandleSession::DEFAULT if the symbol does not have candle session attribute or std::nullopt if there is no - * supported attribute's value. + * The result is CandleSession::DEFAULT if the symbol does not have candle session attribute or std::nullopt if + * there is no supported attribute's value. * * @param symbol The candle symbol string. * @return candle session attribute of the given candle symbol string or std::nullopt if there is no supported diff --git a/include/dxfeed_graal_cpp_api/event/candle/CandleSymbol.hpp b/include/dxfeed_graal_cpp_api/event/candle/CandleSymbol.hpp index a4b686ff..a15919a1 100644 --- a/include/dxfeed_graal_cpp_api/event/candle/CandleSymbol.hpp +++ b/include/dxfeed_graal_cpp_api/event/candle/CandleSymbol.hpp @@ -38,9 +38,9 @@ struct SymbolWrapper; * *

String representation

* - * The string representation of the candle symbol consist of a @ref CandleSymbol::getBaseSymbol() "baseSymbol" followed by - * an optional '&' with an @ref CandleSymbol::getExchange() "exchange" code letter and followed by an optional list of - * comma-separated key=value pairs in curly braces: + * The string representation of the candle symbol consist of a @ref CandleSymbol::getBaseSymbol() "baseSymbol" followed + * by an optional '&' with an @ref CandleSymbol::getExchange() "exchange" code letter and followed by an optional list + * of comma-separated key=value pairs in curly braces: * *

` [ '&' ] [ '{' = [ ',' = ] ... '}' ]` * @@ -61,10 +61,10 @@ struct SymbolWrapper; * candle of "EUR/USD" bid price shall be specified with "EUR/USD{=m,price=bid}" candle symbol string. However, the * CandlePrice::SETTLEMENT can be abbreviated to "s", so a daily candle on "/ES" futures settlement prices can be * specified with "/ES{=d,price=s}" string. - *

  • "tho" key with a value of "true" corresponds to @ref CandleSymbol::getSession() "session" set to CandleSession::REGULAR - * which limits the candle to trading hours only, so a 133 tick candles on "GOOG" base symbol collected over - * trading hours only can be specified with "GOOG{=133t,tho=true}" string. Note, that the default daily candles - * for US equities are special for historical reasons and correspond to the way US equity exchange report their + *
  • "tho" key with a value of "true" corresponds to @ref CandleSymbol::getSession() "session" set to + * CandleSession::REGULAR which limits the candle to trading hours only, so a 133 tick candles on "GOOG" base symbol + * collected over trading hours only can be specified with "GOOG{=133t,tho=true}" string. Note, that the default daily + * candles for US equities are special for historical reasons and correspond to the way US equity exchange report their * daily summary data. The volume the US equity default daily candle corresponds to the total daily traded volume, * while open, high, low, and close correspond to the regular trading hours only. *
  • "a" key corresponds to @ref CandleSymbol::getAlignment() "alignment" — alignment attribute of this symbol. @@ -72,16 +72,16 @@ struct SymbolWrapper; * can be abbreviated to the first letter. So, a 1 hour candle on a symbol "AAPL" that starts at the regular * trading session at 9:30 am ET can be specified with "AAPL{=h,a=s,tho=true}". Contrast that to * the "AAPL{=h,tho=true}" candle that is aligned at midnight and thus starts at 9:00 am. - *
  • "pl" key corresponds to @ref CandleSymbol::getPriceLevel() "price level" — price level attribute of this symbol. - * The CandlePriceLevel defines additional axis to split candles within particular price corridor in addition to + *
  • "pl" key corresponds to @ref CandleSymbol::getPriceLevel() "price level" — price level attribute of this + * symbol. The CandlePriceLevel defines additional axis to split candles within particular price corridor in addition to * CandlePeriod attribute with the default value `NaN`. So a one-minute candles of "AAPL" with price level 0.1 * shall be specified with "AAPL{=m,pl=0.1}". * * - * Keys in the candle symbol are case-sensitive, while values are not. The CandleSymbol::valueOf() method parses any valid string - * representation into a candle symbol object. - * The result of the candle symbol CandleSymbol::toString() method is always normalized: keys are ordered lexicographically, - * values are in lower-case and are abbreviated to their shortest possible form. + * Keys in the candle symbol are case-sensitive, while values are not. The CandleSymbol::valueOf() method parses any + * valid string representation into a candle symbol object. The result of the candle symbol CandleSymbol::toString() + * method is always normalized: keys are ordered lexicographically, values are in lower-case and are abbreviated to + * their shortest possible form. */ struct DXFCPP_EXPORT CandleSymbol { diff --git a/include/dxfeed_graal_cpp_api/event/candle/CandleSymbolAttribute.hpp b/include/dxfeed_graal_cpp_api/event/candle/CandleSymbolAttribute.hpp index a210a9dd..582cc857 100644 --- a/include/dxfeed_graal_cpp_api/event/candle/CandleSymbolAttribute.hpp +++ b/include/dxfeed_graal_cpp_api/event/candle/CandleSymbolAttribute.hpp @@ -19,7 +19,7 @@ struct DXFCPP_EXPORT CandleSymbolAttribute { * @param symbol The original candle event symbol. * @return candle event symbol string with this attribute set. */ - virtual std::string changeAttributeForSymbol(const std::string& symbol) const noexcept = 0; + virtual std::string changeAttributeForSymbol(const std::string &symbol) const noexcept = 0; }; -} \ No newline at end of file +} // namespace dxfcpp \ No newline at end of file diff --git a/include/dxfeed_graal_cpp_api/event/candle/CandleType.hpp b/include/dxfeed_graal_cpp_api/event/candle/CandleType.hpp index aea26d12..b18a6745 100644 --- a/include/dxfeed_graal_cpp_api/event/candle/CandleType.hpp +++ b/include/dxfeed_graal_cpp_api/event/candle/CandleType.hpp @@ -126,8 +126,9 @@ struct DXFCPP_EXPORT CandleType { /** * Returns candle type period in milliseconds as closely as possible. * Certain types like CandleType::SECOND and CandleType::DAY span a specific number of milliseconds. - * CandleType::MONTH, CandleType::OPTEXP and CandleType::YEAR are approximate. Candle type period of CandleType::TICK, CandleType::VOLUME, CandleType::PRICE, - * CandleType::PRICE_MOMENTUM and CandleType::PRICE_RENKO is not defined and this method returns `0`. + * CandleType::MONTH, CandleType::OPTEXP and CandleType::YEAR are approximate. Candle type period of + * CandleType::TICK, CandleType::VOLUME, CandleType::PRICE, CandleType::PRICE_MOMENTUM and CandleType::PRICE_RENKO + * is not defined and this method returns `0`. * * @return aggregation period in milliseconds. */ @@ -148,8 +149,8 @@ struct DXFCPP_EXPORT CandleType { * Returns string representation of this candle type. * The string representation of candle type is the shortest unique prefix of the lower case string that corresponds * to its @ref CandleType::getName() "name". - * For example, CandleType::TICK is represented as `"t"`, while CandleType::MONTH is represented as `"mo"` to distinguish it from - * CandleType::MINUTE that is represented as `"m"`. + * For example, CandleType::TICK is represented as `"t"`, while CandleType::MONTH is represented as `"mo"` to + * distinguish it from CandleType::MINUTE that is represented as `"m"`. * * @return string representation of this candle price type. */ diff --git a/include/dxfeed_graal_cpp_api/event/market/AnalyticOrder.hpp b/include/dxfeed_graal_cpp_api/event/market/AnalyticOrder.hpp index de700b3f..901fec2f 100644 --- a/include/dxfeed_graal_cpp_api/event/market/AnalyticOrder.hpp +++ b/include/dxfeed_graal_cpp_api/event/market/AnalyticOrder.hpp @@ -22,19 +22,21 @@ struct EventMapper; /** * Represents an extension of Order introducing analytic information, e.g. adding to this order iceberg related - * information (@ref AnalyticOrder::getIcebergPeakSize() "icebergPeakSize", @ref AnalyticOrder::getIcebergHiddenSize() "icebergHiddenSize", + * information (@ref AnalyticOrder::getIcebergPeakSize() "icebergPeakSize", @ref AnalyticOrder::getIcebergHiddenSize() + * "icebergHiddenSize", * @ref AnalyticOrder::getIcebergExecutedSize() "icebergExecutedSize"). * The collection of analytic order events of a symbol represents the most recent analytic information * that is available about orders on the market at any given moment of time. * *

    Analytic order is similar to a regular Order. In addition this event has few additional properties: *

      - *
    • @ref AnalyticOrder::getIcebergPeakSize() "icebergPeakSize" - the size of the peak, i.e. the visible part of the iceberg, - * that is being continually refilled until the order is fully traded or cancelled; - *
    • @ref AnalyticOrder::getIcebergHiddenSize() "icebergHiddenSize" - the prediction of current hidden size of the iceberg, as inferred by the model; - *
    • @ref AnalyticOrder::getIcebergExecutedSize() "icebergExecutedSize" - the executed size of the iceberg order. For IcebergType::SYNTHETIC type - * represents total executed size of all orders composing current iceberg; - *
    • AnalyticOrder::getIcebergType() - type of the iceberg, either native (exchange-managed) or synthetic (managed outside of the exchange). + *
    • @ref AnalyticOrder::getIcebergPeakSize() "icebergPeakSize" - the size of the peak, i.e. the visible part of + * the iceberg, that is being continually refilled until the order is fully traded or cancelled;
    • @ref + * AnalyticOrder::getIcebergHiddenSize() "icebergHiddenSize" - the prediction of current hidden size of the iceberg, as + * inferred by the model;
    • @ref AnalyticOrder::getIcebergExecutedSize() "icebergExecutedSize" - the executed size of + * the iceberg order. For IcebergType::SYNTHETIC type represents total executed size of all orders composing current + * iceberg;
    • AnalyticOrder::getIcebergType() - type of the iceberg, either native (exchange-managed) or synthetic + * (managed outside of the exchange). *
    * *

    Implementation details

    @@ -71,7 +73,6 @@ class DXFCPP_EXPORT AnalyticOrder final : public Order { void fillGraalData(void *graalNative) const noexcept override; public: - static std::shared_ptr fromGraal(void *graalNative) noexcept; /** @@ -81,14 +82,14 @@ class DXFCPP_EXPORT AnalyticOrder final : public Order { * * @return The pointer to the filled dxFeed Graal SDK structure */ - void* toGraal() const noexcept override; + void *toGraal() const noexcept override; /** * Releases the memory occupied by the dxFeed Graal SDK structure (recursively if necessary). * * @param graalNative The pointer to the dxFeed Graal SDK structure. */ - static void freeGraal(void* graalNative) noexcept; + static void freeGraal(void *graalNative) noexcept; public: /// The alias to a type of shared pointer to the AnalyticOrder object diff --git a/include/dxfeed_graal_cpp_api/event/market/Direction.hpp b/include/dxfeed_graal_cpp_api/event/market/Direction.hpp index 8f8c218d..bcdd9361 100644 --- a/include/dxfeed_graal_cpp_api/event/market/Direction.hpp +++ b/include/dxfeed_graal_cpp_api/event/market/Direction.hpp @@ -18,7 +18,7 @@ namespace dxfcpp { /** * Direction of the price movement. For example tick direction for last trade price. */ -struct DXFCPP_EXPORT Direction : Enum { +struct Direction : Enum { using Enum::Enum; /** diff --git a/include/dxfeed_graal_cpp_api/event/market/IcebergType.hpp b/include/dxfeed_graal_cpp_api/event/market/IcebergType.hpp index ff20be4d..0a823298 100644 --- a/include/dxfeed_graal_cpp_api/event/market/IcebergType.hpp +++ b/include/dxfeed_graal_cpp_api/event/market/IcebergType.hpp @@ -15,7 +15,7 @@ namespace dxfcpp { /** * Type of an iceberg order. */ -struct DXFCPP_EXPORT IcebergType : Enum { +struct IcebergType : Enum { using Enum::Enum; /** diff --git a/include/dxfeed_graal_cpp_api/event/market/MarketEventSymbols.hpp b/include/dxfeed_graal_cpp_api/event/market/MarketEventSymbols.hpp index 5f026206..43465bb0 100644 --- a/include/dxfeed_graal_cpp_api/event/market/MarketEventSymbols.hpp +++ b/include/dxfeed_graal_cpp_api/event/market/MarketEventSymbols.hpp @@ -147,7 +147,8 @@ struct DXFCPP_EXPORT MarketEventSymbols { return length >= 2 && symbol[length - 2] == EXCHANGE_SEPARATOR; } - static DXFCPP_CXX20_CONSTEXPR_STRING std::string getBaseSymbolInternal(const std::string &symbol, std::size_t length) noexcept { + static DXFCPP_CXX20_CONSTEXPR_STRING std::string getBaseSymbolInternal(const std::string &symbol, + std::size_t length) noexcept { return hasExchangeCodeInternal(symbol, length) ? symbol.substr(0, length - 2) : symbol.substr(0, length); } diff --git a/include/dxfeed_graal_cpp_api/event/market/OptionSale.hpp b/include/dxfeed_graal_cpp_api/event/market/OptionSale.hpp index d2607fb2..4640da43 100644 --- a/include/dxfeed_graal_cpp_api/event/market/OptionSale.hpp +++ b/include/dxfeed_graal_cpp_api/event/market/OptionSale.hpp @@ -83,7 +83,6 @@ class DXFCPP_EXPORT OptionSale final : public MarketEvent, public IndexedEvent { static void freeGraalData(void *graalNative) noexcept; public: - static std::shared_ptr fromGraal(void *graalNative) noexcept; /** @@ -93,14 +92,14 @@ class DXFCPP_EXPORT OptionSale final : public MarketEvent, public IndexedEvent { * * @return The pointer to the filled dxFeed Graal SDK structure */ - void* toGraal() const noexcept override; + void *toGraal() const noexcept override; /** * Releases the memory occupied by the dxFeed Graal SDK structure (recursively if necessary). * * @param graalNative The pointer to the dxFeed Graal SDK structure. */ - static void freeGraal(void* graalNative) noexcept; + static void freeGraal(void *graalNative) noexcept; public: /** diff --git a/include/dxfeed_graal_cpp_api/event/market/OrderAction.hpp b/include/dxfeed_graal_cpp_api/event/market/OrderAction.hpp index ed52541b..0dbffc73 100644 --- a/include/dxfeed_graal_cpp_api/event/market/OrderAction.hpp +++ b/include/dxfeed_graal_cpp_api/event/market/OrderAction.hpp @@ -16,7 +16,7 @@ namespace dxfcpp { * Action enum for the Full Order Book (FOB) Orders. Action describes business meaning of the Order event: * whether order was added or replaced, partially or fully executed, etc. */ -struct DXFCPP_EXPORT OrderAction : Enum { +struct OrderAction : Enum { using Enum::Enum; /** diff --git a/include/dxfeed_graal_cpp_api/event/market/PriceType.hpp b/include/dxfeed_graal_cpp_api/event/market/PriceType.hpp index 75998d5f..a7216a68 100644 --- a/include/dxfeed_graal_cpp_api/event/market/PriceType.hpp +++ b/include/dxfeed_graal_cpp_api/event/market/PriceType.hpp @@ -15,7 +15,7 @@ namespace dxfcpp { /** * Type of the price value. */ -struct DXFCPP_EXPORT PriceType : Enum { +struct PriceType : Enum { using Enum::Enum; /** diff --git a/include/dxfeed_graal_cpp_api/event/market/Profile.hpp b/include/dxfeed_graal_cpp_api/event/market/Profile.hpp index 975d70a1..fc0e1560 100644 --- a/include/dxfeed_graal_cpp_api/event/market/Profile.hpp +++ b/include/dxfeed_graal_cpp_api/event/market/Profile.hpp @@ -70,7 +70,6 @@ class DXFCPP_EXPORT Profile final : public MarketEvent, public LastingEvent { static void freeGraalData(void *graalNative) noexcept; public: - static std::shared_ptr fromGraal(void *graalNative) noexcept; /** @@ -80,14 +79,14 @@ class DXFCPP_EXPORT Profile final : public MarketEvent, public LastingEvent { * * @return The pointer to the filled dxFeed Graal SDK structure */ - void* toGraal() const noexcept override; + void *toGraal() const noexcept override; /** * Releases the memory occupied by the dxFeed Graal SDK structure (recursively if necessary). * * @param graalNative The pointer to the dxFeed Graal SDK structure. */ - static void freeGraal(void* graalNative) noexcept; + static void freeGraal(void *graalNative) noexcept; public: /// The alias to a type of shared pointer to the Profile object diff --git a/include/dxfeed_graal_cpp_api/event/market/Scope.hpp b/include/dxfeed_graal_cpp_api/event/market/Scope.hpp index a7459a90..2111978b 100644 --- a/include/dxfeed_graal_cpp_api/event/market/Scope.hpp +++ b/include/dxfeed_graal_cpp_api/event/market/Scope.hpp @@ -18,7 +18,7 @@ namespace dxfcpp { /** * Scope of an order. */ -struct DXFCPP_EXPORT Scope : Enum { +struct Scope : Enum { using Enum::Enum; /** @@ -43,7 +43,6 @@ struct DXFCPP_EXPORT Scope : Enum { static const Scope ORDER; }; -template <> -const std::unordered_map> Scope::ParentType::ALL; +template <> const std::unordered_map> Scope::ParentType::ALL; } // namespace dxfcpp \ No newline at end of file diff --git a/include/dxfeed_graal_cpp_api/event/market/ShortSaleRestriction.hpp b/include/dxfeed_graal_cpp_api/event/market/ShortSaleRestriction.hpp index c490e9bb..2e11ae01 100644 --- a/include/dxfeed_graal_cpp_api/event/market/ShortSaleRestriction.hpp +++ b/include/dxfeed_graal_cpp_api/event/market/ShortSaleRestriction.hpp @@ -18,7 +18,7 @@ namespace dxfcpp { /** * Short sale restriction on an instrument. */ -struct DXFCPP_EXPORT ShortSaleRestriction : Enum { +struct ShortSaleRestriction : Enum { using Enum::Enum; /** diff --git a/include/dxfeed_graal_cpp_api/event/market/Side.hpp b/include/dxfeed_graal_cpp_api/event/market/Side.hpp index 65771026..ffffeba2 100644 --- a/include/dxfeed_graal_cpp_api/event/market/Side.hpp +++ b/include/dxfeed_graal_cpp_api/event/market/Side.hpp @@ -18,7 +18,7 @@ namespace dxfcpp { /** * Side of an order or a trade. */ -struct DXFCPP_EXPORT Side : Enum { +struct Side : Enum { using Enum::Enum; /** @@ -37,7 +37,6 @@ struct DXFCPP_EXPORT Side : Enum { static const Side SELL; }; -template <> -const std::unordered_map> Side::ParentType::ALL; +template <> const std::unordered_map> Side::ParentType::ALL; } // namespace dxfcpp \ No newline at end of file diff --git a/include/dxfeed_graal_cpp_api/event/market/Summary.hpp b/include/dxfeed_graal_cpp_api/event/market/Summary.hpp index 6825d5c9..2583f73c 100644 --- a/include/dxfeed_graal_cpp_api/event/market/Summary.hpp +++ b/include/dxfeed_graal_cpp_api/event/market/Summary.hpp @@ -62,7 +62,6 @@ class DXFCPP_EXPORT Summary final : public MarketEvent, public LastingEvent { void fillGraalData(void *graalNative) const noexcept override; public: - static std::shared_ptr fromGraal(void *graalNative) noexcept; /** @@ -72,14 +71,14 @@ class DXFCPP_EXPORT Summary final : public MarketEvent, public LastingEvent { * * @return The pointer to the filled dxFeed Graal SDK structure */ - void* toGraal() const noexcept override; + void *toGraal() const noexcept override; /** * Releases the memory occupied by the dxFeed Graal SDK structure (recursively if necessary). * * @param graalNative The pointer to the dxFeed Graal SDK structure. */ - static void freeGraal(void* graalNative) noexcept; + static void freeGraal(void *graalNative) noexcept; public: /// The alias to a type of shared pointer to the Summary object diff --git a/include/dxfeed_graal_cpp_api/event/market/TimeAndSale.hpp b/include/dxfeed_graal_cpp_api/event/market/TimeAndSale.hpp index b1245b40..fc0640a4 100644 --- a/include/dxfeed_graal_cpp_api/event/market/TimeAndSale.hpp +++ b/include/dxfeed_graal_cpp_api/event/market/TimeAndSale.hpp @@ -111,7 +111,6 @@ class DXFCPP_EXPORT TimeAndSale final : public MarketEvent, public TimeSeriesEve static void freeGraalData(void *graalNative) noexcept; public: - static std::shared_ptr fromGraal(void *graalNative) noexcept; /** @@ -121,14 +120,14 @@ class DXFCPP_EXPORT TimeAndSale final : public MarketEvent, public TimeSeriesEve * * @return The pointer to the filled dxFeed Graal SDK structure */ - void* toGraal() const noexcept override; + void *toGraal() const noexcept override; /** * Releases the memory occupied by the dxFeed Graal SDK structure (recursively if necessary). * * @param graalNative The pointer to the dxFeed Graal SDK structure. */ - static void freeGraal(void* graalNative) noexcept; + static void freeGraal(void *graalNative) noexcept; public: /** diff --git a/include/dxfeed_graal_cpp_api/event/market/TimeAndSaleType.hpp b/include/dxfeed_graal_cpp_api/event/market/TimeAndSaleType.hpp index 945361e7..bf5dae54 100644 --- a/include/dxfeed_graal_cpp_api/event/market/TimeAndSaleType.hpp +++ b/include/dxfeed_graal_cpp_api/event/market/TimeAndSaleType.hpp @@ -18,7 +18,7 @@ namespace dxfcpp { /** * Type of a time and sale event. */ -struct DXFCPP_EXPORT TimeAndSaleType : Enum { +struct TimeAndSaleType : Enum { using Enum::Enum; /** diff --git a/include/dxfeed_graal_cpp_api/event/market/Trade.hpp b/include/dxfeed_graal_cpp_api/event/market/Trade.hpp index 64969821..c460f838 100644 --- a/include/dxfeed_graal_cpp_api/event/market/Trade.hpp +++ b/include/dxfeed_graal_cpp_api/event/market/Trade.hpp @@ -30,14 +30,15 @@ struct EventMapper; * * The Trade event defines last trade @ref Trade::getPrice() "price" as officially defined * by the corresponding exchange for its regular trading hours (RTH). - * It also include an official exchange @ref Trade::getDayVolume() "dayVolume" and @ref Trade::getDayTurnover() "dayTurnover" - * for the whole trading day identified by @ref Trade::getDayId() "dayId". - * So, Trade event captures all the official numbers that are typically reported by exchange. + * It also include an official exchange @ref Trade::getDayVolume() "dayVolume" and @ref Trade::getDayTurnover() + * "dayTurnover" for the whole trading day identified by @ref Trade::getDayId() "dayId". So, Trade event captures + * all the official numbers that are typically reported by exchange. * *

    Trades that happen in extended trading hours (ETH, pre-market and post-market trading sessions), * which are typically defined for stocks and ETFs, do not update last trade @ref Trade::getTime() "time", * @ref Trade::getExchangeCode() "exchangeCode", @ref Trade::getPrice() "price", @ref Trade::getChange() "change", - * @ref Trade::getSize() "size", and @ref Trade::getTickDirection() "tickDirection" in the Trade event, but they do update + * @ref Trade::getSize() "size", and @ref Trade::getTickDirection() "tickDirection" in the Trade event, but they do + * update * @ref Trade::getDayVolume() "dayVolume" and @ref Trade::getDayTurnover() "dayTurnover". * *

    During extended trading hours a TradeETH event is generated on each trade with its @@ -75,7 +76,6 @@ class DXFCPP_EXPORT Trade final : public TradeBase { void fillGraalData(void *graalNative) const noexcept override; public: - static std::shared_ptr fromGraal(void *graalNative) noexcept; /** @@ -85,14 +85,14 @@ class DXFCPP_EXPORT Trade final : public TradeBase { * * @return The pointer to the filled dxFeed Graal SDK structure */ - void* toGraal() const noexcept override; + void *toGraal() const noexcept override; /** * Releases the memory occupied by the dxFeed Graal SDK structure (recursively if necessary). * * @param graalNative The pointer to the dxFeed Graal SDK structure. */ - static void freeGraal(void* graalNative) noexcept; + static void freeGraal(void *graalNative) noexcept; public: /// The alias to a type of shared pointer to the Trade object diff --git a/include/dxfeed_graal_cpp_api/event/market/TradeBase.hpp b/include/dxfeed_graal_cpp_api/event/market/TradeBase.hpp index dda742c1..b1d270ae 100644 --- a/include/dxfeed_graal_cpp_api/event/market/TradeBase.hpp +++ b/include/dxfeed_graal_cpp_api/event/market/TradeBase.hpp @@ -350,7 +350,8 @@ class DXFCPP_EXPORT TradeBase : public MarketEvent, public LastingEvent { * @param extendedTradingHours `true` if last trade was in extended trading hours. */ void setExtendedTradingHours(bool extendedTradingHours) noexcept { - tradeBaseData_.flags = extendedTradingHours ? orOp(tradeBaseData_.flags, ETH) : andOp(tradeBaseData_.flags, ~ETH); + tradeBaseData_.flags = + extendedTradingHours ? orOp(tradeBaseData_.flags, ETH) : andOp(tradeBaseData_.flags, ~ETH); } /** diff --git a/include/dxfeed_graal_cpp_api/event/market/TradeETH.hpp b/include/dxfeed_graal_cpp_api/event/market/TradeETH.hpp index 44b5a84f..117519fc 100644 --- a/include/dxfeed_graal_cpp_api/event/market/TradeETH.hpp +++ b/include/dxfeed_graal_cpp_api/event/market/TradeETH.hpp @@ -62,24 +62,23 @@ struct EventMapper; * * Daily reset procedure that happens on a schedule during non-trading hours resets TradeETH * @ref TradeETH::getDayVolume() "dayVolume" and @ref TradeETH::getDayTurnover() "dayTurnover" to math::NaN - * and sets @ref TradeETH::getDayId() "dayId" to the next trading day in preparation to the next day's pre-market trading - * session (or for regular trading if there is no pre-market) while leaving all other properties intact. They reflect - * information about the last known ETH trade until the next ETH trade happens. + * and sets @ref TradeETH::getDayId() "dayId" to the next trading day in preparation to the next day's pre-market + * trading session (or for regular trading if there is no pre-market) while leaving all other properties intact. They + * reflect information about the last known ETH trade until the next ETH trade happens. * *

    The most recent last trade price

    * * The most recent last trade price ("extended last price") in the market can be found by combining information from - * both Trade and TradeETH events using @ref TradeETH::isExtendedTradingHours() "isExtendedTradingHours" method to figure out - * which trading session had the most recent trade. The following piece of code finds the most - * recent last trade price from the given @ref DXFeed "feed" for a given `symbol`, - * assuming there is a @ref DXFeedSubscription "subscription" for both Trade and TradeETH events - * for the given `symbol`: + * both Trade and TradeETH events using @ref TradeETH::isExtendedTradingHours() "isExtendedTradingHours" method to + * figure out which trading session had the most recent trade. The following piece of code finds the most recent last + * trade price from the given @ref DXFeed "feed" for a given `symbol`, assuming there is a @ref DXFeedSubscription + * "subscription" for both Trade and TradeETH events for the given `symbol`: * *
    
      *     auto @ref Trade "trade" = feed->@ref DXFeed::getLastEvent() "getLastEvent"(Trade::create(symbol));
      *     auto @ref TradeETH "tradeEth" = feed->@ref DXFeed::getLastEvent() "getLastEvent"(TradeETH::create(symbol));
    - *     double extLast = tradeEth->@ref TradeETH::isExtendedTradingHours() "isExtendedTradingHours"() ? tradeEth->@ref
    - * TradeETH::getPrice() "getPrice"() : trade->@ref Trade::getPrice() "getPrice"();
    + *     double extLast = tradeEth->@ref TradeETH::isExtendedTradingHours() "isExtendedTradingHours"() ?
    + * tradeEth->@ref TradeETH::getPrice() "getPrice"() : trade->@ref Trade::getPrice() "getPrice"();
      * 
    * * Note, that the above code works correctly for symbols that has no concept of ETH, too, because in this @@ -91,9 +90,9 @@ struct EventMapper; * * This event is implemented on top of QDS record `TradeETH` and `TradeETH&X` * for regional exchange extended trade hours. - * @ref TradeETH::isExtendedTradingHours() "extendedTradingHours" property is internally represented as a last bit of the - * "Flags" field of the record. Regional records do not explicitly store a field for @ref TradeETH::getExchangeCode() - * "exchangeCode" property. + * @ref TradeETH::isExtendedTradingHours() "extendedTradingHours" property is internally represented as a last bit of + * the "Flags" field of the record. Regional records do not explicitly store a field for @ref + * TradeETH::getExchangeCode() "exchangeCode" property. */ class DXFCPP_EXPORT TradeETH final : public TradeBase { friend struct EventMapper; @@ -102,7 +101,6 @@ class DXFCPP_EXPORT TradeETH final : public TradeBase { void fillGraalData(void *graalNative) const noexcept override; public: - static std::shared_ptr fromGraal(void *graalNative) noexcept; /** @@ -112,14 +110,14 @@ class DXFCPP_EXPORT TradeETH final : public TradeBase { * * @return The pointer to the filled dxFeed Graal SDK structure */ - void* toGraal() const noexcept override; + void *toGraal() const noexcept override; /** * Releases the memory occupied by the dxFeed Graal SDK structure (recursively if necessary). * * @param graalNative The pointer to the dxFeed Graal SDK structure. */ - static void freeGraal(void* graalNative) noexcept; + static void freeGraal(void *graalNative) noexcept; public: /// The alias to a type of shared pointer to the TradeETH object diff --git a/include/dxfeed_graal_cpp_api/event/market/TradingStatus.hpp b/include/dxfeed_graal_cpp_api/event/market/TradingStatus.hpp index a79b4cb4..96f9b408 100644 --- a/include/dxfeed_graal_cpp_api/event/market/TradingStatus.hpp +++ b/include/dxfeed_graal_cpp_api/event/market/TradingStatus.hpp @@ -18,7 +18,7 @@ namespace dxfcpp { /** * Trading status of an instrument. */ -struct DXFCPP_EXPORT TradingStatus : Enum { +struct TradingStatus : Enum { using Enum::Enum; /** diff --git a/include/dxfeed_graal_cpp_api/event/option/Greeks.hpp b/include/dxfeed_graal_cpp_api/event/option/Greeks.hpp index 4cdc5df3..19423380 100644 --- a/include/dxfeed_graal_cpp_api/event/option/Greeks.hpp +++ b/include/dxfeed_graal_cpp_api/event/option/Greeks.hpp @@ -79,7 +79,6 @@ class DXFCPP_EXPORT Greeks final : public MarketEvent, public TimeSeriesEvent, p void fillGraalData(void *graalNative) const noexcept override; public: - static std::shared_ptr fromGraal(void *graalNative) noexcept; /** @@ -89,14 +88,14 @@ class DXFCPP_EXPORT Greeks final : public MarketEvent, public TimeSeriesEvent, p * * @return The pointer to the filled dxFeed Graal SDK structure */ - void* toGraal() const noexcept override; + void *toGraal() const noexcept override; /** * Releases the memory occupied by the dxFeed Graal SDK structure (recursively if necessary). * * @param graalNative The pointer to the dxFeed Graal SDK structure. */ - static void freeGraal(void* graalNative) noexcept; + static void freeGraal(void *graalNative) noexcept; public: /** diff --git a/include/dxfeed_graal_cpp_api/event/option/Series.hpp b/include/dxfeed_graal_cpp_api/event/option/Series.hpp index 793f0300..f23dfe70 100644 --- a/include/dxfeed_graal_cpp_api/event/option/Series.hpp +++ b/include/dxfeed_graal_cpp_api/event/option/Series.hpp @@ -87,7 +87,6 @@ class DXFCPP_EXPORT Series final : public MarketEvent, public IndexedEvent { void fillGraalData(void *graalNative) const noexcept override; public: - static std::shared_ptr fromGraal(void *graalNative) noexcept; /** @@ -97,14 +96,14 @@ class DXFCPP_EXPORT Series final : public MarketEvent, public IndexedEvent { * * @return The pointer to the filled dxFeed Graal SDK structure */ - void* toGraal() const noexcept override; + void *toGraal() const noexcept override; /** * Releases the memory occupied by the dxFeed Graal SDK structure (recursively if necessary). * * @param graalNative The pointer to the dxFeed Graal SDK structure. */ - static void freeGraal(void* graalNative) noexcept; + static void freeGraal(void *graalNative) noexcept; public: /** diff --git a/include/dxfeed_graal_cpp_api/event/option/TheoPrice.hpp b/include/dxfeed_graal_cpp_api/event/option/TheoPrice.hpp index de250177..fe4e782e 100644 --- a/include/dxfeed_graal_cpp_api/event/option/TheoPrice.hpp +++ b/include/dxfeed_graal_cpp_api/event/option/TheoPrice.hpp @@ -86,7 +86,6 @@ class DXFCPP_EXPORT TheoPrice final : public MarketEvent, public TimeSeriesEvent void fillGraalData(void *graalNative) const noexcept override; public: - static std::shared_ptr fromGraal(void *graalNative) noexcept; /** @@ -96,14 +95,14 @@ class DXFCPP_EXPORT TheoPrice final : public MarketEvent, public TimeSeriesEvent * * @return The pointer to the filled dxFeed Graal SDK structure */ - void* toGraal() const noexcept override; + void *toGraal() const noexcept override; /** * Releases the memory occupied by the dxFeed Graal SDK structure (recursively if necessary). * * @param graalNative The pointer to the dxFeed Graal SDK structure. */ - static void freeGraal(void* graalNative) noexcept; + static void freeGraal(void *graalNative) noexcept; public: /** diff --git a/include/dxfeed_graal_cpp_api/event/option/Underlying.hpp b/include/dxfeed_graal_cpp_api/event/option/Underlying.hpp index f0c47299..64256f19 100644 --- a/include/dxfeed_graal_cpp_api/event/option/Underlying.hpp +++ b/include/dxfeed_graal_cpp_api/event/option/Underlying.hpp @@ -82,7 +82,6 @@ class DXFCPP_EXPORT Underlying final : public MarketEvent, public TimeSeriesEven void fillGraalData(void *graalNative) const noexcept override; public: - static std::shared_ptr fromGraal(void *graalNative) noexcept; /** @@ -92,14 +91,14 @@ class DXFCPP_EXPORT Underlying final : public MarketEvent, public TimeSeriesEven * * @return The pointer to the filled dxFeed Graal SDK structure */ - void* toGraal() const noexcept override; + void *toGraal() const noexcept override; /** * Releases the memory occupied by the dxFeed Graal SDK structure (recursively if necessary). * * @param graalNative The pointer to the dxFeed Graal SDK structure. */ - static void freeGraal(void* graalNative) noexcept; + static void freeGraal(void *graalNative) noexcept; public: /** diff --git a/include/dxfeed_graal_cpp_api/internal/Common.hpp b/include/dxfeed_graal_cpp_api/internal/Common.hpp index 601f7b4d..097fc6ea 100644 --- a/include/dxfeed_graal_cpp_api/internal/Common.hpp +++ b/include/dxfeed_graal_cpp_api/internal/Common.hpp @@ -8,8 +8,8 @@ #ifdef __cpp_lib_bit_cast # include #endif -#include #include +#include #include #include @@ -672,7 +672,7 @@ constexpr static std::size_t hashMix(std::size_t v) noexcept { return hashMixImpl::fn(v); } -template constexpr void hashCombine(std::size_t &seed, const T& v) noexcept { +template constexpr void hashCombine(std::size_t &seed, const T &v) noexcept { seed = hashMix(seed + 0x9e3779b9 + std::hash()(v)); } diff --git a/include/dxfeed_graal_cpp_api/internal/Enum.hpp b/include/dxfeed_graal_cpp_api/internal/Enum.hpp index 5e49d9df..16ff607d 100644 --- a/include/dxfeed_graal_cpp_api/internal/Enum.hpp +++ b/include/dxfeed_graal_cpp_api/internal/Enum.hpp @@ -14,7 +14,7 @@ namespace dxfcpp { -template struct DXFCPP_EXPORT Enum { +template struct Enum { using ParentType = Enum; using ChildType = Child; using CodeType = Code; diff --git a/include/dxfeed_graal_cpp_api/internal/utils/StringUtils.hpp b/include/dxfeed_graal_cpp_api/internal/utils/StringUtils.hpp index d02e69f2..d701528c 100644 --- a/include/dxfeed_graal_cpp_api/internal/utils/StringUtils.hpp +++ b/include/dxfeed_graal_cpp_api/internal/utils/StringUtils.hpp @@ -5,11 +5,11 @@ #include "../Conf.hpp" +#include #include +#include #include #include -#include -#include namespace dxfcpp { @@ -65,7 +65,7 @@ DXFCPP_EXPORT std::string utf16toUtf8String(std::int16_t in) noexcept; * @param in The UTF16 string * @return UTF8 string */ -DXFCPP_EXPORT std::string utf16toUtf8String(const std::u16string& in) noexcept; +DXFCPP_EXPORT std::string utf16toUtf8String(const std::u16string &in) noexcept; /** * Converts vector of UTF16 chars to UTF8 string @@ -73,7 +73,7 @@ DXFCPP_EXPORT std::string utf16toUtf8String(const std::u16string& in) noexcept; * @param in The UTF16 string * @return UTF8 string */ -DXFCPP_EXPORT std::string utf16toUtf8String(const std::vector& in) noexcept; +DXFCPP_EXPORT std::string utf16toUtf8String(const std::vector &in) noexcept; DXFCPP_EXPORT std::int16_t utf8to16(char in) noexcept; diff --git a/samples/cpp/DxFeedSample/src/main.cpp b/samples/cpp/DxFeedSample/src/main.cpp index c9848ce8..f83d0b6f 100644 --- a/samples/cpp/DxFeedSample/src/main.cpp +++ b/samples/cpp/DxFeedSample/src/main.cpp @@ -34,11 +34,11 @@ void testQuoteAndTradeListener(const std::string &symbol) { // Listener must be attached before symbols are added. subscription->addEventListener([](const auto &events) { for (const auto &e : events) { - //An example of using is and sharedAs (may return empty shared_ptr) - if (const auto& q = e-> template sharedAs(); q) { + // An example of using is and sharedAs (may return empty shared_ptr) + if (const auto &q = e->template sharedAs(); q) { std::cout << q->toString() + "\n"; - } else if (e-> template is()) { - std::cout << e-> template sharedAs()->toString() + "\n"; + } else if (e->template is()) { + std::cout << e->template sharedAs()->toString() + "\n"; } } }); diff --git a/samples/cpp/WriteTapeFile/CMakeLists.txt b/samples/cpp/WriteTapeFile/CMakeLists.txt index a0a2257d..34c4e727 100644 --- a/samples/cpp/WriteTapeFile/CMakeLists.txt +++ b/samples/cpp/WriteTapeFile/CMakeLists.txt @@ -62,10 +62,18 @@ if (DXFCXX_ENABLE_ASAN_UBSAN) $ $) else () - target_link_libraries(${PROJECT_NAME} PRIVATE dxfcxx::static) + # target_link_libraries(${PROJECT_NAME} PRIVATE dxfcxx::static) + # + # add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different + # $ + # $) + + target_link_libraries(${PROJECT_NAME} PRIVATE dxfcxx) + target_compile_definitions(${PROJECT_NAME} PRIVATE DXFCPP_USE_DLLS) add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different $ + $ $) endif () diff --git a/src/event/EventMapper.cpp b/src/event/EventMapper.cpp index 81879d9a..c55dabcf 100644 --- a/src/event/EventMapper.cpp +++ b/src/event/EventMapper.cpp @@ -248,8 +248,7 @@ void *EventMapper::newGraalList(std::ptrdiff_t size) noexcept { return list; } -bool EventMapper::setGraalListElement(void *graalList, std::ptrdiff_t elementIdx, - void *element) noexcept { +bool EventMapper::setGraalListElement(void *graalList, std::ptrdiff_t elementIdx, void *element) noexcept { using ListType = dxfg_event_type_list; using SizeType = decltype(ListType::size); using ElementType = dxfg_event_type_t; diff --git a/src/event/EventTypeEnum.cpp b/src/event/EventTypeEnum.cpp index e7bae187..d1d3805a 100644 --- a/src/event/EventTypeEnum.cpp +++ b/src/event/EventTypeEnum.cpp @@ -41,8 +41,8 @@ const std::vector> EventTypeEnum::AL std::cref(THEO_PRICE), std::cref(TRADE), std::cref(TRADE_ETH), - //std::cref(CONFIGURATION), - //std::cref(MESSAGE), + // std::cref(CONFIGURATION), + // std::cref(MESSAGE), std::cref(TIME_AND_SALE), std::cref(ORDER), std::cref(ANALYTIC_ORDER), diff --git a/src/event/candle/Candle.cpp b/src/event/candle/Candle.cpp index 48350adf..61566f3b 100644 --- a/src/event/candle/Candle.cpp +++ b/src/event/candle/Candle.cpp @@ -118,7 +118,8 @@ void *Candle::toGraal() const noexcept { Debugger::debug(toString() + "::toGraal()"); } - auto *graalCandle = new (std::nothrow) dxfg_candle_t{.event_type = {.clazz = dxfg_event_clazz_t::DXFG_EVENT_CANDLE}}; + auto *graalCandle = + new (std::nothrow) dxfg_candle_t{.event_type = {.clazz = dxfg_event_clazz_t::DXFG_EVENT_CANDLE}}; if (!graalCandle) { // TODO: error handling diff --git a/src/event/market/OptionSale.cpp b/src/event/market/OptionSale.cpp index 205da1e2..dc35de8d 100644 --- a/src/event/market/OptionSale.cpp +++ b/src/event/market/OptionSale.cpp @@ -118,8 +118,8 @@ std::string OptionSale::toString() const noexcept { "exchange={}, price={}, size={}, bid={}, ask={}, ESC='{}', TTE={}, side={}, spread={}, ETH={}, " "validTick={}, type={}, underlyingPrice={}, volatility={}, delta={}, optionSymbol='{}'}}", MarketEvent::getEventSymbol(), formatTimeStampWithMillis(MarketEvent::getEventTime()), - getEventFlagsMask().getMask(), getIndex(), formatTimeStampWithMillis(getTime()), getTimeNanoPart(), getSequence(), - encodeChar(getExchangeCode()), dxfcpp::toString(getPrice()), dxfcpp::toString(getSize()), + getEventFlagsMask().getMask(), getIndex(), formatTimeStampWithMillis(getTime()), getTimeNanoPart(), + getSequence(), encodeChar(getExchangeCode()), dxfcpp::toString(getPrice()), dxfcpp::toString(getSize()), dxfcpp::toString(getBidPrice()), dxfcpp::toString(getAskPrice()), getExchangeSaleConditions(), encodeChar(getTradeThroughExempt()), getAggressorSide().toString(), isSpreadLeg(), isExtendedTradingHours(), isValidTick(), getType().toString(), dxfcpp::toString(getUnderlyingPrice()), dxfcpp::toString(getVolatility()), diff --git a/src/event/market/OrderBase.cpp b/src/event/market/OrderBase.cpp index eb586613..128d363d 100644 --- a/src/event/market/OrderBase.cpp +++ b/src/event/market/OrderBase.cpp @@ -73,10 +73,10 @@ std::string OrderBase::baseFieldsToString() const noexcept { "timeNanoPart={}, action={}, actionTime={}, orderId={}, auxOrderId={}, price={}, " "size={}, executedSize={}, count={}, exchange={}, side={}, scope={}, tradeId={}, tradePrice={}, tradeSize={}", MarketEvent::getEventSymbol(), formatTimeStampWithMillis(MarketEvent::getEventTime()), getSource().toString(), - getEventFlagsMask().getMask(), getIndex(), formatTimeStampWithMillis(getTime()), getSequence(), getTimeNanoPart(), - getAction().toString(), formatTimeStampWithMillis(getActionTime()), getOrderId(), getAuxOrderId(), - dxfcpp::toString(getPrice()), dxfcpp::toString(getSize()), dxfcpp::toString(getExecutedSize()), getCount(), - encodeChar(getExchangeCode()), getOrderSide().toString(), getScope().toString(), getTradeId(), + getEventFlagsMask().getMask(), getIndex(), formatTimeStampWithMillis(getTime()), getSequence(), + getTimeNanoPart(), getAction().toString(), formatTimeStampWithMillis(getActionTime()), getOrderId(), + getAuxOrderId(), dxfcpp::toString(getPrice()), dxfcpp::toString(getSize()), dxfcpp::toString(getExecutedSize()), + getCount(), encodeChar(getExchangeCode()), getOrderSide().toString(), getScope().toString(), getTradeId(), dxfcpp::toString(getTradePrice()), dxfcpp::toString(getTradeSize())); } diff --git a/src/event/market/SpreadOrder.cpp b/src/event/market/SpreadOrder.cpp index effb01c6..f77746e9 100644 --- a/src/event/market/SpreadOrder.cpp +++ b/src/event/market/SpreadOrder.cpp @@ -6,11 +6,11 @@ #include #include +#include "dxfeed_graal_cpp_api/event/market/SpreadOrder.hpp" #include #include #include #include -#include "dxfeed_graal_cpp_api/event/market/SpreadOrder.hpp" namespace dxfcpp { @@ -82,8 +82,8 @@ void *SpreadOrder::toGraal() const noexcept { Debugger::debug(toString() + "::toGraal()"); } - auto *graalSpreadOrder = new (std::nothrow) - dxfg_spread_order_t{.order_base = {.market_event = {.event_type = {.clazz = dxfg_event_clazz_t::DXFG_EVENT_SPREAD_ORDER}}}}; + auto *graalSpreadOrder = new (std::nothrow) dxfg_spread_order_t{ + .order_base = {.market_event = {.event_type = {.clazz = dxfg_event_clazz_t::DXFG_EVENT_SPREAD_ORDER}}}}; if (!graalSpreadOrder) { // TODO: error handling diff --git a/src/event/option/Greeks.cpp b/src/event/option/Greeks.cpp index 2f9da1a9..0c46459a 100644 --- a/src/event/option/Greeks.cpp +++ b/src/event/option/Greeks.cpp @@ -88,9 +88,10 @@ std::string Greeks::toString() const noexcept { "Greeks{{{}, eventTime={}, eventFlags={:#x}, time={}, sequence={}, price={}, volatility={}, delta={}, " "gamma={}, theta={}, rho={}, vega={}}}", MarketEvent::getEventSymbol(), formatTimeStampWithMillis(MarketEvent::getEventTime()), - getEventFlagsMask().getMask(), formatTimeStampWithMillis(getTime()), getSequence(), dxfcpp::toString(getPrice()), - dxfcpp::toString(getVolatility()), dxfcpp::toString(getDelta()), dxfcpp::toString(getGamma()), - dxfcpp::toString(getTheta()), dxfcpp::toString(getRho()), dxfcpp::toString(getVega())); + getEventFlagsMask().getMask(), formatTimeStampWithMillis(getTime()), getSequence(), + dxfcpp::toString(getPrice()), dxfcpp::toString(getVolatility()), dxfcpp::toString(getDelta()), + dxfcpp::toString(getGamma()), dxfcpp::toString(getTheta()), dxfcpp::toString(getRho()), + dxfcpp::toString(getVega())); } void *Greeks::toGraal() const noexcept { diff --git a/src/event/option/TheoPrice.cpp b/src/event/option/TheoPrice.cpp index 4fcc89df..8cfbbd69 100644 --- a/src/event/option/TheoPrice.cpp +++ b/src/event/option/TheoPrice.cpp @@ -86,9 +86,9 @@ std::string TheoPrice::toString() const noexcept { "TheoPrice{{{}, eventTime={}, eventFlags={:#x}, time={}, sequence={}, price={}, underlyingPrice={}, " "delta={}, gamma={}, dividend={}, interest={}}}", MarketEvent::getEventSymbol(), formatTimeStampWithMillis(MarketEvent::getEventTime()), - getEventFlagsMask().getMask(), formatTimeStampWithMillis(getTime()), getSequence(), dxfcpp::toString(getPrice()), - dxfcpp::toString(getUnderlyingPrice()), dxfcpp::toString(getDelta()), dxfcpp::toString(getGamma()), - dxfcpp::toString(getDividend()), dxfcpp::toString(getInterest())); + getEventFlagsMask().getMask(), formatTimeStampWithMillis(getTime()), getSequence(), + dxfcpp::toString(getPrice()), dxfcpp::toString(getUnderlyingPrice()), dxfcpp::toString(getDelta()), + dxfcpp::toString(getGamma()), dxfcpp::toString(getDividend()), dxfcpp::toString(getInterest())); } void *TheoPrice::toGraal() const noexcept { diff --git a/src/internal/utils/StringUtils.cpp b/src/internal/utils/StringUtils.cpp index de5be725..6952246c 100644 --- a/src/internal/utils/StringUtils.cpp +++ b/src/internal/utils/StringUtils.cpp @@ -97,7 +97,7 @@ std::string utf16toUtf8String(std::int16_t in) noexcept { } } -std::string utf16toUtf8String(const std::u16string& in) noexcept { +std::string utf16toUtf8String(const std::u16string &in) noexcept { try { std::string out{}; @@ -110,7 +110,7 @@ std::string utf16toUtf8String(const std::u16string& in) noexcept { } } -std::string utf16toUtf8String(const std::vector& in) noexcept { +std::string utf16toUtf8String(const std::vector &in) noexcept { try { std::string out{};