diff --git a/include/dxfeed_graal_cpp_api/api/DXPublisherObservableSubscription.hpp b/include/dxfeed_graal_cpp_api/api/DXPublisherObservableSubscription.hpp index 1c584e4e..e1beeac3 100644 --- a/include/dxfeed_graal_cpp_api/api/DXPublisherObservableSubscription.hpp +++ b/include/dxfeed_graal_cpp_api/api/DXPublisherObservableSubscription.hpp @@ -27,6 +27,8 @@ DXFCXX_DISABLE_MSC_WARNINGS_PUSH(4251) DXFCPP_BEGIN_NAMESPACE class DXFCPP_EXPORT DXPublisherObservableSubscription : public ObservableSubscription, public SharedEntity { + JavaObjectHandle handle_; + public: bool isClosed() override; std::unordered_set getEventTypes() override; diff --git a/include/dxfeed_graal_cpp_api/isolated/api/IsolatedDXPublisherObservableSubscription.hpp b/include/dxfeed_graal_cpp_api/isolated/api/IsolatedDXPublisherObservableSubscription.hpp new file mode 100644 index 00000000..a4d522c6 --- /dev/null +++ b/include/dxfeed_graal_cpp_api/isolated/api/IsolatedDXPublisherObservableSubscription.hpp @@ -0,0 +1,47 @@ +// Copyright (c) 2024 Devexperts LLC. +// SPDX-License-Identifier: MPL-2.0 + +#pragma once + +#include "../../internal/Conf.hpp" + +#include + +DXFCXX_DISABLE_MSC_WARNINGS_PUSH(4251) + +#include "../../api/DXPublisherObservableSubscription.hpp" + +DXFCPP_BEGIN_NAMESPACE + +namespace isolated::api::IsolatedDXPublisherObservableSubscription { +/** + * Calls the Graal SDK function `dxfg_ObservableSubscription_isClosed` in isolation. + * + * @param sub The subscription's handle. + * @return Returns `true` if this subscription is closed. + * @throws std::invalid_argument if DXPublisherObservableSubscription's handle is invalid. + * @throws JavaException if something happened with the dxFeed API backend. + * @throws GraalException if something happened with the GraalVM. + */ +bool /* int32_t */ +isClosed(/* dxfg_observable_subscription_t * */ const JavaObjectHandle &sub); + + +std::unordered_set /* dxfg_event_clazz_list_t* */ getEventTypes( + /* dxfg_observable_subscription_t * */ const JavaObjectHandle &sub); +bool /* int32_t */ containsEventType( + /* dxfg_observable_subscription_t * */ const JavaObjectHandle &sub, + /* dxfg_event_clazz_t */ EventTypeEnum eventType); +void /* int32_t */ addChangeListener( + /* dxfg_observable_subscription_t * */ const JavaObjectHandle &sub, + /* dxfg_observable_subscription_change_listener_t * */ const JavaObjectHandle + &listener); +void /* int32_t */ removeChangeListener( + /* dxfg_observable_subscription_t * */ const JavaObjectHandle &sub, + /* dxfg_observable_subscription_change_listener_t * */ const JavaObjectHandle + &listener); +} // namespace isolated::api::IsolatedDXPublisherObservableSubscription + +DXFCPP_END_NAMESPACE + +DXFCXX_DISABLE_MSC_WARNINGS_POP() \ No newline at end of file diff --git a/src/internal/JavaObjectHandle.cpp b/src/internal/JavaObjectHandle.cpp index 4634632f..21893ddc 100644 --- a/src/internal/JavaObjectHandle.cpp +++ b/src/internal/JavaObjectHandle.cpp @@ -57,5 +57,6 @@ template struct JavaObjectHandle; template struct JavaObjectHandle; template struct JavaObjectHandle; +template struct JavaObjectHandle; DXFCPP_END_NAMESPACE \ No newline at end of file