Skip to content

Commit

Permalink
[EN-7412] Implement DXFeedConnect sample
Browse files Browse the repository at this point in the history
  • Loading branch information
ttldtor committed Sep 6, 2023
1 parent 4925f38 commit cdfb5f2
Show file tree
Hide file tree
Showing 144 changed files with 39,696 additions and 10 deletions.
9 changes: 7 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ if (POLICY CMP0135)
cmake_policy(SET CMP0135 NEW)
endif ()

set(CMAKE_POLICY_DEFAULT_CMP0077 NEW)

project(dxFeedGraalCxxApi)

set(DXFCXX_VERSION "0.1.3" CACHE STRING "The dxFeed Graal CXX API package version")
Expand Down Expand Up @@ -89,6 +91,9 @@ FetchContent_MakeAvailable(DxFeedGraalNativeSdk)
add_subdirectory(third_party/utfcpp-3.2.3)
set(FMT_INSTALL OFF)
add_subdirectory(third_party/fmt-10.0.0)
set(BUILD_TZ_LIB ON)
set(USE_SYSTEM_TZ_DB ON)
add_subdirectory(third_party/date-3.0.1)

# find_package(utf8cpp)
# find_package(fmt)
Expand Down Expand Up @@ -300,8 +305,8 @@ if (DXFCXX_USE_PRECOMPILED_HEADERS)
target_precompile_headers(${PROJECT_NAME}_static PRIVATE include/dxfeed_graal_cpp_api/internal/PrecompiledHeaders.hpp)
endif ()

target_link_libraries(${PROJECT_NAME}_static PUBLIC DxFeedGraalNativeSdk utf8cpp fmt::fmt-header-only)
target_link_libraries(${PROJECT_NAME} PUBLIC DxFeedGraalNativeSdk utf8cpp fmt::fmt-header-only)
target_link_libraries(${PROJECT_NAME}_static PUBLIC DxFeedGraalNativeSdk utf8cpp fmt::fmt-header-only date::date)
target_link_libraries(${PROJECT_NAME} PUBLIC DxFeedGraalNativeSdk utf8cpp fmt::fmt-header-only date::date)

if (DXFCXX_ENABLE_ASAN_UBSAN)
target_compile_options(${PROJECT_NAME} PRIVATE "-fsanitize=address" "-fsanitize=undefined")
Expand Down
3 changes: 2 additions & 1 deletion DEPENDENCIES.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
- [utfcpp](https://github.com/nemtrif/utfcpp) v3.2.3
- [fmt](https://github.com/fmtlib/fmt) v10.0.0
- [doctest](https://github.com/doctest/doctest) v2.4.11 (Tests)
- [range-v3](https://github.com/ericniebler/range-v3) v0.12 (Code & Samples)
- [range-v3](https://github.com/ericniebler/range-v3) v0.12
- [date] (https://github.com/HowardHinnant/date) v3.0.1

## Run-time

Expand Down
5 changes: 4 additions & 1 deletion THIRD_PARTY_LICENSES.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,7 @@
3. doctest - https://github.com/doctest/doctest/blob/master/LICENSE.txt
SPDX-License-Identifier: MIT
4. range-v3 - https://github.com/ericniebler/range-v3/blob/master/LICENSE.txt
SPDX-License-Identifier: BSL-1.0
SPDX-License-Identifier: BSL-1.0
5. date - https://github.com/HowardHinnant/date/blob/master/LICENSE.txt
SPDX-License-Identifier: MIT

4 changes: 2 additions & 2 deletions samples/cpp/DxFeedConnect/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ if (DXFCXX_ENABLE_VS_ASAN)
endif ()

if (DXFCXX_ENABLE_ASAN_UBSAN)
target_link_libraries(${PROJECT_NAME} PRIVATE dxfcxx)
target_link_libraries(${PROJECT_NAME} PRIVATE dxfcxx date::date date::date-tz)
target_compile_definitions(${PROJECT_NAME} PRIVATE DXFCPP_USE_DLLS)
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different
$<TARGET_FILE:dxfcxx::graal>
Expand All @@ -59,7 +59,7 @@ if (DXFCXX_ENABLE_ASAN_UBSAN)
target_compile_options(${PROJECT_NAME} PRIVATE "-fsanitize=address" "-fsanitize=undefined")
target_link_options(${PROJECT_NAME} PRIVATE "-fsanitize=address" "-fsanitize=undefined")
else ()
target_link_libraries(${PROJECT_NAME} PRIVATE dxfcxx)
target_link_libraries(${PROJECT_NAME} PRIVATE dxfcxx date::date date::date-tz)
target_compile_definitions(${PROJECT_NAME} PRIVATE DXFCPP_USE_DLLS)
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different
$<TARGET_FILE:dxfcxx::graal>
Expand Down
7 changes: 3 additions & 4 deletions samples/cpp/DxFeedConnect/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@

#include <atomic>
#include <mutex>
#include <chrono>
#include <date/date.h>
#include <date/tz.h>

using namespace dxfcpp;
using namespace dxfcpp::literals;
Expand Down Expand Up @@ -43,9 +44,7 @@ DxFeedConnect <address> <types> <symbols> [<time>]
}

int main(int argc, char *argv[]) {
const std::chrono::zoned_time cur_time{ std::chrono::current_zone(),
std::chrono::system_clock::now() };
std::cout << cur_time << '\n';
//std::cout << date::current_zone()->name() << std::endl;

return 0;

Expand Down
194 changes: 194 additions & 0 deletions third_party/date-3.0.1/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,194 @@
#ignore thumbnails created by windows
Thumbs.db
#Ignore files build by Visual Studio
*.obj
*.exe
*.pdb
*.user
*.aps
*.pch
*.vspscc
*_i.c
*_p.c
*.ncb
*.suo
*.tlb
*.tlh
*.bak
*.cache
*.ilk
*.log
[Bb]in
[Dd]ebug*/
*.lib
*.sbr
obj/
[Rr]elease*/
_ReSharper*/
[Tt]est[Rr]esult*
.idea/
*.opensdf
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
# User-specific files
*.suo
*.user
*.userosscache
*.sln.docstates
# User-specific folders
*.sln.ide/
# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
build/
bld/
[Bb]in/
[Oo]bj/
# Roslyn cache directories
*.ide/
# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
#NUNIT
*.VisualState.xml
TestResult.xml
# Build Results of an ATL Project
[Dd]ebugPS/
[Rr]eleasePS/
dlldata.c
*_i.c
*_p.c
*_i.h
*.ilk
*.meta
*.obj
*.pch
*.pdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.svclog
*.scc
# Chutzpah Test files
_Chutzpah*
# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opensdf
*.sdf
*.cachefile
# Visual Studio profiler
*.psess
*.vsp
*.vspx
# TFS 2012 Local Workspace
$tf/
# Guidance Automation Toolkit
*.gpState
# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user
# JustCode is a .NET coding addin-in
.JustCode
# TeamCity is a build add-in
_TeamCity*
# DotCover is a Code Coverage Tool
*.dotCover
# NCrunch
_NCrunch_*
.*crunch*.local.xml
# MightyMoose
*.mm.*
AutoTest.Net/
# Web workbench (sass)
.sass-cache/
# Installshield output folder
[Ee]xpress/
# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html
# Click-Once directory
publish/
# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
# TODO: Comment the next line if you want to checkin your web deploy settings
# but database connection strings (with potential passwords) will be unencrypted
*.pubxml
*.publishproj
# NuGet Packages
*.nupkg
# The packages folder can be ignored because of Package Restore
**/packages/*
# except build/, which is used as an MSBuild target.
!**/packages/build/
# If using the old MSBuild-Integrated Package Restore, uncomment this:
#!**/packages/repositories.config
# Windows Azure Build Output
csx/
*.build.csdef
# Windows Store app package directory
AppPackages/
# Others
sql/
*.Cache
ClientBin/
[Ss]tyle[Cc]op.*
~$*
*~
*.dbmdl
*.dbproj.schemaview
*.pfx
*.publishsettings
node_modules/
bower_components/
# RIA/Silverlight projects
Generated_Code/
# Backup & report files from converting an old project file
# to a newer Visual Studio version. Backup files are not needed,
# because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm
# SQL Server files
*.mdf
*.ldf
# Business Intelligence projects
*.rdl.data
*.bim.layout
*.bim_*.settings
# Microsoft Fakes
FakesAssemblies/
*.suo
*.vcxproj.filters
*.npp
CMakeFiles/*
nbproject/*
*.cd
*.cd
a.out
cmake-build-debug/*
Loading

0 comments on commit cdfb5f2

Please sign in to comment.