diff --git a/DEPENDENCIES.md b/DEPENDENCIES.md index b3f352268..875162037 100644 --- a/DEPENDENCIES.md +++ b/DEPENDENCIES.md @@ -2,7 +2,7 @@ ## Compile-time -- [dxFeed Graal Native SDK](https://github.com/dxFeed/dxfeed-graal-native-sdk) v1.1.16 +- [dxFeed Graal Native SDK](https://github.com/dxFeed/dxfeed-graal-native-sdk) v1.1.21 - [Boost](https://github.com/boostorg/boost) v1.84.0 - Boost.Stacktrace 1.0 - [utfcpp](https://github.com/nemtrif/utfcpp) v3.2.3 diff --git a/include/dxfeed_graal_cpp_api/api/DXFeed.hpp b/include/dxfeed_graal_cpp_api/api/DXFeed.hpp index acce0eae5..6e77b835d 100644 --- a/include/dxfeed_graal_cpp_api/api/DXFeed.hpp +++ b/include/dxfeed_graal_cpp_api/api/DXFeed.hpp @@ -300,6 +300,7 @@ struct DXFCPP_EXPORT DXFeed : SharedEntity { /** * Requests time series of events for the specified event type, symbol, and a range of time. + * * @tparam E The type of event. * @param symbol The symbol. * @param fromTime The time, inclusive, to request events from (see TimeSeriesEvent::getTime()). diff --git a/include/dxfeed_graal_cpp_api/isolated/Isolated.hpp b/include/dxfeed_graal_cpp_api/isolated/Isolated.hpp index cd471eb0a..0e5d016d4 100644 --- a/include/dxfeed_graal_cpp_api/isolated/Isolated.hpp +++ b/include/dxfeed_graal_cpp_api/isolated/Isolated.hpp @@ -23,12 +23,6 @@ DXFCPP_BEGIN_NAMESPACE namespace isolated { -struct Tools { - static std::unordered_set /* dxfg_string_list* */ parseSymbols(std::string_view symbolList); - - static void /* int32_t */ runTool(/* dxfg_string_list* */ const std::vector& args); -}; - namespace ipf { struct InstrumentProfileReader { static /* dxfg_instrument_profile_reader_t* */ JavaObjectHandle create(); diff --git a/include/dxfeed_graal_cpp_api/isolated/internal/IsolatedTools.hpp b/include/dxfeed_graal_cpp_api/isolated/internal/IsolatedTools.hpp index e15245a0c..3bcc478da 100644 --- a/include/dxfeed_graal_cpp_api/isolated/internal/IsolatedTools.hpp +++ b/include/dxfeed_graal_cpp_api/isolated/internal/IsolatedTools.hpp @@ -15,12 +15,26 @@ DXFCPP_BEGIN_NAMESPACE namespace isolated::internal::IsolatedTools { +/** + * Calls the Graal SDK function `dxfg_Tools_parseSymbols` in isolation. + * + * @param symbolList The symbol list + * @return parsed symbols. + * @throws JavaException if something happened with the dxFeed API backend. + * @throws GraalException if something happened with the GraalVM. + */ std::unordered_set /* dxfg_string_list* */ parseSymbols(std::string_view symbolList); -void /* int32_t */ runTool(/* dxfg_string_list* */ const std::vector& args); - -} +/** + * Calls the Graal SDK function `dxfg_Tools_main` in isolation. + * + * @param args The tool's arguments + * @throws JavaException if something happened with the dxFeed API backend. + * @throws GraalException if something happened with the GraalVM. + */ +void /* int32_t */ runTool(/* dxfg_string_list* */ const std::vector &args); +} // namespace isolated::internal::IsolatedTools DXFCPP_END_NAMESPACE diff --git a/src/internal/Isolate.cpp b/src/internal/Isolate.cpp index 7ede41b8a..d3971cf97 100644 --- a/src/internal/Isolate.cpp +++ b/src/internal/Isolate.cpp @@ -154,29 +154,8 @@ constexpr auto runGraalFunction(auto resultCheckerConverter, auto graalFunction, defaultValue, resultCheckerConverter, graalFunction, params...); } -std::unordered_set /* dxfg_string_list* */ -Tools::parseSymbols(std::string_view symbolList) { - std::unordered_set result{}; - - auto graalStringList = runGraalFunctionAndThrowIfNullptr(dxfg_Tools_parseSymbols, symbolList.data()); - - for (auto i = 0; i < graalStringList->size; i++) { - result.emplace(dxfcpp::toString(graalStringList->elements[i])); - } - - isolated::internal::IsolatedStringList::release(graalStringList); - - return result; -} - using NativeStringList = typename isolated::internal::NativeStringListWrapper; -void /* int32_t */ Tools::runTool(/* dxfg_string_list* */ const std::vector &args) { - NativeStringList l{args}; - - runGraalFunctionAndThrowIfLessThanZero(dxfg_Tools_main, l.list); -} - namespace ipf { /* dxfg_instrument_profile_reader_t* */ dxfcpp::JavaObjectHandle diff --git a/src/internal/utils/CmdArgsUtils.cpp b/src/internal/utils/CmdArgsUtils.cpp index 9d43a0384..bed73cb00 100644 --- a/src/internal/utils/CmdArgsUtils.cpp +++ b/src/internal/utils/CmdArgsUtils.cpp @@ -131,7 +131,7 @@ std::unordered_set CmdArgsUtils::parseSymbols(const std::string & return {}; } - auto parsed = isolated::Tools::parseSymbols(trimmedSymbols); + auto parsed = isolated::internal::IsolatedTools::parseSymbols(trimmedSymbols); if (parsed.contains("*") || parsed.contains("all") || parsed.contains("All") || parsed.contains("ALL")) { return {WildcardSymbol::ALL}; @@ -155,7 +155,7 @@ std::unordered_set CmdArgsUtils::parseCandleSymbols(const std::str return {}; } - auto parsed = isolated::Tools::parseSymbols(trimmedSymbols); + auto parsed = isolated::internal::IsolatedTools::parseSymbols(trimmedSymbols); return parsed | ranges::views::transform([](auto &&s) { return CandleSymbol::valueOf(s); diff --git a/src/isolated/internal/IsolatedTools.cpp b/src/isolated/internal/IsolatedTools.cpp index b9e613213..4126a73e4 100644 --- a/src/isolated/internal/IsolatedTools.cpp +++ b/src/isolated/internal/IsolatedTools.cpp @@ -4,11 +4,34 @@ #include #include +#include #include DXFCPP_BEGIN_NAMESPACE namespace isolated::internal::IsolatedTools { +std::unordered_set /* dxfg_string_list* */ +parseSymbols(std::string_view symbolList) { + std::unordered_set result{}; + + auto graalStringList = runGraalFunctionAndThrowIfNullptr(dxfg_Tools_parseSymbols, symbolList.data()); + + for (auto i = 0; i < graalStringList->size; i++) { + result.emplace(dxfcpp::toString(graalStringList->elements[i])); + } + + IsolatedStringList::release(graalStringList); + + return result; +} + +using NativeStringList = NativeStringListWrapper; + +void /* int32_t */ runTool(/* dxfg_string_list* */ const std::vector &args) { + NativeStringList l{args}; + + runGraalFunctionAndThrowIfLessThanZero(dxfg_Tools_main, l.list); } +} // namespace isolated::internal::IsolatedTools DXFCPP_END_NAMESPACE \ No newline at end of file diff --git a/tools/Tools/src/Qds/QdsTool.hpp b/tools/Tools/src/Qds/QdsTool.hpp index 56c9dacac..2ce3fc789 100644 --- a/tools/Tools/src/Qds/QdsTool.hpp +++ b/tools/Tools/src/Qds/QdsTool.hpp @@ -77,7 +77,7 @@ struct QdsTool { auto parsedProperties = CmdArgsUtils::parseProperties(args.properties); System::setProperties(parsedProperties); - dxfcpp::isolated::Tools::runTool(qdsArgs); + dxfcpp::isolated::internal::IsolatedTools::runTool(qdsArgs); } };