From 5d555e2a46c26de58b5a829d593bcc6f82bacdb7 Mon Sep 17 00:00:00 2001 From: nanoric Date: Wed, 3 Jul 2019 11:06:32 +0800 Subject: [PATCH 01/15] [Mod] sources of oes_gateway was changed. --- setup.py | 38 +++++++++++++++++++++++++++----------- 1 file changed, 27 insertions(+), 11 deletions(-) diff --git a/setup.py b/setup.py index 92322699..ed3002a3 100644 --- a/setup.py +++ b/setup.py @@ -16,6 +16,7 @@ other financial markets. """ import ast +import os import platform import re import sys @@ -32,9 +33,12 @@ if platform.uname().system == "Windows": compiler_flags = [ "/MP", "/std:c++17", # standard "/O2", "/Ob2", "/Oi", "/Ot", "/Oy", "/GL", # Optimization - "/wd4819" # 936 code page + "/bigobj", # Better compatibility + "/wd4819", # 936 code page + "/D_CRT_SECURE_NO_WARNINGS", # suppress warning of unsafe functions like fopen, strcpy, etc ] extra_link_args = [] + runtime_library_dirs = None else: compiler_flags = [ "-std=c++17", # standard @@ -42,6 +46,20 @@ else: "-Wno-delete-incomplete", "-Wno-sign-compare", ] extra_link_args = ["-lstdc++"] + runtime_library_dirs = ["$ORIGIN"] + + +def gather_autocxxpy_generated_files(root: str): + fs = [os.path.join(root, "module.cpp")] + for root, dirs, filenames in os.walk(root): + for filename in filenames: + filebase, ext = os.path.splitext(filename) + if ext == ".cpp" and filebase.startswith("generated_functions_"): + path = os.path.join(root, filename) + fs.append(path) + print(fs) + return fs + vnctpmd = Extension( "vnpy.api.ctp.vnctpmd", @@ -56,8 +74,8 @@ vnctpmd = Extension( libraries=["thostmduserapi_se", "thosttraderapi_se", ], extra_compile_args=compiler_flags, extra_link_args=extra_link_args, + runtime_library_dirs=runtime_library_dirs, depends=[], - runtime_library_dirs=["$ORIGIN"], language="cpp", ) vnctptd = Extension( @@ -73,17 +91,15 @@ vnctptd = Extension( libraries=["thostmduserapi_se", "thosttraderapi_se", ], extra_compile_args=compiler_flags, extra_link_args=extra_link_args, - runtime_library_dirs=["$ORIGIN"], + runtime_library_dirs=runtime_library_dirs, depends=[], language="cpp", ) vnoes = Extension( - "vnpy.api.oes.vnoes", - [ - "vnpy/api/oes/vnoes/generated_files/classes_1.cpp", - "vnpy/api/oes/vnoes/generated_files/classes_2.cpp", - "vnpy/api/oes/vnoes/generated_files/module.cpp", - ], + name="vnpy.api.oes.vnoes", + sources=gather_autocxxpy_generated_files( + "vnpy/api/oes/vnoes/generated_files/", + ), include_dirs=["vnpy/api/oes/include", "vnpy/api/oes/vnoes", ], define_macros=[("BRIGAND_NO_BOOST_SUPPORT", "1")], @@ -92,14 +108,14 @@ vnoes = Extension( libraries=["oes_api"], extra_compile_args=compiler_flags, extra_link_args=extra_link_args, - runtime_library_dirs=["$ORIGIN"], + runtime_library_dirs=runtime_library_dirs, depends=[], language="cpp", ) if platform.system() == "Windows": # use pre-built pyd for windows ( support python 3.7 only ) - ext_modules = [] + ext_modules = [vnoes] elif platform.system() == "Darwin": ext_modules = [] else: From ee717a69b8651ea341f2e2690aa286104388f658 Mon Sep 17 00:00:00 2001 From: nanoric Date: Wed, 3 Jul 2019 16:10:50 +0800 Subject: [PATCH 02/15] [Mod] fixed headers and libs path for oes gateway --- setup.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/setup.py b/setup.py index ed3002a3..ac776cd5 100644 --- a/setup.py +++ b/setup.py @@ -100,11 +100,11 @@ vnoes = Extension( sources=gather_autocxxpy_generated_files( "vnpy/api/oes/vnoes/generated_files/", ), - include_dirs=["vnpy/api/oes/include", - "vnpy/api/oes/vnoes", ], + include_dirs=["vnpy/api/oes/vnoes/include", + "vnpy/api/oes/vnoes/include/oes", ], define_macros=[("BRIGAND_NO_BOOST_SUPPORT", "1")], undef_macros=[], - library_dirs=["vnpy/api/oes/libs"], + library_dirs=["vnpy/api/oes/vnoes/libs"], libraries=["oes_api"], extra_compile_args=compiler_flags, extra_link_args=extra_link_args, From 50a212bf5a09c070bbb851a0d5941c9a2317df90 Mon Sep 17 00:00:00 2001 From: nanoric Date: Wed, 3 Jul 2019 16:49:08 +0800 Subject: [PATCH 03/15] [Mod] use autocxxpy 0.4.1 --- vnpy/api/oes/generate_oes.sh | 12 ++---------- .../oes/vnoes/include/autocxxpy/callback_wrapper.hpp | 12 +++++++++--- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/vnpy/api/oes/generate_oes.sh b/vnpy/api/oes/generate_oes.sh index 4c43d92f..4231146c 100644 --- a/vnpy/api/oes/generate_oes.sh +++ b/vnpy/api/oes/generate_oes.sh @@ -1,14 +1,5 @@ #!/usr/bin/env bash -script_autocxxpy_version="autocxxpy 0.4.0" -autocxxpy_version=`python -m autocxxpy version` -if [[ $autocxxpy_version != $script_autocxxpy_version ]]; then - echo "autocxxpy version not match!" - echo "current: " $autocxxpy_version - echo "script: " $script_autocxxpy_version - echo "to continue, change version of autocxxpy or modify this script." - exit 1 -fi python -m autocxxpy generate \ vnoes \ oes_api/oes_api.h \ @@ -19,7 +10,8 @@ python -m autocxxpy generate \ --copy-autocxxpy-includes vnoes/include \ --pyi-output-dir .\ --no-clear-pyi-output-dir \ - --no-callback-pattern ".*" + --no-callback-pattern ".*" \ + --enforce-version 0.4.1 ##################################### # of unsupported functions: 5 diff --git a/vnpy/api/oes/vnoes/include/autocxxpy/callback_wrapper.hpp b/vnpy/api/oes/vnoes/include/autocxxpy/callback_wrapper.hpp index 685b2156..1ac97966 100644 --- a/vnpy/api/oes/vnoes/include/autocxxpy/callback_wrapper.hpp +++ b/vnpy/api/oes/vnoes/include/autocxxpy/callback_wrapper.hpp @@ -82,17 +82,23 @@ namespace autocxxpy struct async_dispatch_exception : public std::exception { async_dispatch_exception(const char *what, const pybind11::object &instance, std::string function_name) - : std::exception(what), instance(instance), function_name(function_name) + : _what(what), instance(instance), function_name(function_name) {} + std::string _what; pybind11::object instance; std::string function_name; // mutable version of what() for pybind11 to make it happy inline const char* what_mutable() noexcept { - return std::exception::what(); + return what(); } - }; + + virtual char const* what() const override + { + return _what.c_str(); + } + }; struct async_callback_exception_handler { From 9db0dfdcbb2511fcd409a91ad248c3b2746619fb Mon Sep 17 00:00:00 2001 From: nanoric Date: Fri, 5 Jul 2019 09:03:56 +0800 Subject: [PATCH 04/15] [Mod] updated autocxxpy: added noexcept for async_dispatch_exception::what() --- vnpy/api/oes/vnoes/include/autocxxpy/callback_wrapper.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vnpy/api/oes/vnoes/include/autocxxpy/callback_wrapper.hpp b/vnpy/api/oes/vnoes/include/autocxxpy/callback_wrapper.hpp index 1ac97966..02b87521 100644 --- a/vnpy/api/oes/vnoes/include/autocxxpy/callback_wrapper.hpp +++ b/vnpy/api/oes/vnoes/include/autocxxpy/callback_wrapper.hpp @@ -94,7 +94,7 @@ namespace autocxxpy return what(); } - virtual char const* what() const override + virtual char const* what() const noexcept override { return _what.c_str(); } From 1e49a0aa1d8570950d967573dae0530e3249d6d3 Mon Sep 17 00:00:00 2001 From: nanoric Date: Fri, 5 Jul 2019 09:58:10 +0800 Subject: [PATCH 05/15] [Mod] updated autocxxpy: generate caster for only classes and enums --- vnpy/api/oes/vnoes/include/autocxxpy/casters.hpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/vnpy/api/oes/vnoes/include/autocxxpy/casters.hpp b/vnpy/api/oes/vnoes/include/autocxxpy/casters.hpp index da3b5329..8ab6d79f 100644 --- a/vnpy/api/oes/vnoes/include/autocxxpy/casters.hpp +++ b/vnpy/api/oes/vnoes/include/autocxxpy/casters.hpp @@ -55,13 +55,14 @@ namespace autocxxpy template static auto try_generate(scope_type &m, const char *name) { - if constexpr (is_defined_v) { - if constexpr (!std::is_array_v) { - if constexpr (std::is_default_constructible_v) { - generate_nocheck(m, name); + if constexpr (std::is_class_v || std::is_enum_v) { + if constexpr (is_defined_v) { + if constexpr (!std::is_array_v) { + if constexpr (std::is_default_constructible_v) { + generate_nocheck(m, name); + } } } - } } private: From a8f06a0139b4f19db506505578d9856ab4052a92 Mon Sep 17 00:00:00 2001 From: nanoric Date: Fri, 5 Jul 2019 11:17:30 +0800 Subject: [PATCH 06/15] [Mod] autocxxpy: ignore types not exists under Linux --- vnpy/api/oes/generate_oes.sh | 1 + vnpy/api/oes/vnoes.pyi | 37 --------- .../generated_files/generated_functions.h | 5 -- .../generated_files/generated_functions_0.cpp | 7 -- .../generated_files/generated_functions_1.cpp | 82 ++++++++----------- .../generated_files/generated_functions_2.cpp | 62 +++++++------- .../generated_files/generated_functions_3.cpp | 57 ++++++------- .../generated_files/generated_functions_4.cpp | 49 +++++------ .../generated_files/generated_functions_5.cpp | 35 +++----- .../generated_files/generated_functions_6.cpp | 25 +++--- .../generated_files/generated_functions_7.cpp | 12 --- .../generated_files/generated_functions_8.cpp | 7 -- 12 files changed, 137 insertions(+), 242 deletions(-) diff --git a/vnpy/api/oes/generate_oes.sh b/vnpy/api/oes/generate_oes.sh index 4231146c..a1434d22 100644 --- a/vnpy/api/oes/generate_oes.sh +++ b/vnpy/api/oes/generate_oes.sh @@ -11,6 +11,7 @@ python -m autocxxpy generate \ --pyi-output-dir .\ --no-clear-pyi-output-dir \ --no-callback-pattern ".*" \ + --ignore-pattern ".*(spk_struct|STimeval).*" \ --enforce-version 0.4.1 ##################################### diff --git a/vnpy/api/oes/vnoes.pyi b/vnpy/api/oes/vnoes.pyi index 2f6d3a44..5a099138 100644 --- a/vnpy/api/oes/vnoes.pyi +++ b/vnpy/api/oes/vnoes.pyi @@ -23,41 +23,6 @@ class AsyncDispatchException: function_name: str -class _spk_struct_timespec(): - - - tv_sec: int - tv_nsec: int - - -class _spk_struct_timezone(): - - - tz_minuteswest: int - tz_dsttime: int - - -class _spk_struct_iovec(): - - - iov_base: Any - iov_len: int - - -class _spk_struct_timeval32(): - - - tv_sec: int - tv_usec: int - - -class _spk_struct_timeval64(): - - - tv_sec: int - tv_usec: int - - class _OesOrdReq(): class decltype(userInfo)(): @@ -3179,8 +3144,6 @@ uint64 = int float32 = float float64 = float float128 = float -STimeval32T = _spk_struct_timeval32 -STimeval64T = _spk_struct_timeval64 eOesExchangeIdT = _eOesExchangeId eOesMarketIdT = _eOesMarketId eOesPlatformIdT = _eOesPlatformId diff --git a/vnpy/api/oes/vnoes/generated_files/generated_functions.h b/vnpy/api/oes/vnoes/generated_files/generated_functions.h index 1d39bed6..ae23099a 100644 --- a/vnpy/api/oes/vnoes/generated_files/generated_functions.h +++ b/vnpy/api/oes/vnoes/generated_files/generated_functions.h @@ -9,11 +9,6 @@ void generate_vnoes(pybind11::module & parent); -void generate_class_spk_struct_timespec(pybind11::object & parent); -void generate_class_spk_struct_timezone(pybind11::object & parent); -void generate_class_spk_struct_iovec(pybind11::object & parent); -void generate_class_spk_struct_timeval32(pybind11::object & parent); -void generate_class_spk_struct_timeval64(pybind11::object & parent); void generate_class_OesOrdReq(pybind11::object & parent); void generate_class_decltype_OesOrdReq_userInfo_(pybind11::object & parent); void generate_class_OesOrdCancelReq(pybind11::object & parent); diff --git a/vnpy/api/oes/vnoes/generated_files/generated_functions_0.cpp b/vnpy/api/oes/vnoes/generated_files/generated_functions_0.cpp index 4bb31a79..e2d6def2 100644 --- a/vnpy/api/oes/vnoes/generated_files/generated_functions_0.cpp +++ b/vnpy/api/oes/vnoes/generated_files/generated_functions_0.cpp @@ -17,11 +17,6 @@ void generate_vnoes(pybind11::module & parent) { - generate_class_spk_struct_timespec(parent); - generate_class_spk_struct_timezone(parent); - generate_class_spk_struct_iovec(parent); - generate_class_spk_struct_timeval32(parent); - generate_class_spk_struct_timeval64(parent); generate_class_OesOrdReq(parent); generate_class_OesOrdCancelReq(parent); generate_class_OesOrdReject(parent); @@ -1415,8 +1410,6 @@ void generate_vnoes(pybind11::module & parent) parent.attr("MDSAPI_CFG_DEFAULT_KEY_UDP_ADDR_TICK_TRADE") = MDSAPI_CFG_DEFAULT_KEY_UDP_ADDR_TICK_TRADE; parent.attr("MDSAPI_CFG_DEFAULT_KEY_UDP_ADDR_TICK_ORDER") = MDSAPI_CFG_DEFAULT_KEY_UDP_ADDR_TICK_ORDER; parent.attr("MDSAPI_DEFAULT_STRING_DELIM") = MDSAPI_DEFAULT_STRING_DELIM; - module_vnoes::cross.record_assign(parent, "STimeval32T", "STimeval32T", "::_spk_struct_timeval32"); - module_vnoes::cross.record_assign(parent, "STimeval64T", "STimeval64T", "::_spk_struct_timeval64"); module_vnoes::cross.record_assign(parent, "eOesExchangeIdT", "eOesExchangeIdT", "::_eOesExchangeId"); module_vnoes::cross.record_assign(parent, "eOesMarketIdT", "eOesMarketIdT", "::_eOesMarketId"); module_vnoes::cross.record_assign(parent, "eOesPlatformIdT", "eOesPlatformIdT", "::_eOesPlatformId"); diff --git a/vnpy/api/oes/vnoes/generated_files/generated_functions_1.cpp b/vnpy/api/oes/vnoes/generated_files/generated_functions_1.cpp index b5ab0f76..7777a725 100644 --- a/vnpy/api/oes/vnoes/generated_files/generated_functions_1.cpp +++ b/vnpy/api/oes/vnoes/generated_files/generated_functions_1.cpp @@ -15,56 +15,6 @@ #include "mds_api/mds_api.h" -void generate_class_spk_struct_timespec(pybind11::object & parent) -{ - pybind11::class_<_spk_struct_timespec> c(parent, "_spk_struct_timespec"); - if constexpr (std::is_default_constructible_v<_spk_struct_timespec>) - c.def(pybind11::init<>()); - c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _spk_struct_timespec, "tv_sec", tv_sec); - c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _spk_struct_timespec, "tv_nsec", tv_nsec); - AUTOCXXPY_POST_REGISTER_CLASS(tag_vnoes, _spk_struct_timespec, c); - module_vnoes::objects.emplace("_spk_struct_timespec", c); -} -void generate_class_spk_struct_timezone(pybind11::object & parent) -{ - pybind11::class_<_spk_struct_timezone> c(parent, "_spk_struct_timezone"); - if constexpr (std::is_default_constructible_v<_spk_struct_timezone>) - c.def(pybind11::init<>()); - c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _spk_struct_timezone, "tz_minuteswest", tz_minuteswest); - c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _spk_struct_timezone, "tz_dsttime", tz_dsttime); - AUTOCXXPY_POST_REGISTER_CLASS(tag_vnoes, _spk_struct_timezone, c); - module_vnoes::objects.emplace("_spk_struct_timezone", c); -} -void generate_class_spk_struct_iovec(pybind11::object & parent) -{ - pybind11::class_<_spk_struct_iovec> c(parent, "_spk_struct_iovec"); - if constexpr (std::is_default_constructible_v<_spk_struct_iovec>) - c.def(pybind11::init<>()); - c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _spk_struct_iovec, "iov_base", iov_base); - c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _spk_struct_iovec, "iov_len", iov_len); - AUTOCXXPY_POST_REGISTER_CLASS(tag_vnoes, _spk_struct_iovec, c); - module_vnoes::objects.emplace("_spk_struct_iovec", c); -} -void generate_class_spk_struct_timeval32(pybind11::object & parent) -{ - pybind11::class_<_spk_struct_timeval32> c(parent, "_spk_struct_timeval32"); - if constexpr (std::is_default_constructible_v<_spk_struct_timeval32>) - c.def(pybind11::init<>()); - c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _spk_struct_timeval32, "tv_sec", tv_sec); - c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _spk_struct_timeval32, "tv_usec", tv_usec); - AUTOCXXPY_POST_REGISTER_CLASS(tag_vnoes, _spk_struct_timeval32, c); - module_vnoes::objects.emplace("_spk_struct_timeval32", c); -} -void generate_class_spk_struct_timeval64(pybind11::object & parent) -{ - pybind11::class_<_spk_struct_timeval64> c(parent, "_spk_struct_timeval64"); - if constexpr (std::is_default_constructible_v<_spk_struct_timeval64>) - c.def(pybind11::init<>()); - c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _spk_struct_timeval64, "tv_sec", tv_sec); - c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _spk_struct_timeval64, "tv_usec", tv_usec); - AUTOCXXPY_POST_REGISTER_CLASS(tag_vnoes, _spk_struct_timeval64, c); - module_vnoes::objects.emplace("_spk_struct_timeval64", c); -} void generate_class_OesOrdReq(pybind11::object & parent) { pybind11::class_<_OesOrdReq> c(parent, "_OesOrdReq"); @@ -597,3 +547,35 @@ void generate_class_OesStockBaseInfo(pybind11::object & parent) AUTOCXXPY_POST_REGISTER_CLASS(tag_vnoes, _OesStockBaseInfo, c); module_vnoes::objects.emplace("_OesStockBaseInfo", c); } +void generate_class_OesEtfBaseInfo(pybind11::object & parent) +{ + pybind11::class_<_OesEtfBaseInfo> c(parent, "_OesEtfBaseInfo"); + if constexpr (std::is_default_constructible_v<_OesEtfBaseInfo>) + c.def(pybind11::init<>()); + c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _OesEtfBaseInfo, "fundId", fundId); + c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _OesEtfBaseInfo, "securityId", securityId); + c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _OesEtfBaseInfo, "mktId", mktId); + c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _OesEtfBaseInfo, "securityType", securityType); + c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _OesEtfBaseInfo, "subSecurityType", subSecurityType); + c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _OesEtfBaseInfo, "isPublishIOPV", isPublishIOPV); + c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _OesEtfBaseInfo, "isCreationAble", isCreationAble); + c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _OesEtfBaseInfo, "isRedemptionAble", isRedemptionAble); + c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _OesEtfBaseInfo, "isDisabled", isDisabled); + c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _OesEtfBaseInfo, "__ETF_BASE_filler", __ETF_BASE_filler); + c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _OesEtfBaseInfo, "componentCnt", componentCnt); + c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _OesEtfBaseInfo, "creRdmUnit", creRdmUnit); + c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _OesEtfBaseInfo, "maxCashRatio", maxCashRatio); + c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _OesEtfBaseInfo, "nav", nav); + c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _OesEtfBaseInfo, "navPerCU", navPerCU); + c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _OesEtfBaseInfo, "dividendPerCU", dividendPerCU); + c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _OesEtfBaseInfo, "tradingDay", tradingDay); + c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _OesEtfBaseInfo, "preTradingDay", preTradingDay); + c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _OesEtfBaseInfo, "estiCashCmpoent", estiCashCmpoent); + c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _OesEtfBaseInfo, "cashCmpoent", cashCmpoent); + c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _OesEtfBaseInfo, "creationLimit", creationLimit); + c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _OesEtfBaseInfo, "redemLimit", redemLimit); + c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _OesEtfBaseInfo, "netCreationLimit", netCreationLimit); + c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _OesEtfBaseInfo, "netRedemLimit", netRedemLimit); + AUTOCXXPY_POST_REGISTER_CLASS(tag_vnoes, _OesEtfBaseInfo, c); + module_vnoes::objects.emplace("_OesEtfBaseInfo", c); +} diff --git a/vnpy/api/oes/vnoes/generated_files/generated_functions_2.cpp b/vnpy/api/oes/vnoes/generated_files/generated_functions_2.cpp index 2110fe76..cdc22ab4 100644 --- a/vnpy/api/oes/vnoes/generated_files/generated_functions_2.cpp +++ b/vnpy/api/oes/vnoes/generated_files/generated_functions_2.cpp @@ -15,38 +15,6 @@ #include "mds_api/mds_api.h" -void generate_class_OesEtfBaseInfo(pybind11::object & parent) -{ - pybind11::class_<_OesEtfBaseInfo> c(parent, "_OesEtfBaseInfo"); - if constexpr (std::is_default_constructible_v<_OesEtfBaseInfo>) - c.def(pybind11::init<>()); - c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _OesEtfBaseInfo, "fundId", fundId); - c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _OesEtfBaseInfo, "securityId", securityId); - c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _OesEtfBaseInfo, "mktId", mktId); - c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _OesEtfBaseInfo, "securityType", securityType); - c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _OesEtfBaseInfo, "subSecurityType", subSecurityType); - c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _OesEtfBaseInfo, "isPublishIOPV", isPublishIOPV); - c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _OesEtfBaseInfo, "isCreationAble", isCreationAble); - c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _OesEtfBaseInfo, "isRedemptionAble", isRedemptionAble); - c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _OesEtfBaseInfo, "isDisabled", isDisabled); - c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _OesEtfBaseInfo, "__ETF_BASE_filler", __ETF_BASE_filler); - c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _OesEtfBaseInfo, "componentCnt", componentCnt); - c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _OesEtfBaseInfo, "creRdmUnit", creRdmUnit); - c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _OesEtfBaseInfo, "maxCashRatio", maxCashRatio); - c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _OesEtfBaseInfo, "nav", nav); - c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _OesEtfBaseInfo, "navPerCU", navPerCU); - c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _OesEtfBaseInfo, "dividendPerCU", dividendPerCU); - c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _OesEtfBaseInfo, "tradingDay", tradingDay); - c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _OesEtfBaseInfo, "preTradingDay", preTradingDay); - c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _OesEtfBaseInfo, "estiCashCmpoent", estiCashCmpoent); - c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _OesEtfBaseInfo, "cashCmpoent", cashCmpoent); - c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _OesEtfBaseInfo, "creationLimit", creationLimit); - c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _OesEtfBaseInfo, "redemLimit", redemLimit); - c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _OesEtfBaseInfo, "netCreationLimit", netCreationLimit); - c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _OesEtfBaseInfo, "netRedemLimit", netRedemLimit); - AUTOCXXPY_POST_REGISTER_CLASS(tag_vnoes, _OesEtfBaseInfo, c); - module_vnoes::objects.emplace("_OesEtfBaseInfo", c); -} void generate_class_OesEtfComponentBaseInfo(pybind11::object & parent) { pybind11::class_<_OesEtfComponentBaseInfo> c(parent, "_OesEtfComponentBaseInfo"); @@ -587,3 +555,33 @@ void generate_class_OesOptHoldingItem(pybind11::object & parent) AUTOCXXPY_POST_REGISTER_CLASS(tag_vnoes, _OesOptHoldingItem, c); module_vnoes::objects.emplace("_OesOptHoldingItem", c); } +void generate_class_OesQryOptHoldingReq(pybind11::object & parent) +{ + pybind11::class_<_OesQryOptHoldingReq> c(parent, "_OesQryOptHoldingReq"); + if constexpr (std::is_default_constructible_v<_OesQryOptHoldingReq>) + c.def(pybind11::init<>()); + c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _OesQryOptHoldingReq, "reqHead", reqHead); + c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _OesQryOptHoldingReq, "qryFilter", qryFilter); + AUTOCXXPY_POST_REGISTER_CLASS(tag_vnoes, _OesQryOptHoldingReq, c); + module_vnoes::objects.emplace("_OesQryOptHoldingReq", c); +} +void generate_class_OesQryHoldRsp(pybind11::object & parent) +{ + pybind11::class_<_OesQryHoldRsp> c(parent, "_OesQryHoldRsp"); + if constexpr (std::is_default_constructible_v<_OesQryHoldRsp>) + c.def(pybind11::init<>()); + c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _OesQryHoldRsp, "rspHead", rspHead); + c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _OesQryHoldRsp, "qryItems", qryItems); + AUTOCXXPY_POST_REGISTER_CLASS(tag_vnoes, _OesQryHoldRsp, c); + module_vnoes::objects.emplace("_OesQryHoldRsp", c); +} +void generate_class_OesQryCustFilter(pybind11::object & parent) +{ + pybind11::class_<_OesQryCustFilter> c(parent, "_OesQryCustFilter"); + if constexpr (std::is_default_constructible_v<_OesQryCustFilter>) + c.def(pybind11::init<>()); + c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _OesQryCustFilter, "custId", custId); + c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _OesQryCustFilter, "userInfo", userInfo); + AUTOCXXPY_POST_REGISTER_CLASS(tag_vnoes, _OesQryCustFilter, c); + module_vnoes::objects.emplace("_OesQryCustFilter", c); +} diff --git a/vnpy/api/oes/vnoes/generated_files/generated_functions_3.cpp b/vnpy/api/oes/vnoes/generated_files/generated_functions_3.cpp index 3a8d3894..73444521 100644 --- a/vnpy/api/oes/vnoes/generated_files/generated_functions_3.cpp +++ b/vnpy/api/oes/vnoes/generated_files/generated_functions_3.cpp @@ -15,36 +15,6 @@ #include "mds_api/mds_api.h" -void generate_class_OesQryOptHoldingReq(pybind11::object & parent) -{ - pybind11::class_<_OesQryOptHoldingReq> c(parent, "_OesQryOptHoldingReq"); - if constexpr (std::is_default_constructible_v<_OesQryOptHoldingReq>) - c.def(pybind11::init<>()); - c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _OesQryOptHoldingReq, "reqHead", reqHead); - c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _OesQryOptHoldingReq, "qryFilter", qryFilter); - AUTOCXXPY_POST_REGISTER_CLASS(tag_vnoes, _OesQryOptHoldingReq, c); - module_vnoes::objects.emplace("_OesQryOptHoldingReq", c); -} -void generate_class_OesQryHoldRsp(pybind11::object & parent) -{ - pybind11::class_<_OesQryHoldRsp> c(parent, "_OesQryHoldRsp"); - if constexpr (std::is_default_constructible_v<_OesQryHoldRsp>) - c.def(pybind11::init<>()); - c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _OesQryHoldRsp, "rspHead", rspHead); - c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _OesQryHoldRsp, "qryItems", qryItems); - AUTOCXXPY_POST_REGISTER_CLASS(tag_vnoes, _OesQryHoldRsp, c); - module_vnoes::objects.emplace("_OesQryHoldRsp", c); -} -void generate_class_OesQryCustFilter(pybind11::object & parent) -{ - pybind11::class_<_OesQryCustFilter> c(parent, "_OesQryCustFilter"); - if constexpr (std::is_default_constructible_v<_OesQryCustFilter>) - c.def(pybind11::init<>()); - c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _OesQryCustFilter, "custId", custId); - c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _OesQryCustFilter, "userInfo", userInfo); - AUTOCXXPY_POST_REGISTER_CLASS(tag_vnoes, _OesQryCustFilter, c); - module_vnoes::objects.emplace("_OesQryCustFilter", c); -} void generate_class_OesQryCustReq(pybind11::object & parent) { pybind11::class_<_OesQryCustReq> c(parent, "_OesQryCustReq"); @@ -607,3 +577,30 @@ void generate_class_OesQryReqMsg(pybind11::object & parent) AUTOCXXPY_POST_REGISTER_CLASS(tag_vnoes, _OesQryReqMsg, c); module_vnoes::objects.emplace("_OesQryReqMsg", c); } +void generate_class_OesQryRspMsg(pybind11::object & parent) +{ + pybind11::class_<_OesQryRspMsg> c(parent, "_OesQryRspMsg"); + if constexpr (std::is_default_constructible_v<_OesQryRspMsg>) + c.def(pybind11::init<>()); + c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _OesQryRspMsg, "ordRsp", ordRsp); + c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _OesQryRspMsg, "trdRsp", trdRsp); + c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _OesQryRspMsg, "cashAssetRsp", cashAssetRsp); + c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _OesQryRspMsg, "stkHoldingRsp", stkHoldingRsp); + c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _OesQryRspMsg, "optHoldingRsp", optHoldingRsp); + c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _OesQryRspMsg, "custRsp", custRsp); + c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _OesQryRspMsg, "invAcctRsp", invAcctRsp); + c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _OesQryRspMsg, "commsRateRsp", commsRateRsp); + c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _OesQryRspMsg, "fundTrsfRsp", fundTrsfRsp); + c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _OesQryRspMsg, "lotWinningRsp", lotWinningRsp); + c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _OesQryRspMsg, "issueRsp", issueRsp); + c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _OesQryRspMsg, "stockRsp", stockRsp); + c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _OesQryRspMsg, "etfRsp", etfRsp); + c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _OesQryRspMsg, "etfComponentRsp", etfComponentRsp); + c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _OesQryRspMsg, "optionRsp", optionRsp); + c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _OesQryRspMsg, "tradingDay", tradingDay); + c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _OesQryRspMsg, "mktStateRsp", mktStateRsp); + c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _OesQryRspMsg, "clientOverview", clientOverview); + c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _OesQryRspMsg, "counterCashRsp", counterCashRsp); + AUTOCXXPY_POST_REGISTER_CLASS(tag_vnoes, _OesQryRspMsg, c); + module_vnoes::objects.emplace("_OesQryRspMsg", c); +} diff --git a/vnpy/api/oes/vnoes/generated_files/generated_functions_4.cpp b/vnpy/api/oes/vnoes/generated_files/generated_functions_4.cpp index ad816693..543d7f58 100644 --- a/vnpy/api/oes/vnoes/generated_files/generated_functions_4.cpp +++ b/vnpy/api/oes/vnoes/generated_files/generated_functions_4.cpp @@ -15,33 +15,6 @@ #include "mds_api/mds_api.h" -void generate_class_OesQryRspMsg(pybind11::object & parent) -{ - pybind11::class_<_OesQryRspMsg> c(parent, "_OesQryRspMsg"); - if constexpr (std::is_default_constructible_v<_OesQryRspMsg>) - c.def(pybind11::init<>()); - c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _OesQryRspMsg, "ordRsp", ordRsp); - c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _OesQryRspMsg, "trdRsp", trdRsp); - c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _OesQryRspMsg, "cashAssetRsp", cashAssetRsp); - c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _OesQryRspMsg, "stkHoldingRsp", stkHoldingRsp); - c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _OesQryRspMsg, "optHoldingRsp", optHoldingRsp); - c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _OesQryRspMsg, "custRsp", custRsp); - c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _OesQryRspMsg, "invAcctRsp", invAcctRsp); - c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _OesQryRspMsg, "commsRateRsp", commsRateRsp); - c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _OesQryRspMsg, "fundTrsfRsp", fundTrsfRsp); - c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _OesQryRspMsg, "lotWinningRsp", lotWinningRsp); - c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _OesQryRspMsg, "issueRsp", issueRsp); - c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _OesQryRspMsg, "stockRsp", stockRsp); - c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _OesQryRspMsg, "etfRsp", etfRsp); - c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _OesQryRspMsg, "etfComponentRsp", etfComponentRsp); - c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _OesQryRspMsg, "optionRsp", optionRsp); - c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _OesQryRspMsg, "tradingDay", tradingDay); - c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _OesQryRspMsg, "mktStateRsp", mktStateRsp); - c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _OesQryRspMsg, "clientOverview", clientOverview); - c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _OesQryRspMsg, "counterCashRsp", counterCashRsp); - AUTOCXXPY_POST_REGISTER_CLASS(tag_vnoes, _OesQryRspMsg, c); - module_vnoes::objects.emplace("_OesQryRspMsg", c); -} void generate_class_OesReportSynchronizationReq(pybind11::object & parent) { pybind11::class_<_OesReportSynchronizationReq> c(parent, "_OesReportSynchronizationReq"); @@ -601,3 +574,25 @@ void generate_class_MdsMktDataSnapshotHead(pybind11::object & parent) AUTOCXXPY_POST_REGISTER_CLASS(tag_vnoes, _MdsMktDataSnapshotHead, c); module_vnoes::objects.emplace("_MdsMktDataSnapshotHead", c); } +void generate_class_MdsIndexSnapshotBody(pybind11::object & parent) +{ + pybind11::class_<_MdsIndexSnapshotBody> c(parent, "_MdsIndexSnapshotBody"); + if constexpr (std::is_default_constructible_v<_MdsIndexSnapshotBody>) + c.def(pybind11::init<>()); + c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _MdsIndexSnapshotBody, "SecurityID", SecurityID); + c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _MdsIndexSnapshotBody, "TradingPhaseCode", TradingPhaseCode); + c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _MdsIndexSnapshotBody, "__filler", __filler); + c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _MdsIndexSnapshotBody, "NumTrades", NumTrades); + c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _MdsIndexSnapshotBody, "TotalVolumeTraded", TotalVolumeTraded); + c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _MdsIndexSnapshotBody, "TotalValueTraded", TotalValueTraded); + c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _MdsIndexSnapshotBody, "PrevCloseIdx", PrevCloseIdx); + c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _MdsIndexSnapshotBody, "OpenIdx", OpenIdx); + c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _MdsIndexSnapshotBody, "HighIdx", HighIdx); + c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _MdsIndexSnapshotBody, "LowIdx", LowIdx); + c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _MdsIndexSnapshotBody, "LastIdx", LastIdx); + c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _MdsIndexSnapshotBody, "CloseIdx", CloseIdx); + c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _MdsIndexSnapshotBody, "StockNum", StockNum); + c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _MdsIndexSnapshotBody, "__filler1", __filler1); + AUTOCXXPY_POST_REGISTER_CLASS(tag_vnoes, _MdsIndexSnapshotBody, c); + module_vnoes::objects.emplace("_MdsIndexSnapshotBody", c); +} diff --git a/vnpy/api/oes/vnoes/generated_files/generated_functions_5.cpp b/vnpy/api/oes/vnoes/generated_files/generated_functions_5.cpp index 5ac258bb..4b495c23 100644 --- a/vnpy/api/oes/vnoes/generated_files/generated_functions_5.cpp +++ b/vnpy/api/oes/vnoes/generated_files/generated_functions_5.cpp @@ -15,28 +15,6 @@ #include "mds_api/mds_api.h" -void generate_class_MdsIndexSnapshotBody(pybind11::object & parent) -{ - pybind11::class_<_MdsIndexSnapshotBody> c(parent, "_MdsIndexSnapshotBody"); - if constexpr (std::is_default_constructible_v<_MdsIndexSnapshotBody>) - c.def(pybind11::init<>()); - c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _MdsIndexSnapshotBody, "SecurityID", SecurityID); - c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _MdsIndexSnapshotBody, "TradingPhaseCode", TradingPhaseCode); - c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _MdsIndexSnapshotBody, "__filler", __filler); - c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _MdsIndexSnapshotBody, "NumTrades", NumTrades); - c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _MdsIndexSnapshotBody, "TotalVolumeTraded", TotalVolumeTraded); - c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _MdsIndexSnapshotBody, "TotalValueTraded", TotalValueTraded); - c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _MdsIndexSnapshotBody, "PrevCloseIdx", PrevCloseIdx); - c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _MdsIndexSnapshotBody, "OpenIdx", OpenIdx); - c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _MdsIndexSnapshotBody, "HighIdx", HighIdx); - c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _MdsIndexSnapshotBody, "LowIdx", LowIdx); - c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _MdsIndexSnapshotBody, "LastIdx", LastIdx); - c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _MdsIndexSnapshotBody, "CloseIdx", CloseIdx); - c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _MdsIndexSnapshotBody, "StockNum", StockNum); - c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, _MdsIndexSnapshotBody, "__filler1", __filler1); - AUTOCXXPY_POST_REGISTER_CLASS(tag_vnoes, _MdsIndexSnapshotBody, c); - module_vnoes::objects.emplace("_MdsIndexSnapshotBody", c); -} void generate_class_MdsStockSnapshotBody(pybind11::object & parent) { pybind11::class_<_MdsStockSnapshotBody> c(parent, "_MdsStockSnapshotBody"); @@ -595,3 +573,16 @@ void generate_class_MdsChangePasswordReq(pybind11::object & parent) AUTOCXXPY_POST_REGISTER_CLASS(tag_vnoes, _MdsChangePasswordReq, c); module_vnoes::objects.emplace("_MdsChangePasswordReq", c); } +void generate_class_decltype_MdsChangePasswordReq_userInfo_(pybind11::object & parent) +{ + pybind11::class_ c(parent, "decltype(userInfo)"); + if constexpr (std::is_default_constructible_v) + c.def(pybind11::init<>()); + c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, decltype(_MdsChangePasswordReq::userInfo), "u64", u64); + c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, decltype(_MdsChangePasswordReq::userInfo), "i64", i64); + c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, decltype(_MdsChangePasswordReq::userInfo), "u32", u32); + c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, decltype(_MdsChangePasswordReq::userInfo), "i32", i32); + c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, decltype(_MdsChangePasswordReq::userInfo), "c8", c8); + AUTOCXXPY_POST_REGISTER_CLASS(tag_vnoes, decltype(_MdsChangePasswordReq::userInfo), c); + module_vnoes::objects.emplace("decltype(_MdsChangePasswordReq::userInfo)", c); +} diff --git a/vnpy/api/oes/vnoes/generated_files/generated_functions_6.cpp b/vnpy/api/oes/vnoes/generated_files/generated_functions_6.cpp index ee8e519e..e6a5ff83 100644 --- a/vnpy/api/oes/vnoes/generated_files/generated_functions_6.cpp +++ b/vnpy/api/oes/vnoes/generated_files/generated_functions_6.cpp @@ -15,19 +15,6 @@ #include "mds_api/mds_api.h" -void generate_class_decltype_MdsChangePasswordReq_userInfo_(pybind11::object & parent) -{ - pybind11::class_ c(parent, "decltype(userInfo)"); - if constexpr (std::is_default_constructible_v) - c.def(pybind11::init<>()); - c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, decltype(_MdsChangePasswordReq::userInfo), "u64", u64); - c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, decltype(_MdsChangePasswordReq::userInfo), "i64", i64); - c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, decltype(_MdsChangePasswordReq::userInfo), "u32", u32); - c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, decltype(_MdsChangePasswordReq::userInfo), "i32", i32); - c.AUTOCXXPY_DEF_PROPERTY(tag_vnoes, decltype(_MdsChangePasswordReq::userInfo), "c8", c8); - AUTOCXXPY_POST_REGISTER_CLASS(tag_vnoes, decltype(_MdsChangePasswordReq::userInfo), c); - module_vnoes::objects.emplace("decltype(_MdsChangePasswordReq::userInfo)", c); -} void generate_class_MdsChangePasswordRsp(pybind11::object & parent) { pybind11::class_<_MdsChangePasswordRsp> c(parent, "_MdsChangePasswordRsp"); @@ -590,3 +577,15 @@ void generate_enum_eOesAcctType(pybind11::object & parent) e.export_values(); module_vnoes::objects.emplace("_eOesAcctType", e); } +void generate_enum_eOesCashType(pybind11::object & parent) +{ + pybind11::enum_<_eOesCashType> e(parent, "_eOesCashType", pybind11::arithmetic()); + e.value("OES_CASH_TYPE_SPOT", _eOesCashType::OES_CASH_TYPE_SPOT); + e.value("OES_CASH_TYPE_CREDIT", _eOesCashType::OES_CASH_TYPE_CREDIT); + e.value("OES_CASH_TYPE_OPTION", _eOesCashType::OES_CASH_TYPE_OPTION); + e.value("__OES_CASH_TYPE_MAX", _eOesCashType::__OES_CASH_TYPE_MAX); + e.value("OES_CASH_TYPE_CRE", _eOesCashType::OES_CASH_TYPE_CRE); + e.value("OES_CASH_TYPE_OPT", _eOesCashType::OES_CASH_TYPE_OPT); + e.export_values(); + module_vnoes::objects.emplace("_eOesCashType", e); +} diff --git a/vnpy/api/oes/vnoes/generated_files/generated_functions_7.cpp b/vnpy/api/oes/vnoes/generated_files/generated_functions_7.cpp index a04d8836..f6b8b4a5 100644 --- a/vnpy/api/oes/vnoes/generated_files/generated_functions_7.cpp +++ b/vnpy/api/oes/vnoes/generated_files/generated_functions_7.cpp @@ -15,18 +15,6 @@ #include "mds_api/mds_api.h" -void generate_enum_eOesCashType(pybind11::object & parent) -{ - pybind11::enum_<_eOesCashType> e(parent, "_eOesCashType", pybind11::arithmetic()); - e.value("OES_CASH_TYPE_SPOT", _eOesCashType::OES_CASH_TYPE_SPOT); - e.value("OES_CASH_TYPE_CREDIT", _eOesCashType::OES_CASH_TYPE_CREDIT); - e.value("OES_CASH_TYPE_OPTION", _eOesCashType::OES_CASH_TYPE_OPTION); - e.value("__OES_CASH_TYPE_MAX", _eOesCashType::__OES_CASH_TYPE_MAX); - e.value("OES_CASH_TYPE_CRE", _eOesCashType::OES_CASH_TYPE_CRE); - e.value("OES_CASH_TYPE_OPT", _eOesCashType::OES_CASH_TYPE_OPT); - e.export_values(); - module_vnoes::objects.emplace("_eOesCashType", e); -} void generate_enum_eOesAcctStatus(pybind11::object & parent) { pybind11::enum_<_eOesAcctStatus> e(parent, "_eOesAcctStatus", pybind11::arithmetic()); diff --git a/vnpy/api/oes/vnoes/generated_files/generated_functions_8.cpp b/vnpy/api/oes/vnoes/generated_files/generated_functions_8.cpp index 857a7fa2..966aed9a 100644 --- a/vnpy/api/oes/vnoes/generated_files/generated_functions_8.cpp +++ b/vnpy/api/oes/vnoes/generated_files/generated_functions_8.cpp @@ -38,11 +38,6 @@ void generate_caster_(pybind11::object & parent) { struct caster: autocxxpy::caster{}; auto c = autocxxpy::caster::bind(parent, "caster"); - autocxxpy::caster::try_generate<_spk_struct_timespec>(c, "to_spk_struct_timespec"); - autocxxpy::caster::try_generate<_spk_struct_timezone>(c, "to_spk_struct_timezone"); - autocxxpy::caster::try_generate<_spk_struct_iovec>(c, "to_spk_struct_iovec"); - autocxxpy::caster::try_generate<_spk_struct_timeval32>(c, "to_spk_struct_timeval32"); - autocxxpy::caster::try_generate<_spk_struct_timeval64>(c, "to_spk_struct_timeval64"); autocxxpy::caster::try_generate<_OesOrdReq>(c, "to_OesOrdReq"); autocxxpy::caster::try_generate<_OesOrdCancelReq>(c, "to_OesOrdCancelReq"); autocxxpy::caster::try_generate<_OesOrdReject>(c, "to_OesOrdReject"); @@ -216,8 +211,6 @@ void generate_caster_(pybind11::object & parent) autocxxpy::caster::try_generate(c, "tofloat32"); autocxxpy::caster::try_generate(c, "tofloat64"); autocxxpy::caster::try_generate(c, "tofloat128"); - autocxxpy::caster::try_generate(c, "toSTimeval32T"); - autocxxpy::caster::try_generate(c, "toSTimeval64T"); autocxxpy::caster::try_generate(c, "toeOesExchangeIdT"); autocxxpy::caster::try_generate(c, "toeOesMarketIdT"); autocxxpy::caster::try_generate(c, "toeOesPlatformIdT"); From 304072f96de5bc677bf04f9fad85d3627edd56db Mon Sep 17 00:00:00 2001 From: nanoric Date: Fri, 5 Jul 2019 12:40:06 +0800 Subject: [PATCH 07/15] [Mod] tests_import_all: skip importing XTP under OSX --- tests/test_import_all.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/test_import_all.py b/tests/test_import_all.py index a4ca3206..f5969556 100644 --- a/tests/test_import_all.py +++ b/tests/test_import_all.py @@ -78,6 +78,8 @@ class GatewayImportTest(unittest.TestCase): def test_import_tora(self): from vnpy.gateway.tora import ToraGateway + @unittest.skipIf(platform.system() == "Linux", "Not supported yet under Linux") + @unittest.skipIf(platform.system() == "Darwin", "Not supported yet under osx") def test_import_xtp(self): from vnpy.gateway.xtp import XtpGateway From 17cf6a3d5cf83c6160b5fb4d2405f6be160ad0fc Mon Sep 17 00:00:00 2001 From: nanoric Date: Fri, 5 Jul 2019 12:49:49 +0800 Subject: [PATCH 08/15] [Add] build option to switch whether to build oes api or not --- setup.py | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/setup.py b/setup.py index ac776cd5..91044e60 100644 --- a/setup.py +++ b/setup.py @@ -57,7 +57,6 @@ def gather_autocxxpy_generated_files(root: str): if ext == ".cpp" and filebase.startswith("generated_functions_"): path = os.path.join(root, filename) fs.append(path) - print(fs) return fs @@ -115,11 +114,34 @@ vnoes = Extension( if platform.system() == "Windows": # use pre-built pyd for windows ( support python 3.7 only ) - ext_modules = [vnoes] + ext_modules = [] elif platform.system() == "Darwin": ext_modules = [] else: - ext_modules = [vnctptd, vnctpmd, vnoes] + ext_modules = [vnctptd, vnctpmd] + + +def get_env(key: str, default=None): + try: + return os.environ[key] + except KeyError: + return default + + +def check_extension_build_flag(key: str, module: Extension): + value = get_env(key, None) + if value is not None: + global ext_modules + if value == '1': + ext_modules = list(set(ext_modules) | {module}) + elif value == '0': + ext_modules = list(set(ext_modules) - {module}) + else: + raise ValueError(f"Flag {key} should be '0' or '1', but {repr(value)} got.") + + +check_extension_build_flag("VNPY_BUILD_OES", vnoes) + pkgs = find_packages() From 9b503435bf3c134e3bd11326bd82b661c29fd8c5 Mon Sep 17 00:00:00 2001 From: nanoric Date: Fri, 5 Jul 2019 14:34:11 +0800 Subject: [PATCH 09/15] [Mod] travis ci: not to build vnoes(not enough memory) --- .travis.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.travis.yml b/.travis.yml index 7e85ab59..9582f386 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,6 +4,9 @@ dist: xenial # required for Python >= 3.7 (travis-ci/travis-ci#9069) cache: pip +env: + - VNPY_BUILD_OES=0 + git: depth: 1 From e3ffe9126fdead2c47a7a81346534e94219d9e90 Mon Sep 17 00:00:00 2001 From: nanoric Date: Fri, 5 Jul 2019 14:49:25 +0800 Subject: [PATCH 10/15] [Mod] make setup.py more simple --- setup.py | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/setup.py b/setup.py index 91044e60..ab20f5fb 100644 --- a/setup.py +++ b/setup.py @@ -121,15 +121,8 @@ else: ext_modules = [vnctptd, vnctpmd] -def get_env(key: str, default=None): - try: - return os.environ[key] - except KeyError: - return default - - def check_extension_build_flag(key: str, module: Extension): - value = get_env(key, None) + value = os.environ.get(key, None) if value is not None: global ext_modules if value == '1': From 574853d5a1f66f58f8c8fd3a58bfb3f499380e7e Mon Sep 17 00:00:00 2001 From: nanoric Date: Fri, 5 Jul 2019 14:50:04 +0800 Subject: [PATCH 11/15] [Add] use make -j under travis-gcc7 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 9582f386..5f6344be 100644 --- a/.travis.yml +++ b/.travis.yml @@ -73,7 +73,7 @@ matrix: - tar -xf ta-lib-0.4.0-src.tar.gz - cd ta-lib - ./configure --prefix=/usr - - make + - make -j - sudo make install - popd - python -m pip install numpy From 099b5292fe2a0a7e88a3bd408fc01114c70644cc Mon Sep 17 00:00:00 2001 From: nanoric Date: Fri, 5 Jul 2019 14:50:36 +0800 Subject: [PATCH 12/15] [Mod] skip tests if extensions not built. --- tests/test_import_all.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/test_import_all.py b/tests/test_import_all.py index f5969556..6ebe6e78 100644 --- a/tests/test_import_all.py +++ b/tests/test_import_all.py @@ -1,6 +1,11 @@ # flake8: noqa import platform import unittest +from os import environ + + +def check_env(key: str, default=None): + return environ.get(key, default) # noinspection PyUnresolvedReferences,PyMethodMayBeStatic @@ -33,6 +38,7 @@ class GatewayImportTest(unittest.TestCase): from vnpy.gateway.ctp import CtpGateway @unittest.skipIf(platform.system() == "Darwin", "Not supported yet under osx") + @unittest.skipIf(platform.system() == "Linux", "Not supported yet under Linux") def test_import_ctptest(self): from vnpy.gateway.ctptest import CtptestGateway @@ -54,6 +60,7 @@ class GatewayImportTest(unittest.TestCase): from vnpy.gateway.ib import IbGateway @unittest.skipIf(platform.system() == "Darwin", "Not supported yet under osx") + @unittest.skipIf(check_env('VNPY_BUILD_OES') == '0', "Skip because of VNPY_BUILD_OES==0") def test_import_oes(self): from vnpy.gateway.oes import OesGateway @@ -75,6 +82,7 @@ class GatewayImportTest(unittest.TestCase): from vnpy.gateway.tiger import TigerGateway @unittest.skipIf(platform.system() == "Darwin", "Not supported yet under osx") + @unittest.skipIf(platform.system() == "Linux", "Not supported yet under Linux") def test_import_tora(self): from vnpy.gateway.tora import ToraGateway From 039ec5980d232aee78cd7a2b661074c3a81a22ae Mon Sep 17 00:00:00 2001 From: nanoric Date: Fri, 5 Jul 2019 15:09:42 +0800 Subject: [PATCH 13/15] [Mod] travis.yml: remove -j option under gcc-7 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 5f6344be..e300d52c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -73,7 +73,7 @@ matrix: - tar -xf ta-lib-0.4.0-src.tar.gz - cd ta-lib - ./configure --prefix=/usr - - make -j + - make # -j under gcc-7 failed!!? - sudo make install - popd - python -m pip install numpy From 69638d3ef1d8cebda857cb11a54cf59a50724c78 Mon Sep 17 00:00:00 2001 From: nanoric <475647575@qq.com> Date: Fri, 5 Jul 2019 18:45:41 +0800 Subject: [PATCH 14/15] Update setup.py setup.py : Build vnoes for default . --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index ab20f5fb..c2093f84 100644 --- a/setup.py +++ b/setup.py @@ -118,7 +118,7 @@ if platform.system() == "Windows": elif platform.system() == "Darwin": ext_modules = [] else: - ext_modules = [vnctptd, vnctpmd] + ext_modules = [vnctptd, vnctpmd, vnoes] def check_extension_build_flag(key: str, module: Extension): From de5e55b615dd5c641c2b907acd9f63fdcd432366 Mon Sep 17 00:00:00 2001 From: tony Date: Tue, 9 Jul 2019 08:59:00 +0800 Subject: [PATCH 15/15] =?UTF-8?q?=E5=8E=BB=E9=99=A4=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E8=AE=BA=E5=9D=9B=E5=90=8E=E9=93=BE=E6=8E=A5=E7=9A=84=E5=A4=9A?= =?UTF-8?q?=E4=BD=99=E7=A9=BA=E6=A0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/SUPPORT.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/SUPPORT.md b/.github/SUPPORT.md index a8ee457c..37d0132e 100644 --- a/.github/SUPPORT.md +++ b/.github/SUPPORT.md @@ -4,5 +4,5 @@ * Github Issues:[Issues页面](https://github.com/vnpy/vnpy/issues) * 官方QQ群: 262656087 -* 项目论坛:[维恩的派](http://www.vnpie.com)) +* 项目论坛:[维恩的派](http://www.vnpie.com) * 项目邮箱: vn.py@foxmail.com