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

[DXFC-402] Implement adding multiple symbols and removing symbols. #7

Merged
merged 26 commits into from
May 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
3ba39ee
[DXFC-402] Implement adding multiple symbols and removing symbols.
May 19, 2023
db84275
[DXFC-402] Implement adding multiple symbols and removing symbols
May 22, 2023
fa70e60
[DXFC-402] Implement adding multiple symbols and removing symbols
May 22, 2023
3c10ed7
[DXFC-402] Implement adding multiple symbols and removing symbols
May 22, 2023
e5ddf29
[DXFC-402] Implement adding multiple symbols and removing symbols
May 23, 2023
9ee553d
[DXFC-402] Implement adding multiple symbols and removing symbols
May 24, 2023
706800f
[DXFC-402] Implement adding multiple symbols and removing symbols
May 24, 2023
dfc1219
[DXFC-402] Implement adding multiple symbols and removing symbols
May 24, 2023
78eca87
[DXFC-402] Implement adding multiple symbols and removing symbols
May 24, 2023
f0d06fc
[DXFC-402] Implement adding multiple symbols and removing symbols
May 24, 2023
cef9b89
[DXFC-402] Implement adding multiple symbols and removing symbols
May 25, 2023
cb4580d
[DXFC-402] Implement adding multiple symbols and removing symbols
May 25, 2023
ce4cb2d
[DXFC-402] Implement adding multiple symbols and removing symbols
May 25, 2023
2955594
[DXFC-402] Implement adding multiple symbols and removing symbols
May 26, 2023
8de20f4
[DXFC-402] Implement adding multiple symbols and removing symbols
May 26, 2023
c309b65
[DXFC-402] Implement adding multiple symbols and removing symbols
May 26, 2023
8401c69
[DXFC-402] Implement adding multiple symbols and removing symbols
May 26, 2023
329bb36
StringSymbol list (#8)
ttldtor May 29, 2023
8dc09ff
[DXFC-402] Implement adding multiple symbols and removing symbols
May 29, 2023
ee41c1d
[DXFC-402] Implement adding multiple symbols and removing symbols
May 29, 2023
327e83f
[DXFC-402] Implement adding multiple symbols and removing symbols
May 29, 2023
e4c69b1
[DXFC-402] Implement adding multiple symbols and removing symbols
May 29, 2023
6c649d9
[DXFC-402] Implement adding multiple symbols and removing symbols
May 29, 2023
48a7d65
[DXFC-402] Implement adding multiple symbols and removing symbols
May 30, 2023
aae4076
[DXFC-402] Implement adding multiple symbols and removing symbols
May 30, 2023
1020f32
[DXFC-402] Implement adding multiple symbols and removing symbols
May 30, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,6 @@ cmake-build-*/
.idea/
/doc/html/
/doc/latex/

.PVS-Studio/
*.PVS-Studio.*
79 changes: 52 additions & 27 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,76 +10,90 @@ set(CMAKE_C_STANDARD 11)

cmake_policy(SET CMP0135 NEW)

if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
set(DXFC_IS_ROOT_PROJECT ON)
else()
else ()
set(DXFC_ROOT_PROJECT OFF)
endif()
endif ()

option(DXFC_BUILD_UNIT_TESTS "" ON)

option(DXFC_USE_DXFEED_GRAAL_NATIVE_API_GITHUB "" OFF)
set(DXFEED_GRAAL_NATIVE_API_GITHUB_VERSION "v1.0.5" CACHE STRING "")
set(DXFEED_GRAAL_NATIVE_API_GITHUB_ARCHIVE_VERSION "1.0.0" CACHE STRING "")
set(DXFEED_GRAAL_NATIVE_API_GITHUB_BASE_URL "https://github.com/ttldtor/dxfeed-graal-native-api/releases/download/" CACHE STRING "")

option(DXFC_USE_DXFEED_GRAAL_NATIVE_API_JFROG "" ON)
set(DXFEED_GRAAL_NATIVE_API_VERSION "0.4.0" CACHE STRING "")
set(DXFEED_GRAAL_NATIVE_API_JFROG_BASE_URL "https://dxfeed.jfrog.io/artifactory/maven-open/com/dxfeed/graal-native-api/" CACHE STRING "")
option(DXFC_USE_DXFEED_GRAAL_NATIVE_SDK_JFROG "" ON)
set(DXFEED_GRAAL_NATIVE_SDK_VERSION "1.0.0" CACHE STRING "")
set(DXFEED_GRAAL_NATIVE_SDK_JFROG_BASE_URL "https://dxfeed.jfrog.io/artifactory/maven-open/com/dxfeed/graal-native-sdk/" CACHE STRING "")

include(FetchContent)

if (DEFINED ENV{DXFEED_GRAAL_NATIVE_API_URL})
FetchContent_Declare(DxFeedGraalNativeApi URL $ENV{DXFEED_GRAAL_NATIVE_API_URL})
if (DEFINED ENV{DXFEED_GRAAL_NATIVE_SDK_URL})
FetchContent_Declare(DxFeedGraalNativeSdk URL $ENV{DXFEED_GRAAL_NATIVE_SDK_URL})
else ()
if (DXFC_USE_DXFEED_GRAAL_NATIVE_API_GITHUB)
set(DXFEED_GRAAL_NATIVE_API_URL "${DXFEED_GRAAL_NATIVE_API_GITHUB_BASE_URL}${DXFEED_GRAAL_NATIVE_API_GITHUB_VERSION}/dxfeed-graal-native-api-${DXFEED_GRAAL_NATIVE_API_GITHUB_ARCHIVE_VERSION}")
elseif (DXFC_USE_DXFEED_GRAAL_NATIVE_API_JFROG)
set(DXFEED_GRAAL_NATIVE_API_URL "${DXFEED_GRAAL_NATIVE_API_JFROG_BASE_URL}${DXFEED_GRAAL_NATIVE_API_VERSION}/graal-native-api-${DXFEED_GRAAL_NATIVE_API_VERSION}")
if (DXFC_USE_DXFEED_GRAAL_NATIVE_SDK_JFROG)
set(DXFEED_GRAAL_NATIVE_SDK_URL "${DXFEED_GRAAL_NATIVE_SDK_JFROG_BASE_URL}${DXFEED_GRAAL_NATIVE_SDK_VERSION}/graal-native-sdk-${DXFEED_GRAAL_NATIVE_SDK_VERSION}")
endif ()

if (WIN32)
set(DXFEED_GRAAL_NATIVE_API_URL ${DXFEED_GRAAL_NATIVE_API_URL}-amd64-windows.zip)
set(DXFEED_GRAAL_NATIVE_SDK_URL ${DXFEED_GRAAL_NATIVE_SDK_URL}-amd64-windows.zip)
elseif (APPLE)
if (${CMAKE_HOST_SYSTEM_PROCESSOR} STREQUAL "arm64")
set(DXFEED_GRAAL_NATIVE_API_URL ${DXFEED_GRAAL_NATIVE_API_URL}-aarch64-osx.zip)
set(DXFEED_GRAAL_NATIVE_SDK_URL ${DXFEED_GRAAL_NATIVE_SDK_URL}-aarch64-osx.zip)
else ()
set(DXFEED_GRAAL_NATIVE_API_URL ${DXFEED_GRAAL_NATIVE_API_URL}-x86_64-osx.zip)
set(DXFEED_GRAAL_NATIVE_SDK_URL ${DXFEED_GRAAL_NATIVE_SDK_URL}-x86_64-osx.zip)
endif ()
elseif (UNIX)
set(DXFEED_GRAAL_NATIVE_API_URL ${DXFEED_GRAAL_NATIVE_API_URL}-amd64-linux.zip)
set(DXFEED_GRAAL_NATIVE_SDK_URL ${DXFEED_GRAAL_NATIVE_SDK_URL}-amd64-linux.zip)
else ()
message(ERROR "Unknown platform!")
endif ()

FetchContent_Declare(DxFeedGraalNativeApi URL ${DXFEED_GRAAL_NATIVE_API_URL})
FetchContent_Declare(DxFeedGraalNativeSdk URL ${DXFEED_GRAAL_NATIVE_SDK_URL})
endif ()

FetchContent_MakeAvailable(DxFeedGraalNativeApi)
# DxFeedGraalNativeApi_SOURCE_DIR
FetchContent_MakeAvailable(DxFeedGraalNativeSdk)
# DxFeedGraalNativeSdk_SOURCE_DIR

if (DXFC_USE_CONAN)
include(${CMAKE_BINARY_DIR}/conan_paths.cmake)
endif ()

add_subdirectory(third_party/utfcpp-3.2.3)
add_subdirectory(third_party/fmt-9.1.0)
add_subdirectory(third_party/fmt-10.0.0)

# find_package(utf8cpp)
# find_package(fmt)

set(dxFeedNativeAPIInternalSources
src/internal/CEntryPointErrors.cpp
src/internal/Isolate.cpp
src/internal/JavaObjectHandler.cpp
src/internal/EventClassList.cpp
src/internal/SymbolList.cpp
src/internal/Common.cpp
)

set(dxFeedNativeAPIInternalUtilsSources
src/internal/utils/StringUtils.cpp
)

set(dxFeedNativeAPIInternalUtilsDebugSources
src/internal/utils/debug/Debug.cpp
)

set(dxFeedNativeAPIAPISources
src/api/DXEndpoint.cpp
src/api/DXFeed.cpp
src/api/DXFeedSubscription.cpp
)

set(dxFeedNativeAPIAPIOsubSources
src/api/osub/WildcardSymbol.cpp
)

set(dxFeedNativeAPISymbolsSources
src/symbols/SymbolMapper.cpp
src/symbols/StringSymbol.cpp
src/symbols/SymbolWrapper.cpp
)

set(dxFeedNativeAPISystemSources
src/system/System.cpp
)
Expand Down Expand Up @@ -118,19 +132,30 @@ set(dxFeedNativeAPIEventOptionSources

add_library(dxFeedGraalCxxApi
${dxFeedNativeAPIInternalSources}
${dxFeedNativeAPIInternalUtilsSources}
${dxFeedNativeAPIInternalUtilsDebugSources}
${dxFeedNativeAPIAPISources}
${dxFeedNativeAPIAPIOsubSources}
${dxFeedNativeAPISymbolsSources}
${dxFeedNativeAPISystemSources}
${dxFeedNativeAPIEventSources}
${dxFeedNativeAPIEventMarketSources}
${dxFeedNativeAPIEventOptionSources}
src/api.cpp
)

add_library(dxFeedGraalCxxApi_Clang INTERFACE)

if ((${CMAKE_CXX_COMPILER_ID} MATCHES "AppleClang") OR (${CMAKE_CXX_COMPILER_ID} MATCHES "Clang"))
# Ignore undefined template var warning
target_compile_options(dxFeedGraalCxxApi_Clang INTERFACE -Wno-undefined-var-template)
endif ()

target_include_directories(dxFeedGraalCxxApi PUBLIC include)
target_link_libraries(dxFeedGraalCxxApi PUBLIC DxFeedGraalNativeApi utf8cpp fmt::fmt)
target_link_libraries(dxFeedGraalCxxApi PUBLIC DxFeedGraalNativeSdk utf8cpp fmt::fmt PUBLIC dxFeedGraalCxxApi_Clang)

add_custom_command(TARGET dxFeedGraalCxxApi POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different
$<TARGET_FILE:DxFeedGraalNativeApi> $<TARGET_FILE_DIR:dxFeedGraalCxxApi>)
$<TARGET_FILE:DxFeedGraalNativeSdk> $<TARGET_FILE_DIR:dxFeedGraalCxxApi>)

if (DXFC_BUILD_UNIT_TESTS)
include(CTest)
Expand Down
7 changes: 3 additions & 4 deletions DEPENDENCIES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@

## Compile-time

- [dxFeed Graal Native SDK](https://github.com/dxFeed/dxfeed-graal-native-sdk) v0.4.0
- [dxFeed Graal Native SDK](https://github.com/dxFeed/dxfeed-graal-native-sdk) v1.0.0
- [utfcpp](https://github.com/nemtrif/utfcpp) v3.2.3
- [fmt](https://github.com/fmtlib/fmt) v9.1.0
- [fmt](https://github.com/fmtlib/fmt) v10.0.0
- [doctest](https://github.com/doctest/doctest) v2.4.11 (Tests)

## Run-time

- [dxFeed Graal Native SDK](https://github.com/dxFeed/dxfeed-graal-native-sdk) v0.4.0
- [fmt](https://github.com/fmtlib/fmt) v9.1.0 (C++)
- [dxFeed Graal Native SDK](https://github.com/dxFeed/dxfeed-graal-native-sdk) v1.0.0
- [doctest](https://github.com/doctest/doctest) v2.4.11 (Tests)
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -266,9 +266,9 @@ be downloaded from [Release](https://github.com/dxFeed/dxfeed-graal-cxx-api/rele
by [dxPrice](http://www.devexperts.com/en/products/price.html) model-free computation
- [x] [Underlying](https://docs.dxfeed.com/dxfeed/api/com/dxfeed/event/option/Underlying.html) is a snapshot of computed
values available for an option underlying symbol based on the market’s option prices
- [x] [Configuration](https://docs.dxfeed.com/dxfeed/api/com/dxfeed/event/misc/Configuration.html) is an event with an
- [ ] [Configuration](https://docs.dxfeed.com/dxfeed/api/com/dxfeed/event/misc/Configuration.html) is an event with an
application-specific attachment
- [x] [Message](https://docs.dxfeed.com/dxfeed/api/com/dxfeed/event/misc/Message.html) is an event with an
- [ ] [Message](https://docs.dxfeed.com/dxfeed/api/com/dxfeed/event/misc/Message.html) is an event with an
application-specific attachment

### Subscription Symbols
Expand All @@ -278,7 +278,7 @@ be downloaded from [Release](https://github.com/dxFeed/dxfeed-graal-cxx-api/rele
represents subscription to time-series events
- [ ] [IndexedSubscriptionSymbol](https://docs.dxfeed.com/dxfeed/api/com/dxfeed/api/osub/IndexedEventSubscriptionSymbol.html) -
represents subscription to a specific source of indexed events
- [ ] [WildcardSymbol.ALL](https://docs.dxfeed.com/dxfeed/api/com/dxfeed/api/osub/WildcardSymbol.html) - represents a
- [x] [WildcardSymbol.ALL](https://docs.dxfeed.com/dxfeed/api/com/dxfeed/api/osub/WildcardSymbol.html) - represents a
*wildcard* subscription to all events of the specific event type
- [ ] [CandleSymbol](https://docs.dxfeed.com/dxfeed/api/com/dxfeed/event/candle/CandleSymbol.html) - symbol used
with [DXFeedSubscription](https://docs.dxfeed.com/dxfeed/api/com/dxfeed/api/DXFeedSubscription.html) class to
Expand Down
14 changes: 13 additions & 1 deletion include/dxfeed_graal_cpp_api/api.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,29 @@

#pragma once

#include "dxfeed_graal_cpp_api/internal/managers/ErrorHandlingManager.hpp"
#include "internal/CEntryPointErrors.hpp"
#include "internal/Common.hpp"
#include "internal/Enum.hpp"
#include "internal/EventClassList.hpp"
#include "internal/Id.hpp"
#include "internal/JavaObjectHandler.hpp"
#include "internal/NonCopyable.hpp"
#include "internal/RawListWrapper.hpp"
#include "internal/SymbolList.hpp"
#include "internal/context/ApiContext.hpp"
#include "internal/managers/DXEndpointManager.hpp"
#include "internal/managers/DXFeedSubscriptionManager.hpp"
#include "internal/managers/EntityManager.hpp"
#include "internal/managers/ErrorHandlingManager.hpp"
#include "internal/utils/StringUtils.hpp"
#include "internal/utils/debug/Debug.hpp"

#include "api/DXEndpoint.hpp"
#include "api/DXFeed.hpp"
#include "api/DXFeedSubscription.hpp"
#include "api/osub/WildcardSymbol.hpp"
#include "event/DXEvent.hpp"
#include "symbols/StringSymbol.hpp"
#include "symbols/SymbolMapper.hpp"
#include "symbols/SymbolWrapper.hpp"
#include "system/System.hpp"
Loading