Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MDAPI-159] [C++] Migrate to Graal SDK v1.2.0 #60

Merged
merged 5 commits into from
Nov 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ set(DXFCXX_VERSION "v3.0.0" CACHE STRING "The dxFeed Graal CXX API package versi

dxfcxx_ParseVersion(${DXFCXX_VERSION} DXFCXX_MAJOR_VERSION DXFCXX_MINOR_VERSION DXFCXX_PATCH_VERSION DXFCXX_SUFFIX_VERSION)

set(DXFEED_GRAAL_NATIVE_SDK_VERSION "1.1.23" CACHE STRING "")
set(DXFEED_GRAAL_NATIVE_SDK_VERSION "2.0.0" CACHE STRING "")
set(FMTLIB_VERSION "11.0.2")
set(BOOST_VERSION "1.84.0")
set(UTFCPP_VERSION "3.2.3")
Expand Down Expand Up @@ -223,6 +223,9 @@ set(dxFeedGraalCxxApi_Isolated_Sources
src/isolated/ipf/IsolatedInstrumentProfileReader.cpp
src/isolated/ipf/live/IsolatedInstrumentProfileCollector.cpp
src/isolated/ipf/live/IsolatedInstrumentProfileConnection.cpp
src/isolated/model/IsolatedTxModelListener.cpp
src/isolated/model/IsolatedIndexedTxModel.cpp
src/isolated/model/IsolatedTimeSeriesTxModel.cpp
src/isolated/ondemand/IsolatedOnDemandService.cpp
src/isolated/util/IsolatedTimePeriod.cpp
src/isolated/schedule/IsolatedDay.cpp
Expand Down
5 changes: 2 additions & 3 deletions DEPENDENCIES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Compile-time

- [dxFeed Graal Native SDK](https://github.com/dxFeed/dxfeed-graal-native-sdk) v1.1.23
- [dxFeed Graal Native SDK](https://github.com/dxFeed/dxfeed-graal-native-sdk) v2.0.0
- [Bundles](https://dxfeed.jfrog.io/artifactory/maven-open/com/dxfeed/graal-native-sdk/)
- \[opt] [Boost](https://github.com/boostorg/boost) v1.84.0
- Boost.Stacktrace 1.0
Expand All @@ -26,8 +26,7 @@
- addr2line \[opt] (Diagnostic backtraces)
## Run-time

- [dxFeed Graal Native SDK](https://github.com/dxFeed/dxfeed-graal-native-sdk) v1.1.23
- [Bundles](https://dxfeed.jfrog.io/artifactory/maven-open/com/dxfeed/graal-native-sdk/)
- [dxFeed Graal Native SDK](https://github.com/dxFeed/dxfeed-graal-native-sdk) v2.0.0
- [doctest](https://github.com/doctest/doctest) v2.4.11 (Tests)


Expand Down
2 changes: 1 addition & 1 deletion deps.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"date": "3.0.1",
"doctest": "2.4.11",
"fmt": "11.0.2",
"graal-native-sdk": "1.1.23",
"graal-native-sdk": "2.0.0",
"Process": "3.0.1",
"range-v3": "0.12",
"untfcpp": "3.2.3"
Expand Down
6 changes: 6 additions & 0 deletions include/dxfeed_graal_cpp_api/api.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ DXFCXX_DISABLE_MSC_WARNINGS_PUSH(4251 4996)
#include "symbols/StringSymbol.hpp"
#include "symbols/SymbolWrapper.hpp"
#include "system/System.hpp"
#include "model/TxModelListener.hpp"
#include "model/IndexedTxModel.hpp"
#include "model/TimeSeriesTxModel.hpp"

#include "exceptions/RuntimeException.hpp"
#include "exceptions/InvalidArgumentException.hpp"
Expand All @@ -72,6 +75,9 @@ DXFCXX_DISABLE_MSC_WARNINGS_PUSH(4251 4996)
#include "isolated/ipf/live/IsolatedInstrumentProfileCollector.hpp"
#include "isolated/ipf/live/IsolatedInstrumentProfileConnection.hpp"
#include "isolated/ipf/IsolatedInstrumentProfileReader.hpp"
#include "isolated/model/IsolatedTxModelListener.hpp"
#include "isolated/model/IsolatedIndexedTxModel.hpp"
#include "isolated/model/IsolatedTimeSeriesTxModel.hpp"
#include "isolated/ondemand/IsolatedOnDemandService.hpp"
#include "isolated/util/IsolatedTimePeriod.hpp"
#include "isolated/schedule/IsolatedDay.hpp"
Expand Down

Large diffs are not rendered by default.

101 changes: 101 additions & 0 deletions include/dxfeed_graal_cpp_api/isolated/model/IsolatedIndexedTxModel.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
// Copyright (c) 2024 Devexperts LLC.
// SPDX-License-Identifier: MPL-2.0

#pragma once

#include "../../internal/Conf.hpp"

#include "../../model/IndexedTxModel.hpp"
#include "../../model/TxModelListener.hpp"

#include <cstdint>
#include <type_traits>
#include <unordered_set>

DXFCXX_DISABLE_MSC_WARNINGS_PUSH(4251)

DXFCPP_BEGIN_NAMESPACE

class EventTypeEnum;
class IndexedEventSource;
struct DXFeed;
struct SymbolWrapper;

namespace isolated::model::IsolatedIndexedTxModel {

// dxfg_indexed_tx_model_builder_t* dxfg_IndexedTxModel_newBuilder(graal_isolatethread_t* thread, dxfg_event_clazz_t
// eventType);
JavaObjectHandle<IndexedTxModel::Builder> newBuilder(const EventTypeEnum &eventType);

// dxfg_indexed_event_source_list* dxfg_IndexedTxModel_getSources(graal_isolatethread_t* thread,
// dxfg_indexed_tx_model_t* source);
void *getSources(const JavaObjectHandle<IndexedTxModel> &model);

// int32_t dxfg_IndexedTxModel_setSources(graal_isolatethread_t* thread, dxfg_indexed_tx_model_t* source,
// dxfg_indexed_event_source_list* sources);
void setSources(const JavaObjectHandle<IndexedTxModel> &model, void *sources);

// int32_t dxfg_IndexedTxModel_isBatchProcessing(graal_isolatethread_t* thread, dxfg_indexed_tx_model_t* source);
bool isBatchProcessing(const JavaObjectHandle<IndexedTxModel> &model);

// int32_t dxfg_IndexedTxModel_isSnapshotProcessing(graal_isolatethread_t* thread, dxfg_indexed_tx_model_t* source);
bool isSnapshotProcessing(const JavaObjectHandle<IndexedTxModel> &model);

// int32_t dxfg_IndexedTxModel_attach(graal_isolatethread_t* thread, dxfg_indexed_tx_model_t* source, dxfg_feed_t*
// feed);
void attach(const JavaObjectHandle<IndexedTxModel> &model, const JavaObjectHandle<DXFeed> &feed);

// int32_t dxfg_IndexedTxModel_detach(graal_isolatethread_t* thread, dxfg_indexed_tx_model_t* source, dxfg_feed_t*
// feed);
void detach(const JavaObjectHandle<IndexedTxModel> &model, const JavaObjectHandle<DXFeed> &feed);

// int32_t dxfg_IndexedTxModel_close(graal_isolatethread_t* thread, dxfg_indexed_tx_model_t* source);
void close(const JavaObjectHandle<IndexedTxModel> &model);

namespace Builder {

// dxfg_indexed_tx_model_builder_t* dxfg_IndexedTxModel_Builder_withSources(graal_isolatethread_t* thread,
// dxfg_indexed_tx_model_builder_t* source, dxfg_indexed_event_source_list* sources);
JavaObjectHandle<IndexedTxModel::Builder> withSources(const JavaObjectHandle<IndexedTxModel::Builder> &builder,
void *sources);

// dxfg_indexed_tx_model_t* dxfg_IndexedTxModel_Builder_build(graal_isolatethread_t* thread,
// dxfg_indexed_tx_model_builder_t* source);
JavaObjectHandle<IndexedTxModel> build(const JavaObjectHandle<IndexedTxModel::Builder> &builder);

// dxfg_indexed_tx_model_builder_t* dxfg_IndexedTxModel_Builder_withBatchProcessing(graal_isolatethread_t* thread,
// dxfg_indexed_tx_model_builder_t* source, int32_t isBatchProcessing);
JavaObjectHandle<IndexedTxModel::Builder> withBatchProcessing(const JavaObjectHandle<IndexedTxModel::Builder> &builder,
bool isBatchProcessing);

// dxfg_indexed_tx_model_builder_t* dxfg_IndexedTxModel_Builder_withSnapshotProcessing(graal_isolatethread_t* thread,
// dxfg_indexed_tx_model_builder_t* source, int32_t isSnapshotProcessing);
JavaObjectHandle<IndexedTxModel::Builder>
withSnapshotProcessing(const JavaObjectHandle<IndexedTxModel::Builder> &builder, bool isSnapshotProcessing);

// dxfg_indexed_tx_model_builder_t* dxfg_IndexedTxModel_Builder_withFeed(graal_isolatethread_t* thread,
// dxfg_indexed_tx_model_builder_t* source, dxfg_feed_t* feed);
JavaObjectHandle<IndexedTxModel::Builder> withFeed(const JavaObjectHandle<IndexedTxModel::Builder> &builder,
const JavaObjectHandle<DXFeed> &feed);

// dxfg_indexed_tx_model_builder_t* dxfg_IndexedTxModel_Builder_withSymbol(graal_isolatethread_t* thread,
// dxfg_indexed_tx_model_builder_t* source, dxfg_symbol_t* symbol);
JavaObjectHandle<IndexedTxModel::Builder> withSymbol(const JavaObjectHandle<IndexedTxModel::Builder> &builder,
const SymbolWrapper &symbol);

// dxfg_indexed_tx_model_builder_t* dxfg_IndexedTxModel_Builder_withListener(graal_isolatethread_t* thread,
// dxfg_indexed_tx_model_builder_t* source, dxfg_tx_model_listener_t* listener);
JavaObjectHandle<IndexedTxModel::Builder> withListener(const JavaObjectHandle<IndexedTxModel::Builder> &builder,
const JavaObjectHandle<TxModelListener> &listener);

// dxfg_indexed_tx_model_builder_t* dxfg_IndexedTxModel_Builder_withExecutor(graal_isolatethread_t* thread,
// dxfg_indexed_tx_model_builder_t* source, dxfg_executor_t* executor);
JavaObjectHandle<IndexedTxModel::Builder> withExecutor(const JavaObjectHandle<IndexedTxModel::Builder> &builder,
void *executor);

} // namespace Builder
} // namespace isolated::model::IsolatedIndexedTxModel

DXFCPP_END_NAMESPACE

DXFCXX_DISABLE_MSC_WARNINGS_POP()
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
// Copyright (c) 2024 Devexperts LLC.
// SPDX-License-Identifier: MPL-2.0

#pragma once

#include "../../internal/Conf.hpp"

#include "../../model/TimeSeriesTxModel.hpp"
#include "../../model/TxModelListener.hpp"

#include <cstdint>
#include <string>
#include <vector>

DXFCXX_DISABLE_MSC_WARNINGS_PUSH(4251)

DXFCPP_BEGIN_NAMESPACE

class EventTypeEnum;
class IndexedEventSource;
struct DXFeed;
struct SymbolWrapper;

namespace isolated::model::IsolatedTimeSeriesTxModel {

// dxfg_time_series_tx_model_builder_t* dxfg_TimeSeriesTxModel_newBuilder(graal_isolatethread_t* thread,
// dxfg_event_clazz_t eventType);
JavaObjectHandle<TimeSeriesTxModel::Builder> newBuilder(const EventTypeEnum &eventType);

// int64_t dxfg_TimeSeriesTxModel_getFromTime(graal_isolatethread_t* thread, dxfg_time_series_tx_model_t* source);
std::int64_t getFromTime(const JavaObjectHandle<TimeSeriesTxModel> &model);

// int32_t dxfg_TimeSeriesTxModel_setFromTime(graal_isolatethread_t* thread, dxfg_time_series_tx_model_t* source,
// int64_t fromTime);
void setFromTime(const JavaObjectHandle<TimeSeriesTxModel> &model, std::int64_t fromTime);

// int32_t dxfg_TimeSeriesTxModel_isBatchProcessing(graal_isolatethread_t* thread, dxfg_time_series_tx_model_t* source);
bool isBatchProcessing(const JavaObjectHandle<TimeSeriesTxModel> &model);

// int32_t dxfg_TimeSeriesTxModel_isSnapshotProcessing(graal_isolatethread_t* thread, dxfg_time_series_tx_model_t*
// source);
bool isSnapshotProcessing(const JavaObjectHandle<TimeSeriesTxModel> &model);

// int32_t dxfg_TimeSeriesTxModel_attach(graal_isolatethread_t* thread, dxfg_time_series_tx_model_t* source,
// dxfg_feed_t* feed);
void attach(const JavaObjectHandle<TimeSeriesTxModel> &model, const JavaObjectHandle<DXFeed> &feed);

// int32_t dxfg_TimeSeriesTxModel_detach(graal_isolatethread_t* thread, dxfg_time_series_tx_model_t* source,
// dxfg_feed_t* feed);
void detach(const JavaObjectHandle<TimeSeriesTxModel> &model, const JavaObjectHandle<DXFeed> &feed);

// int32_t dxfg_TimeSeriesTxModel_close(graal_isolatethread_t* thread, dxfg_time_series_tx_model_t* source);
void close(const JavaObjectHandle<TimeSeriesTxModel> &model);

namespace Builder {

// dxfg_time_series_tx_model_builder_t* dxfg_TimeSeriesTxModel_Builder_withFromTime(graal_isolatethread_t* thread,
// dxfg_time_series_tx_model_builder_t* source, int64_t fromTime);
JavaObjectHandle<TimeSeriesTxModel::Builder> withFromTime(const JavaObjectHandle<TimeSeriesTxModel::Builder> &builder,
std::int64_t fromTime);

// dxfg_time_series_tx_model_t* dxfg_TimeSeriesTxModel_Builder_build(graal_isolatethread_t* thread,
// dxfg_time_series_tx_model_builder_t* source);
JavaObjectHandle<TimeSeriesTxModel> build(const JavaObjectHandle<TimeSeriesTxModel::Builder> &builder);

// dxfg_time_series_tx_model_builder_t* dxfg_TimeSeriesTxModel_Builder_withBatchProcessing(graal_isolatethread_t*
// thread, dxfg_time_series_tx_model_builder_t* source, int32_t isBatchProcessing);
JavaObjectHandle<TimeSeriesTxModel::Builder>
withBatchProcessing(const JavaObjectHandle<TimeSeriesTxModel::Builder> &builder, bool isBatchProcessing);

// dxfg_time_series_tx_model_builder_t* dxfg_TimeSeriesTxModel_Builder_withSnapshotProcessing(graal_isolatethread_t*
// thread, dxfg_time_series_tx_model_builder_t* source, int32_t isSnapshotProcessing);
JavaObjectHandle<TimeSeriesTxModel::Builder>
withSnapshotProcessing(const JavaObjectHandle<TimeSeriesTxModel::Builder> &builder, bool isSnapshotProcessing);

// dxfg_time_series_tx_model_builder_t* dxfg_TimeSeriesTxModel_Builder_withFeed(graal_isolatethread_t* thread,
// dxfg_time_series_tx_model_builder_t* source, dxfg_feed_t* feed);
JavaObjectHandle<TimeSeriesTxModel::Builder> withFeed(const JavaObjectHandle<TimeSeriesTxModel::Builder> &builder,
const JavaObjectHandle<DXFeed> &feed);

// dxfg_time_series_tx_model_builder_t* dxfg_TimeSeriesTxModel_Builder_withSymbol(graal_isolatethread_t* thread,
// dxfg_time_series_tx_model_builder_t* source, dxfg_symbol_t* symbol);
JavaObjectHandle<TimeSeriesTxModel::Builder> withSymbol(const JavaObjectHandle<TimeSeriesTxModel::Builder> &builder,
const SymbolWrapper &symbol);

// dxfg_time_series_tx_model_builder_t* dxfg_TimeSeriesTxModel_Builder_withListener(graal_isolatethread_t* thread,
// dxfg_time_series_tx_model_builder_t* source, dxfg_tx_model_listener_t* listener);
JavaObjectHandle<TimeSeriesTxModel::Builder> withListener(const JavaObjectHandle<TimeSeriesTxModel::Builder> &builder,
const JavaObjectHandle<TxModelListener> &listener);

// dxfg_time_series_tx_model_builder_t* dxfg_TimeSeriesTxModel_Builder_withExecutor(graal_isolatethread_t* thread,
// dxfg_time_series_tx_model_builder_t* source, dxfg_executor_t* executor);
JavaObjectHandle<TimeSeriesTxModel::Builder> withExecutor(const JavaObjectHandle<TimeSeriesTxModel::Builder> &builder,
void *executor);

} // namespace Builder
} // namespace isolated::model::IsolatedTimeSeriesTxModel

DXFCPP_END_NAMESPACE

DXFCXX_DISABLE_MSC_WARNINGS_POP()
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// Copyright (c) 2024 Devexperts LLC.
// SPDX-License-Identifier: MPL-2.0

#pragma once

#include "../../internal/Conf.hpp"

#include "../../model/TxModelListener.hpp"

#include <cstdint>
#include <string>
#include <vector>

DXFCXX_DISABLE_MSC_WARNINGS_PUSH(4251)

DXFCPP_BEGIN_NAMESPACE

namespace isolated::model::IsolatedTxModelListener {

// typedef void (*dxfg_TxModelListener_function_eventsReceived)(graal_isolatethread_t* thread, dxfg_indexed_event_source_t* source, dxfg_event_type_list* events, int32_t /* boolean */ isSnapshot, void* user_data);

// dxfg_tx_model_listener_t* dxfg_TxModelListener_new(graal_isolatethread_t* thread, dxfg_TxModelListener_function_eventsReceived function_eventsReceived, void* user_data);
JavaObjectHandle<TxModelListener> create(void* functionEventsReceived, void* userData);

}

DXFCPP_END_NAMESPACE

DXFCXX_DISABLE_MSC_WARNINGS_POP()
23 changes: 23 additions & 0 deletions include/dxfeed_graal_cpp_api/model/IndexedTxModel.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// 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 "../entity/SharedEntity.hpp"

#include <memory>
#include <unordered_set>

DXFCPP_BEGIN_NAMESPACE

struct DXFCPP_EXPORT IndexedTxModel {

struct DXFCPP_EXPORT Builder {};
};

DXFCPP_END_NAMESPACE
23 changes: 23 additions & 0 deletions include/dxfeed_graal_cpp_api/model/TimeSeriesTxModel.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// 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 "../entity/SharedEntity.hpp"

#include <memory>
#include <unordered_set>

DXFCPP_BEGIN_NAMESPACE

struct DXFCPP_EXPORT TimeSeriesTxModel {

struct DXFCPP_EXPORT Builder {};
};

DXFCPP_END_NAMESPACE
22 changes: 22 additions & 0 deletions include/dxfeed_graal_cpp_api/model/TxModelListener.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// 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 "../entity/SharedEntity.hpp"

#include <memory>
#include <unordered_set>

DXFCPP_BEGIN_NAMESPACE

struct DXFCPP_EXPORT TxModelListener {

};

DXFCPP_END_NAMESPACE
5 changes: 5 additions & 0 deletions src/internal/JavaObjectHandle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,5 +92,10 @@ template struct JavaObjectHandle<TimePeriod>;

template struct JavaObjectHandle<AuthToken>;

template struct JavaObjectHandle<TxModelListener>;
template struct JavaObjectHandle<IndexedTxModel>;
template struct JavaObjectHandle<IndexedTxModel::Builder>;
template struct JavaObjectHandle<TimeSeriesTxModel>;
template struct JavaObjectHandle<TimeSeriesTxModel::Builder>;

DXFCPP_END_NAMESPACE
Loading