Skip to content

Commit

Permalink
Fix dynamic linking by VS
Browse files Browse the repository at this point in the history
  • Loading branch information
AnatolyKalin committed Aug 31, 2023
1 parent d049b89 commit 6c1d14b
Show file tree
Hide file tree
Showing 59 changed files with 252 additions and 244 deletions.
4 changes: 2 additions & 2 deletions include/dxfeed_graal_cpp_api/api/ApiModule.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
#include "FilteredSubscriptionSymbol.hpp"
#include "osub/OsubModule.hpp"
71 changes: 35 additions & 36 deletions include/dxfeed_graal_cpp_api/api/DXEndpoint.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand All @@ -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 (<b>this is a default role</b>).
* 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:
* - <b>`DXEndpoint::create()->connect("demo.dxfeed.com:7300")->getFeed()`</b> returns a demo feed from dxFeed with
* sample market quotes.
* - <b>`DXEndpoint::create()->connect("localhost:7400")->getFeed()`</b> returns a feed that is connected to a
Expand All @@ -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();
Expand All @@ -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: <b>`DXEndpoint->create(DXEndpoint::Role::PUBLISHER)->connect(":7400")->getPublisher()`</b>
* 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:
* <b>`DXEndpoint->create(DXEndpoint::Role::PUBLISHER)->connect(":7400")->getPublisher()`</b> 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.
*
* <h3>Endpoint state</h3>
*
Expand All @@ -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.
*
* <h3>Event times</h3>
*
* 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.
*
* <h3><a name="defaultPropertiesSection">Default properties</a></h3>
*
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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
* <a href="#defaultPropertiesSection">default properties</a>, 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 <a href="#defaultPropertiesSection">default
* properties</a>, 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().
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.
*
* <p> The address string is provided with the market data vendor agreement.
* Use "demo.dxfeed.com:7300" for a demo quote feed.
Expand Down
22 changes: 13 additions & 9 deletions include/dxfeed_graal_cpp_api/api/DXFeed.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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:
* <pre><tt>
* 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"<Quote>([](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");</tt></pre>
*
* 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.
*
* <h4>Subscribe for multiple event types</h4>
*
* The following code creates listener that prints each received event and
* subscribes for quotes and trades on SPDR S&P 500 ETF symbol:
* <pre><tt>
* 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) {
Expand All @@ -89,7 +93,8 @@ class EventTypeEnum;
* <pre><tt>
* 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");
*
Expand Down Expand Up @@ -271,8 +276,7 @@ struct DXFCPP_EXPORT DXFeed : SharedEntity {
* @return The new subscription
*/
template <typename EventTypesCollection>
std::shared_ptr<DXFeedSubscription> createSubscription(EventTypesCollection &&eventTypes) noexcept
{
std::shared_ptr<DXFeedSubscription> createSubscription(EventTypesCollection &&eventTypes) noexcept {
if constexpr (Debugger::isDebug) {
Debugger::debug(toString() + "::createSubscription(eventTypes = " +
namesToString(std::begin(eventTypes), std::end(eventTypes)) + ")");
Expand Down
16 changes: 8 additions & 8 deletions include/dxfeed_graal_cpp_api/api/DXFeedSubscription.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down Expand Up @@ -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.
*
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
9 changes: 4 additions & 5 deletions include/dxfeed_graal_cpp_api/api/DXPublisher.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);</tt></pre>
* @ref DXPublisher "DXPublisher"::@ref DXPublisher::getInstance() "getInstance"()->@ref DXPublisher::publishEvents()
* "publishEvents"(quote);</tt></pre>
*
* <h3>Threads and locks</h3>
*
Expand Down Expand Up @@ -87,7 +88,6 @@ struct DXFCPP_EXPORT DXPublisher : SharedEntity {
*/
static std::shared_ptr<DXPublisher> 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
Expand Down Expand Up @@ -170,8 +170,7 @@ struct DXFCPP_EXPORT DXPublisher : SharedEntity {
#endif
{
this->template publishEvents<decltype(std::begin(std::forward<EventsCollection>(events)))>(
std::begin(std::forward<EventsCollection>(events)),
std::end(std::forward<EventsCollection>(events)));
std::begin(std::forward<EventsCollection>(events)), std::end(std::forward<EventsCollection>(events)));
}

/**
Expand Down Expand Up @@ -210,7 +209,7 @@ struct DXFCPP_EXPORT DXPublisher : SharedEntity {
EventMapper::freeGraalList(list);
}

std::shared_ptr<ObservableSubscription> getSubscription(const EventTypeEnum&);
std::shared_ptr<ObservableSubscription> getSubscription(const EventTypeEnum &);

std::string toString() const noexcept override;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ namespace dxfcpp {

class ObservableSubscription {};

}
} // namespace dxfcpp
Loading

0 comments on commit 6c1d14b

Please sign in to comment.