Merge pull request #1903 from nanoric/linux_no_oes

Linux no oes
This commit is contained in:
vn.py 2019-07-05 17:41:38 +08:00 committed by GitHub
commit 36524511b2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
17 changed files with 213 additions and 275 deletions

View File

@ -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
@ -70,7 +73,7 @@ matrix:
- tar -xf ta-lib-0.4.0-src.tar.gz
- cd ta-lib
- ./configure --prefix=/usr
- make
- make # -j under gcc-7 failed!!?
- sudo make install
- popd
- python -m pip install numpy

View File

@ -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,19 @@ 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)
return fs
vnctpmd = Extension(
"vnpy.api.ctp.vnctpmd",
@ -56,8 +73,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,26 +90,24 @@ 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",
],
include_dirs=["vnpy/api/oes/include",
"vnpy/api/oes/vnoes", ],
name="vnpy.api.oes.vnoes",
sources=gather_autocxxpy_generated_files(
"vnpy/api/oes/vnoes/generated_files/",
),
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,
runtime_library_dirs=["$ORIGIN"],
runtime_library_dirs=runtime_library_dirs,
depends=[],
language="cpp",
)
@ -103,7 +118,23 @@ if platform.system() == "Windows":
elif platform.system() == "Darwin":
ext_modules = []
else:
ext_modules = [vnctptd, vnctpmd, vnoes]
ext_modules = [vnctptd, vnctpmd]
def check_extension_build_flag(key: str, module: Extension):
value = os.environ.get(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()

View File

@ -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,9 +82,12 @@ 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
@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

View File

@ -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,9 @@ python -m autocxxpy generate \
--copy-autocxxpy-includes vnoes/include \
--pyi-output-dir .\
--no-clear-pyi-output-dir \
--no-callback-pattern ".*"
--no-callback-pattern ".*" \
--ignore-pattern ".*(spk_struct|STimeval).*" \
--enforce-version 0.4.1
#####################################
# of unsupported functions: 5

View File

@ -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

View File

@ -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);

View File

@ -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");

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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_<decltype(_MdsChangePasswordReq::userInfo)> c(parent, "decltype(userInfo)");
if constexpr (std::is_default_constructible_v<decltype(_MdsChangePasswordReq::userInfo)>)
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);
}

View File

@ -15,19 +15,6 @@
#include "mds_api/mds_api.h"
void generate_class_decltype_MdsChangePasswordReq_userInfo_(pybind11::object & parent)
{
pybind11::class_<decltype(_MdsChangePasswordReq::userInfo)> c(parent, "decltype(userInfo)");
if constexpr (std::is_default_constructible_v<decltype(_MdsChangePasswordReq::userInfo)>)
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);
}

View File

@ -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());

View File

@ -38,11 +38,6 @@ void generate_caster_(pybind11::object & parent)
{
struct caster: autocxxpy::caster{};
auto c = autocxxpy::caster::bind<caster>(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<float32>(c, "tofloat32");
autocxxpy::caster::try_generate<float64>(c, "tofloat64");
autocxxpy::caster::try_generate<float128>(c, "tofloat128");
autocxxpy::caster::try_generate<STimeval32T>(c, "toSTimeval32T");
autocxxpy::caster::try_generate<STimeval64T>(c, "toSTimeval64T");
autocxxpy::caster::try_generate<eOesExchangeIdT>(c, "toeOesExchangeIdT");
autocxxpy::caster::try_generate<eOesMarketIdT>(c, "toeOesMarketIdT");
autocxxpy::caster::try_generate<eOesPlatformIdT>(c, "toeOesPlatformIdT");

View File

@ -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 noexcept override
{
return _what.c_str();
}
};
struct async_callback_exception_handler
{

View File

@ -55,13 +55,14 @@ namespace autocxxpy
template <class to_type, class scope_type>
static auto try_generate(scope_type &m, const char *name)
{
if constexpr (is_defined_v<to_type>) {
if constexpr (!std::is_array_v<to_type>) {
if constexpr (std::is_default_constructible_v<to_type>) {
generate_nocheck<to_type>(m, name);
if constexpr (std::is_class_v<to_type> || std::is_enum_v<to_type>) {
if constexpr (is_defined_v<to_type>) {
if constexpr (!std::is_array_v<to_type>) {
if constexpr (std::is_default_constructible_v<to_type>) {
generate_nocheck<to_type>(m, name);
}
}
}
}
}
private: