-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[EN-7588] Implement PublishProfiles sample
- Loading branch information
Showing
34 changed files
with
985 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
include/dxfeed_graal_cpp_api/api/DXPublisherObservableSubscription.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
// Copyright (c) 2024 Devexperts LLC. | ||
// SPDX-License-Identifier: MPL-2.0 | ||
|
||
#pragma once | ||
|
||
#include "../internal/Conf.hpp" | ||
|
||
DXFCXX_DISABLE_MSC_WARNINGS_PUSH(4251) | ||
|
||
#include "../entity/EntityModule.hpp" | ||
#include "../event/EventTypeEnum.hpp" | ||
#include "../internal/JavaObjectHandle.hpp" | ||
#include "osub/ObservableSubscription.hpp" | ||
|
||
#include <memory> | ||
#include <unordered_set> | ||
|
||
DXFCPP_BEGIN_NAMESPACE | ||
|
||
struct DXFCPP_EXPORT DXPublisherObservableSubscription : RequireMakeShared<DXPublisherObservableSubscription>, | ||
ObservableSubscription { | ||
static constexpr std::size_t FAKE_LISTENER_ID{static_cast<std::size_t>(-1)}; | ||
|
||
private: | ||
inline static std::atomic<std::size_t> lastListenerId_{}; | ||
|
||
JavaObjectHandle<DXPublisherObservableSubscription> handle_; | ||
std::unordered_map<std::size_t, std::shared_ptr<ObservableSubscriptionChangeListener>> listeners_; | ||
std::recursive_mutex listenersMutex_{}; | ||
|
||
public: | ||
DXPublisherObservableSubscription(LockExternalConstructionTag, | ||
JavaObjectHandle<DXPublisherObservableSubscription> &&handle); | ||
~DXPublisherObservableSubscription() override; | ||
|
||
static std::shared_ptr<DXPublisherObservableSubscription> | ||
create(JavaObjectHandle<DXPublisherObservableSubscription> &&handle); | ||
|
||
bool isClosed() override; | ||
std::unordered_set<EventTypeEnum> getEventTypes() override; | ||
bool containsEventType(const EventTypeEnum &eventType) override; | ||
std::size_t addChangeListener(std::shared_ptr<ObservableSubscriptionChangeListener> listener) override; | ||
void removeChangeListener(std::size_t id) override; | ||
}; | ||
|
||
DXFCPP_END_NAMESPACE | ||
|
||
DXFCXX_DISABLE_MSC_WARNINGS_POP() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
include/dxfeed_graal_cpp_api/api/osub/ObservableSubscriptionChangeListener.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
// Copyright (c) 2024 Devexperts LLC. | ||
// SPDX-License-Identifier: MPL-2.0 | ||
|
||
#pragma once | ||
|
||
#include "../../internal/Conf.hpp" | ||
|
||
DXFCXX_DISABLE_MSC_WARNINGS_PUSH(4251) | ||
|
||
#include "../../symbols/SymbolWrapper.hpp" | ||
|
||
#include <memory> | ||
#include <unordered_set> | ||
|
||
DXFCPP_BEGIN_NAMESPACE | ||
|
||
struct DXFCPP_EXPORT ObservableSubscriptionChangeListener : RequireMakeShared<ObservableSubscriptionChangeListener> { | ||
explicit ObservableSubscriptionChangeListener(LockExternalConstructionTag); | ||
~ObservableSubscriptionChangeListener() noexcept override; | ||
|
||
static std::shared_ptr<ObservableSubscriptionChangeListener> | ||
create(std::function<void(const std::unordered_set<SymbolWrapper> &symbols)> onSymbolsAdded); | ||
|
||
static std::shared_ptr<ObservableSubscriptionChangeListener> | ||
create(std::function<void(const std::unordered_set<SymbolWrapper> &symbols)> onSymbolsAdded, | ||
std::function<void(const std::unordered_set<SymbolWrapper> &symbols)> onSymbolsRemoved, | ||
std::function<void()> onSubscriptionClosed); | ||
|
||
const JavaObjectHandle<ObservableSubscriptionChangeListener> &getHandle() const; | ||
|
||
private: | ||
mutable std::recursive_mutex mutex_{}; | ||
JavaObjectHandle<ObservableSubscriptionChangeListener> handle_; | ||
SimpleHandler<void(const std::unordered_set<SymbolWrapper> &symbols)> onSymbolsAdded_{}; | ||
SimpleHandler<void(const std::unordered_set<SymbolWrapper> &symbols)> onSymbolsRemoved_{}; | ||
SimpleHandler<void()> onSubscriptionClosed_{}; | ||
|
||
struct Impl; | ||
|
||
std::unique_ptr<Impl> impl_; | ||
}; | ||
|
||
DXFCPP_END_NAMESPACE | ||
|
||
DXFCXX_DISABLE_MSC_WARNINGS_POP() |
Oops, something went wrong.