diff --git a/vnpy/api/tora/generate_tora.sh b/vnpy/api/tora/generate_tora.sh index a28e3eb1..38e3ec13 100644 --- a/vnpy/api/tora/generate_tora.sh +++ b/vnpy/api/tora/generate_tora.sh @@ -7,6 +7,7 @@ python -m autocxxpy \ TORATstpUserApiDataType.h\ TORATstpUserApiStruct.h\ -I vntora/include \ + -A custom/custom_wrappers.hpp\ --copy-autocxxpy-includes vntora/include \ --output-dir vntora/generated_files \ --pyi-output-dir . \ diff --git a/vnpy/api/tora/vntora.pyd b/vnpy/api/tora/vntora.pyd index b3fda3bb..8260e8a7 100644 Binary files a/vnpy/api/tora/vntora.pyd and b/vnpy/api/tora/vntora.pyd differ diff --git a/vnpy/api/tora/vntora.pyi b/vnpy/api/tora/vntora.pyi index ddb85450..e14b1f99 100644 --- a/vnpy/api/tora/vntora.pyi +++ b/vnpy/api/tora/vntora.pyi @@ -7,7 +7,7 @@ if typing.TYPE_CHECKING: from .vntora import * -def set_async_callback_exception_handler(handler: Callable[[AsyncDispatchException], None]): +def set_async_callback_exception_handler(handler: Callable[[AsyncDispatchException], bool]): """ set a customize exception handler for async callback in this module(pyd) \a handler should return True if it handles that exception, @@ -2312,37 +2312,37 @@ class CTORATstpMdSpi(): - def OnFrontConnected(self, )->None: + def OnFrontConnected(self, )->Any: ... - def OnFrontDisconnected(self, nReason: int)->None: + def OnFrontDisconnected(self, nReason: int)->Any: ... - def OnRspError(self, pRspInfo: CTORATstpRspInfoField, nRequestID: int, bIsLast: bool)->None: + def OnRspError(self, pRspInfo: CTORATstpRspInfoField, nRequestID: int, bIsLast: bool)->Any: ... - def OnRspUserLogin(self, pRspUserLogin: CTORATstpRspUserLoginField, pRspInfo: CTORATstpRspInfoField, nRequestID: int, bIsLast: bool)->None: + def OnRspUserLogin(self, pRspUserLogin: CTORATstpRspUserLoginField, pRspInfo: CTORATstpRspInfoField, nRequestID: int, bIsLast: bool)->Any: ... - def OnRspUserLogout(self, pUserLogout: CTORATstpUserLogoutField, pRspInfo: CTORATstpRspInfoField, nRequestID: int, bIsLast: bool)->None: + def OnRspUserLogout(self, pUserLogout: CTORATstpUserLogoutField, pRspInfo: CTORATstpRspInfoField, nRequestID: int, bIsLast: bool)->Any: ... - def OnRspSubMarketData(self, pSpecificSecurity: CTORATstpSpecificSecurityField, pRspInfo: CTORATstpRspInfoField, nRequestID: int, bIsLast: bool)->None: + def OnRspSubMarketData(self, pSpecificSecurity: CTORATstpSpecificSecurityField, pRspInfo: CTORATstpRspInfoField, nRequestID: int, bIsLast: bool)->Any: ... - def OnRspUnSubMarketData(self, pSpecificSecurity: CTORATstpSpecificSecurityField, pRspInfo: CTORATstpRspInfoField, nRequestID: int, bIsLast: bool)->None: + def OnRspUnSubMarketData(self, pSpecificSecurity: CTORATstpSpecificSecurityField, pRspInfo: CTORATstpRspInfoField, nRequestID: int, bIsLast: bool)->Any: ... - def OnRspSubSpecialMarketData(self, pSpecificSecurity: CTORATstpSpecificSecurityField, pRspInfo: CTORATstpRspInfoField, nRequestID: int, bIsLast: bool)->None: + def OnRspSubSpecialMarketData(self, pSpecificSecurity: CTORATstpSpecificSecurityField, pRspInfo: CTORATstpRspInfoField, nRequestID: int, bIsLast: bool)->Any: ... - def OnRspUnSubSpecialMarketData(self, pSpecificSecurity: CTORATstpSpecificSecurityField, pRspInfo: CTORATstpRspInfoField, nRequestID: int, bIsLast: bool)->None: + def OnRspUnSubSpecialMarketData(self, pSpecificSecurity: CTORATstpSpecificSecurityField, pRspInfo: CTORATstpRspInfoField, nRequestID: int, bIsLast: bool)->Any: ... - def OnRspSubFundsFlowMarketData(self, pSpecificSecurity: CTORATstpSpecificSecurityField, pRspInfo: CTORATstpRspInfoField, nRequestID: int, bIsLast: bool)->None: + def OnRspSubFundsFlowMarketData(self, pSpecificSecurity: CTORATstpSpecificSecurityField, pRspInfo: CTORATstpRspInfoField, nRequestID: int, bIsLast: bool)->Any: ... - def OnRspUnSubFundsFlowMarketData(self, pSpecificSecurity: CTORATstpSpecificSecurityField, pRspInfo: CTORATstpRspInfoField, nRequestID: int, bIsLast: bool)->None: + def OnRspUnSubFundsFlowMarketData(self, pSpecificSecurity: CTORATstpSpecificSecurityField, pRspInfo: CTORATstpRspInfoField, nRequestID: int, bIsLast: bool)->Any: ... - def OnRtnDepthMarketData(self, pDepthMarketData: CTORATstpMarketDataField)->None: + def OnRtnDepthMarketData(self, pDepthMarketData: CTORATstpMarketDataField)->Any: ... - def OnRtnSpecialMarketData(self, pSpecialMarketData: CTORATstpSpecialMarketDataField)->None: + def OnRtnSpecialMarketData(self, pSpecialMarketData: CTORATstpSpecialMarketDataField)->Any: ... - def OnRtnEffectPriceMarketData(self, pEffectPriceMarketData: CTORATstpEffectPriceMarketDataField)->None: + def OnRtnEffectPriceMarketData(self, pEffectPriceMarketData: CTORATstpEffectPriceMarketDataField)->Any: ... - def OnRtnEffectVolumeMarketData(self, pEffectVolumeMarketData: CTORATstpEffectVolumeMarketDataField)->None: + def OnRtnEffectVolumeMarketData(self, pEffectVolumeMarketData: CTORATstpEffectVolumeMarketDataField)->Any: ... - def OnRtnFundsFlowMarketData(self, pFundsFlowMarketData: CTORATstpFundsFlowMarketDataField)->None: + def OnRtnFundsFlowMarketData(self, pFundsFlowMarketData: CTORATstpFundsFlowMarketDataField)->Any: ... class CTORATstpMdApi(): @@ -2355,19 +2355,19 @@ class CTORATstpMdApi(): @staticmethod def GetApiVersion()->str: ... - def Release(self, )->None: + def Release(self, )->Any: ... - def Init(self, )->None: + def Init(self, )->Any: ... def Join(self, )->int: ... - def RegisterFront(self, pszFrontAddress: str)->None: + def RegisterFront(self, pszFrontAddress: str)->Any: ... - def RegisterNameServer(self, pszNsAddress: str)->None: + def RegisterNameServer(self, pszNsAddress: str)->Any: ... - def RegisterDeriveServer(self, pszDeriveAddress: str)->None: + def RegisterDeriveServer(self, pszDeriveAddress: str)->Any: ... - def RegisterSpi(self, pSpi: CTORATstpMdSpi)->None: + def RegisterSpi(self, pSpi: CTORATstpMdSpi)->Any: ... def SubscribeMarketData(self, ppSecurityID: List[str], ExchageID: int)->int: ... @@ -2390,145 +2390,145 @@ class CTORATstpTraderSpi(): - def OnFrontConnected(self, )->None: + def OnFrontConnected(self, )->Any: ... - def OnFrontDisconnected(self, nReason: int)->None: + def OnFrontDisconnected(self, nReason: int)->Any: ... - def OnRspError(self, pRspInfo: CTORATstpRspInfoField, nRequestID: int, bIsLast: bool)->None: + def OnRspError(self, pRspInfo: CTORATstpRspInfoField, nRequestID: int, bIsLast: bool)->Any: ... - def OnRspUserLogin(self, pRspUserLoginField: CTORATstpRspUserLoginField, pRspInfo: CTORATstpRspInfoField, nRequestID: int, bIsLast: bool)->None: + def OnRspUserLogin(self, pRspUserLoginField: CTORATstpRspUserLoginField, pRspInfo: CTORATstpRspInfoField, nRequestID: int, bIsLast: bool)->Any: ... - def OnRspUserLogout(self, pUserLogoutField: CTORATstpUserLogoutField, pRspInfo: CTORATstpRspInfoField, nRequestID: int, bIsLast: bool)->None: + def OnRspUserLogout(self, pUserLogoutField: CTORATstpUserLogoutField, pRspInfo: CTORATstpRspInfoField, nRequestID: int, bIsLast: bool)->Any: ... - def OnRspUserPasswordUpdate(self, pUserPasswordUpdateField: CTORATstpUserPasswordUpdateField, pRspInfo: CTORATstpRspInfoField, nRequestID: int, bIsLast: bool)->None: + def OnRspUserPasswordUpdate(self, pUserPasswordUpdateField: CTORATstpUserPasswordUpdateField, pRspInfo: CTORATstpRspInfoField, nRequestID: int, bIsLast: bool)->Any: ... - def OnRspInputDeviceSerial(self, pRspInputDeviceSerialField: CTORATstpRspInputDeviceSerialField, pRspInfo: CTORATstpRspInfoField, nRequestID: int, bIsLast: bool)->None: + def OnRspInputDeviceSerial(self, pRspInputDeviceSerialField: CTORATstpRspInputDeviceSerialField, pRspInfo: CTORATstpRspInfoField, nRequestID: int, bIsLast: bool)->Any: ... - def OnRspOrderInsert(self, pInputOrderField: CTORATstpInputOrderField, pRspInfo: CTORATstpRspInfoField, nRequestID: int, bIsLast: bool)->None: + def OnRspOrderInsert(self, pInputOrderField: CTORATstpInputOrderField, pRspInfo: CTORATstpRspInfoField, nRequestID: int, bIsLast: bool)->Any: ... - def OnRtnOrder(self, pOrder: CTORATstpOrderField)->None: + def OnRtnOrder(self, pOrder: CTORATstpOrderField)->Any: ... - def OnErrRtnOrderInsert(self, pInputOrder: CTORATstpInputOrderField, pRspInfo: CTORATstpRspInfoField)->None: + def OnErrRtnOrderInsert(self, pInputOrder: CTORATstpInputOrderField, pRspInfo: CTORATstpRspInfoField)->Any: ... - def OnRspOrderAction(self, pInputOrderActionField: CTORATstpInputOrderActionField, pRspInfo: CTORATstpRspInfoField, nRequestID: int, bIsLast: bool)->None: + def OnRspOrderAction(self, pInputOrderActionField: CTORATstpInputOrderActionField, pRspInfo: CTORATstpRspInfoField, nRequestID: int, bIsLast: bool)->Any: ... - def OnErrRtnOrderAction(self, pOrderAction: CTORATstpOrderActionField, pRspInfo: CTORATstpRspInfoField)->None: + def OnErrRtnOrderAction(self, pOrderAction: CTORATstpOrderActionField, pRspInfo: CTORATstpRspInfoField)->Any: ... - def OnRtnTrade(self, pTrade: CTORATstpTradeField)->None: + def OnRtnTrade(self, pTrade: CTORATstpTradeField)->Any: ... - def OnRtnMarketStatus(self, pMarketStatus: CTORATstpMarketStatusField)->None: + def OnRtnMarketStatus(self, pMarketStatus: CTORATstpMarketStatusField)->Any: ... - def OnRspCondOrderInsert(self, pInputCondOrderField: CTORATstpInputCondOrderField, pRspInfo: CTORATstpRspInfoField, nRequestID: int, bIsLast: bool)->None: + def OnRspCondOrderInsert(self, pInputCondOrderField: CTORATstpInputCondOrderField, pRspInfo: CTORATstpRspInfoField, nRequestID: int, bIsLast: bool)->Any: ... - def OnRtnCondOrder(self, pConditionOrder: CTORATstpConditionOrderField)->None: + def OnRtnCondOrder(self, pConditionOrder: CTORATstpConditionOrderField)->Any: ... - def OnErrRtnCondOrderInsert(self, pInputCondOrder: CTORATstpInputCondOrderField, pRspInfo: CTORATstpRspInfoField)->None: + def OnErrRtnCondOrderInsert(self, pInputCondOrder: CTORATstpInputCondOrderField, pRspInfo: CTORATstpRspInfoField)->Any: ... - def OnRspCondOrderAction(self, pInputCondOrderActionField: CTORATstpInputCondOrderActionField, pRspInfo: CTORATstpRspInfoField, nRequestID: int, bIsLast: bool)->None: + def OnRspCondOrderAction(self, pInputCondOrderActionField: CTORATstpInputCondOrderActionField, pRspInfo: CTORATstpRspInfoField, nRequestID: int, bIsLast: bool)->Any: ... - def OnErrRtnCondOrderAction(self, pInputCondOrderAction: CTORATstpInputCondOrderActionField, pRspInfo: CTORATstpRspInfoField)->None: + def OnErrRtnCondOrderAction(self, pInputCondOrderAction: CTORATstpInputCondOrderActionField, pRspInfo: CTORATstpRspInfoField)->Any: ... - def OnRspInquiryJZFund(self, pRspInquiryJZFundField: CTORATstpRspInquiryJZFundField, pRspInfo: CTORATstpRspInfoField, nRequestID: int, bIsLast: bool)->None: + def OnRspInquiryJZFund(self, pRspInquiryJZFundField: CTORATstpRspInquiryJZFundField, pRspInfo: CTORATstpRspInfoField, nRequestID: int, bIsLast: bool)->Any: ... - def OnRspTransferFund(self, pInputTransferFundField: CTORATstpInputTransferFundField, pRspInfo: CTORATstpRspInfoField, nRequestID: int, bIsLast: bool)->None: + def OnRspTransferFund(self, pInputTransferFundField: CTORATstpInputTransferFundField, pRspInfo: CTORATstpRspInfoField, nRequestID: int, bIsLast: bool)->Any: ... - def OnRtnTransferFund(self, pTransferFund: CTORATstpTransferFundField)->None: + def OnRtnTransferFund(self, pTransferFund: CTORATstpTransferFundField)->Any: ... - def OnErrRtnTransferFund(self, pInputTransferFund: CTORATstpInputTransferFundField, pRspInfo: CTORATstpRspInfoField)->None: + def OnErrRtnTransferFund(self, pInputTransferFund: CTORATstpInputTransferFundField, pRspInfo: CTORATstpRspInfoField)->Any: ... - def OnRtnTransferPosition(self, pTransferPosition: CTORATstpTransferPositionField)->None: + def OnRtnTransferPosition(self, pTransferPosition: CTORATstpTransferPositionField)->Any: ... - def OnErrRtnTransferPosition(self, pInputTransferPosition: CTORATstpInputTransferPositionField, pRspInfo: CTORATstpRspInfoField)->None: + def OnErrRtnTransferPosition(self, pInputTransferPosition: CTORATstpInputTransferPositionField, pRspInfo: CTORATstpRspInfoField)->Any: ... - def OnRspTransferCollateral(self, pInputTransferCollateralField: CTORATstpInputTransferCollateralField, pRspInfo: CTORATstpRspInfoField, nRequestID: int, bIsLast: bool)->None: + def OnRspTransferCollateral(self, pInputTransferCollateralField: CTORATstpInputTransferCollateralField, pRspInfo: CTORATstpRspInfoField, nRequestID: int, bIsLast: bool)->Any: ... - def OnRspInquiryBankAccountFund(self, pRspInquiryBankAccountFundField: CTORATstpRspInquiryBankAccountFundField, pRspInfo: CTORATstpRspInfoField, nRequestID: int, bIsLast: bool)->None: + def OnRspInquiryBankAccountFund(self, pRspInquiryBankAccountFundField: CTORATstpRspInquiryBankAccountFundField, pRspInfo: CTORATstpRspInfoField, nRequestID: int, bIsLast: bool)->Any: ... - def OnRspInquiryTradeConcentration(self, pInquiryTradeConcentrationField: CTORATstpInquiryTradeConcentrationField, pRspInfo: CTORATstpRspInfoField, nRequestID: int, bIsLast: bool)->None: + def OnRspInquiryTradeConcentration(self, pInquiryTradeConcentrationField: CTORATstpInquiryTradeConcentrationField, pRspInfo: CTORATstpRspInfoField, nRequestID: int, bIsLast: bool)->Any: ... - def OnRtnTradingNotice(self, pTradingNotice: CTORATstpTradingNoticeField)->None: + def OnRtnTradingNotice(self, pTradingNotice: CTORATstpTradingNoticeField)->Any: ... - def OnRspInquiryMaxOrderVolume(self, pRspInquiryMaxOrderVolumeField: CTORATstpRspInquiryMaxOrderVolumeField, pRspInfo: CTORATstpRspInfoField, nRequestID: int, bIsLast: bool)->None: + def OnRspInquiryMaxOrderVolume(self, pRspInquiryMaxOrderVolumeField: CTORATstpRspInquiryMaxOrderVolumeField, pRspInfo: CTORATstpRspInfoField, nRequestID: int, bIsLast: bool)->Any: ... - def OnRtnPeripheryTransferPosition(self, pPeripheryPositionTransferDetail: CTORATstpPeripheryPositionTransferDetailField)->None: + def OnRtnPeripheryTransferPosition(self, pPeripheryPositionTransferDetail: CTORATstpPeripheryPositionTransferDetailField)->Any: ... - def OnRspInquiryHistoryOrder(self, pHistoryOrderField: CTORATstpHistoryOrderField, pRspInfo: CTORATstpRspInfoField, nRequestID: int, bIsLast: bool)->None: + def OnRspInquiryHistoryOrder(self, pHistoryOrderField: CTORATstpHistoryOrderField, pRspInfo: CTORATstpRspInfoField, nRequestID: int, bIsLast: bool)->Any: ... - def OnRspInquiryHistoryTrade(self, pHistoryTradeField: CTORATstpHistoryTradeField, pRspInfo: CTORATstpRspInfoField, nRequestID: int, bIsLast: bool)->None: + def OnRspInquiryHistoryTrade(self, pHistoryTradeField: CTORATstpHistoryTradeField, pRspInfo: CTORATstpRspInfoField, nRequestID: int, bIsLast: bool)->Any: ... - def OnRspQryExchange(self, pExchange: CTORATstpExchangeField, pRspInfo: CTORATstpRspInfoField, nRequestID: int, bIsLast: bool)->None: + def OnRspQryExchange(self, pExchange: CTORATstpExchangeField, pRspInfo: CTORATstpRspInfoField, nRequestID: int, bIsLast: bool)->Any: ... - def OnRspQryMarketData(self, pMarketData: CTORATstpMarketDataField, pRspInfo: CTORATstpRspInfoField, nRequestID: int, bIsLast: bool)->None: + def OnRspQryMarketData(self, pMarketData: CTORATstpMarketDataField, pRspInfo: CTORATstpRspInfoField, nRequestID: int, bIsLast: bool)->Any: ... - def OnRspQrySecurity(self, pSecurity: CTORATstpSecurityField, pRspInfo: CTORATstpRspInfoField, nRequestID: int, bIsLast: bool)->None: + def OnRspQrySecurity(self, pSecurity: CTORATstpSecurityField, pRspInfo: CTORATstpRspInfoField, nRequestID: int, bIsLast: bool)->Any: ... - def OnRspQryETFFile(self, pETFFile: CTORATstpETFFileField, pRspInfo: CTORATstpRspInfoField, nRequestID: int, bIsLast: bool)->None: + def OnRspQryETFFile(self, pETFFile: CTORATstpETFFileField, pRspInfo: CTORATstpRspInfoField, nRequestID: int, bIsLast: bool)->Any: ... - def OnRspQryETFBasket(self, pETFBasket: CTORATstpETFBasketField, pRspInfo: CTORATstpRspInfoField, nRequestID: int, bIsLast: bool)->None: + def OnRspQryETFBasket(self, pETFBasket: CTORATstpETFBasketField, pRspInfo: CTORATstpRspInfoField, nRequestID: int, bIsLast: bool)->Any: ... - def OnRspQryIPOInfo(self, pIPOInfo: CTORATstpIPOInfoField, pRspInfo: CTORATstpRspInfoField, nRequestID: int, bIsLast: bool)->None: + def OnRspQryIPOInfo(self, pIPOInfo: CTORATstpIPOInfoField, pRspInfo: CTORATstpRspInfoField, nRequestID: int, bIsLast: bool)->Any: ... - def OnRspQryBUProxy(self, pBUProxy: CTORATstpBUProxyField, pRspInfo: CTORATstpRspInfoField, nRequestID: int, bIsLast: bool)->None: + def OnRspQryBUProxy(self, pBUProxy: CTORATstpBUProxyField, pRspInfo: CTORATstpRspInfoField, nRequestID: int, bIsLast: bool)->Any: ... - def OnRspQryUser(self, pUser: CTORATstpUserField, pRspInfo: CTORATstpRspInfoField, nRequestID: int, bIsLast: bool)->None: + def OnRspQryUser(self, pUser: CTORATstpUserField, pRspInfo: CTORATstpRspInfoField, nRequestID: int, bIsLast: bool)->Any: ... - def OnRspQryInvestor(self, pInvestor: CTORATstpInvestorField, pRspInfo: CTORATstpRspInfoField, nRequestID: int, bIsLast: bool)->None: + def OnRspQryInvestor(self, pInvestor: CTORATstpInvestorField, pRspInfo: CTORATstpRspInfoField, nRequestID: int, bIsLast: bool)->Any: ... - def OnRspQryShareholderAccount(self, pShareholderAccount: CTORATstpShareholderAccountField, pRspInfo: CTORATstpRspInfoField, nRequestID: int, bIsLast: bool)->None: + def OnRspQryShareholderAccount(self, pShareholderAccount: CTORATstpShareholderAccountField, pRspInfo: CTORATstpRspInfoField, nRequestID: int, bIsLast: bool)->Any: ... - def OnRspQryOrder(self, pOrder: CTORATstpOrderField, pRspInfo: CTORATstpRspInfoField, nRequestID: int, bIsLast: bool)->None: + def OnRspQryOrder(self, pOrder: CTORATstpOrderField, pRspInfo: CTORATstpRspInfoField, nRequestID: int, bIsLast: bool)->Any: ... - def OnRspQryOrderAction(self, pOrderAction: CTORATstpOrderActionField, pRspInfo: CTORATstpRspInfoField, nRequestID: int, bIsLast: bool)->None: + def OnRspQryOrderAction(self, pOrderAction: CTORATstpOrderActionField, pRspInfo: CTORATstpRspInfoField, nRequestID: int, bIsLast: bool)->Any: ... - def OnRspQryTrade(self, pTrade: CTORATstpTradeField, pRspInfo: CTORATstpRspInfoField, nRequestID: int, bIsLast: bool)->None: + def OnRspQryTrade(self, pTrade: CTORATstpTradeField, pRspInfo: CTORATstpRspInfoField, nRequestID: int, bIsLast: bool)->Any: ... - def OnRspQryTradingAccount(self, pTradingAccount: CTORATstpTradingAccountField, pRspInfo: CTORATstpRspInfoField, nRequestID: int, bIsLast: bool)->None: + def OnRspQryTradingAccount(self, pTradingAccount: CTORATstpTradingAccountField, pRspInfo: CTORATstpRspInfoField, nRequestID: int, bIsLast: bool)->Any: ... - def OnRspQryPosition(self, pPosition: CTORATstpPositionField, pRspInfo: CTORATstpRspInfoField, nRequestID: int, bIsLast: bool)->None: + def OnRspQryPosition(self, pPosition: CTORATstpPositionField, pRspInfo: CTORATstpRspInfoField, nRequestID: int, bIsLast: bool)->Any: ... - def OnRspQryTradingFee(self, pTradingFee: CTORATstpTradingFeeField, pRspInfo: CTORATstpRspInfoField, nRequestID: int, bIsLast: bool)->None: + def OnRspQryTradingFee(self, pTradingFee: CTORATstpTradingFeeField, pRspInfo: CTORATstpRspInfoField, nRequestID: int, bIsLast: bool)->Any: ... - def OnRspQryInvestorTradingFee(self, pInvestorTradingFee: CTORATstpInvestorTradingFeeField, pRspInfo: CTORATstpRspInfoField, nRequestID: int, bIsLast: bool)->None: + def OnRspQryInvestorTradingFee(self, pInvestorTradingFee: CTORATstpInvestorTradingFeeField, pRspInfo: CTORATstpRspInfoField, nRequestID: int, bIsLast: bool)->Any: ... - def OnRspQryIPOQuota(self, pIPOQuota: CTORATstpIPOQuotaField, pRspInfo: CTORATstpRspInfoField, nRequestID: int, bIsLast: bool)->None: + def OnRspQryIPOQuota(self, pIPOQuota: CTORATstpIPOQuotaField, pRspInfo: CTORATstpRspInfoField, nRequestID: int, bIsLast: bool)->Any: ... - def OnRspQryMarket(self, pMarket: CTORATstpMarketField, pRspInfo: CTORATstpRspInfoField, nRequestID: int, bIsLast: bool)->None: + def OnRspQryMarket(self, pMarket: CTORATstpMarketField, pRspInfo: CTORATstpRspInfoField, nRequestID: int, bIsLast: bool)->Any: ... - def OnRspQryOrderFundDetail(self, pOrderFundDetail: CTORATstpOrderFundDetailField, pRspInfo: CTORATstpRspInfoField, nRequestID: int, bIsLast: bool)->None: + def OnRspQryOrderFundDetail(self, pOrderFundDetail: CTORATstpOrderFundDetailField, pRspInfo: CTORATstpRspInfoField, nRequestID: int, bIsLast: bool)->Any: ... - def OnRspQryFundTransferDetail(self, pFundTransferDetail: CTORATstpFundTransferDetailField, pRspInfo: CTORATstpRspInfoField, nRequestID: int, bIsLast: bool)->None: + def OnRspQryFundTransferDetail(self, pFundTransferDetail: CTORATstpFundTransferDetailField, pRspInfo: CTORATstpRspInfoField, nRequestID: int, bIsLast: bool)->Any: ... - def OnRspQryPositionTransferDetail(self, pPositionTransferDetail: CTORATstpPositionTransferDetailField, pRspInfo: CTORATstpRspInfoField, nRequestID: int, bIsLast: bool)->None: + def OnRspQryPositionTransferDetail(self, pPositionTransferDetail: CTORATstpPositionTransferDetailField, pRspInfo: CTORATstpRspInfoField, nRequestID: int, bIsLast: bool)->Any: ... - def OnRspQryPledgePosition(self, pPledgePosition: CTORATstpPledgePositionField, pRspInfo: CTORATstpRspInfoField, nRequestID: int, bIsLast: bool)->None: + def OnRspQryPledgePosition(self, pPledgePosition: CTORATstpPledgePositionField, pRspInfo: CTORATstpRspInfoField, nRequestID: int, bIsLast: bool)->Any: ... - def OnRspQryPledgeInfo(self, pPledgeInfo: CTORATstpPledgeInfoField, pRspInfo: CTORATstpRspInfoField, nRequestID: int, bIsLast: bool)->None: + def OnRspQryPledgeInfo(self, pPledgeInfo: CTORATstpPledgeInfoField, pRspInfo: CTORATstpRspInfoField, nRequestID: int, bIsLast: bool)->Any: ... - def OnRspQryConversionBondInfo(self, pConversionBondInfo: CTORATstpConversionBondInfoField, pRspInfo: CTORATstpRspInfoField, nRequestID: int, bIsLast: bool)->None: + def OnRspQryConversionBondInfo(self, pConversionBondInfo: CTORATstpConversionBondInfoField, pRspInfo: CTORATstpRspInfoField, nRequestID: int, bIsLast: bool)->Any: ... - def OnRspQryBondPutbackInfo(self, pBondPutbackInfo: CTORATstpBondPutbackInfoField, pRspInfo: CTORATstpRspInfoField, nRequestID: int, bIsLast: bool)->None: + def OnRspQryBondPutbackInfo(self, pBondPutbackInfo: CTORATstpBondPutbackInfoField, pRspInfo: CTORATstpRspInfoField, nRequestID: int, bIsLast: bool)->Any: ... - def OnRspQryStandardBondPosition(self, pStandardBondPosition: CTORATstpStandardBondPositionField, pRspInfo: CTORATstpRspInfoField, nRequestID: int, bIsLast: bool)->None: + def OnRspQryStandardBondPosition(self, pStandardBondPosition: CTORATstpStandardBondPositionField, pRspInfo: CTORATstpRspInfoField, nRequestID: int, bIsLast: bool)->Any: ... - def OnRspQrySpecialMarketData(self, pSpecialMarketData: CTORATstpSpecialMarketDataField, pRspInfo: CTORATstpRspInfoField, nRequestID: int, bIsLast: bool)->None: + def OnRspQrySpecialMarketData(self, pSpecialMarketData: CTORATstpSpecialMarketDataField, pRspInfo: CTORATstpRspInfoField, nRequestID: int, bIsLast: bool)->Any: ... - def OnRspQryPrematurityRepoOrder(self, pPrematurityRepoOrder: CTORATstpPrematurityRepoOrderField, pRspInfo: CTORATstpRspInfoField, nRequestID: int, bIsLast: bool)->None: + def OnRspQryPrematurityRepoOrder(self, pPrematurityRepoOrder: CTORATstpPrematurityRepoOrderField, pRspInfo: CTORATstpRspInfoField, nRequestID: int, bIsLast: bool)->Any: ... - def OnRspQryShareholderParam(self, pShareholderParam: CTORATstpShareholderParamField, pRspInfo: CTORATstpRspInfoField, nRequestID: int, bIsLast: bool)->None: + def OnRspQryShareholderParam(self, pShareholderParam: CTORATstpShareholderParamField, pRspInfo: CTORATstpRspInfoField, nRequestID: int, bIsLast: bool)->Any: ... - def OnRspQryPeripheryPositionTransferDetail(self, pPeripheryPositionTransferDetail: CTORATstpPeripheryPositionTransferDetailField, pRspInfo: CTORATstpRspInfoField, nRequestID: int, bIsLast: bool)->None: + def OnRspQryPeripheryPositionTransferDetail(self, pPeripheryPositionTransferDetail: CTORATstpPeripheryPositionTransferDetailField, pRspInfo: CTORATstpRspInfoField, nRequestID: int, bIsLast: bool)->Any: ... - def OnRspQryInvestorCondOrderLimitParam(self, pInvestorCondOrderLimitParam: CTORATstpInvestorCondOrderLimitParamField, pRspInfo: CTORATstpRspInfoField, nRequestID: int, bIsLast: bool)->None: + def OnRspQryInvestorCondOrderLimitParam(self, pInvestorCondOrderLimitParam: CTORATstpInvestorCondOrderLimitParamField, pRspInfo: CTORATstpRspInfoField, nRequestID: int, bIsLast: bool)->Any: ... - def OnRspQryCondOrder(self, pCondOrder: CTORATstpCondOrderField, pRspInfo: CTORATstpRspInfoField, nRequestID: int, bIsLast: bool)->None: + def OnRspQryCondOrder(self, pCondOrder: CTORATstpCondOrderField, pRspInfo: CTORATstpRspInfoField, nRequestID: int, bIsLast: bool)->Any: ... - def OnRspQryCondOrderAction(self, pCondOrderAction: CTORATstpCondOrderActionField, pRspInfo: CTORATstpRspInfoField, nRequestID: int, bIsLast: bool)->None: + def OnRspQryCondOrderAction(self, pCondOrderAction: CTORATstpCondOrderActionField, pRspInfo: CTORATstpRspInfoField, nRequestID: int, bIsLast: bool)->Any: ... - def OnRspQryTradingNotice(self, pTradingNotice: CTORATstpTradingNoticeField, pRspInfo: CTORATstpRspInfoField, nRequestID: int, bIsLast: bool)->None: + def OnRspQryTradingNotice(self, pTradingNotice: CTORATstpTradingNoticeField, pRspInfo: CTORATstpRspInfoField, nRequestID: int, bIsLast: bool)->Any: ... - def OnRspQryIPONumberResult(self, pIPONumberResult: CTORATstpIPONumberResultField, pRspInfo: CTORATstpRspInfoField, nRequestID: int, bIsLast: bool)->None: + def OnRspQryIPONumberResult(self, pIPONumberResult: CTORATstpIPONumberResultField, pRspInfo: CTORATstpRspInfoField, nRequestID: int, bIsLast: bool)->Any: ... - def OnRspQryIPOMatchNumberResult(self, pIPOMatchNumberResult: CTORATstpIPOMatchNumberResultField, pRspInfo: CTORATstpRspInfoField, nRequestID: int, bIsLast: bool)->None: + def OnRspQryIPOMatchNumberResult(self, pIPOMatchNumberResult: CTORATstpIPOMatchNumberResultField, pRspInfo: CTORATstpRspInfoField, nRequestID: int, bIsLast: bool)->Any: ... class CTORATstpTraderApi(): @@ -2541,23 +2541,23 @@ class CTORATstpTraderApi(): @staticmethod def GetApiVersion()->str: ... - def Release(self, )->None: + def Release(self, )->Any: ... - def Init(self, )->None: + def Init(self, )->Any: ... def Join(self, )->int: ... - def RegisterFront(self, pszFrontAddress: str)->None: + def RegisterFront(self, pszFrontAddress: str)->Any: ... - def RegisterNameServer(self, pszNsAddress: str)->None: + def RegisterNameServer(self, pszNsAddress: str)->Any: ... - def RegisterDeriveServer(self, pszDeriveAddress: str)->None: + def RegisterDeriveServer(self, pszDeriveAddress: str)->Any: ... - def RegisterSpi(self, pSpi: CTORATstpTraderSpi)->None: + def RegisterSpi(self, pSpi: CTORATstpTraderSpi)->Any: ... - def SubscribePrivateTopic(self, nResumeType: TORA_TE_RESUME_TYPE)->None: + def SubscribePrivateTopic(self, nResumeType: TORA_TE_RESUME_TYPE)->Any: ... - def SubscribePublicTopic(self, nResumeType: TORA_TE_RESUME_TYPE)->None: + def SubscribePublicTopic(self, nResumeType: TORA_TE_RESUME_TYPE)->Any: ... def ReqUserLogin(self, pReqUserLoginField: CTORATstpReqUserLoginField, nRequestID: int)->int: ... @@ -3293,17 +3293,17 @@ TORA_TSTP_SPT_ClosePriceScopeRatio: int TORA_TSTP_SPT_OpenDateLimit: int TORA_TSTP_SPT_LimitBoardShamRatio: int TORA_TSTP_SPT_CancelOrderRatio: int -def set_null(v: int)->None: +def set_null(v: int)->Any: ... -def set_null(v: float)->None: +def set_null(v: float)->Any: ... -def set_null(v: int)->None: +def set_null(v: int)->Any: ... -def set_null(v: int)->None: +def set_null(v: int)->Any: ... -def set_null(v: int)->None: +def set_null(v: int)->Any: ... -def set_null(v: str)->None: +def set_null(v: str)->Any: ... def is_null(v: int)->bool: ... diff --git a/vnpy/api/tora/vntora/custom/custom_wrappers.hpp b/vnpy/api/tora/vntora/custom/custom_wrappers.hpp new file mode 100644 index 00000000..41ecd32e --- /dev/null +++ b/vnpy/api/tora/vntora/custom/custom_wrappers.hpp @@ -0,0 +1,65 @@ +#pragma once + +#include +#include +#include + +#include +#include + +#include + +#include "../generated_files/module.hpp" + +namespace autocxxpy +{ + + //½«GBK±àÂëµÄ×Ö·û´®×ª»»ÎªUTF8 + inline std::string toUtf(const std::string &gb2312) + { +#ifdef _MSC_VER + const static std::locale loc("zh-CN"); +#else + const static std::locale loc("zh_CN.GB18030"); +#endif + + std::vector wstr(gb2312.size()); + wchar_t* wstrEnd = nullptr; + const char* gbEnd = nullptr; + std::mbstate_t state = {}; + int res = std::use_facet > + (loc).in(state, + gb2312.data(), gb2312.data() + gb2312.size(), gbEnd, + wstr.data(), wstr.data() + wstr.size(), wstrEnd); + + if (std::codecvt_base::ok == res) + { + std::wstring_convert> cutf8; + return cutf8.to_bytes(std::wstring(wstr.data(), wstrEnd)); + } + + return std::string(); + } + + template + struct get_string + { + auto operator()(string_literal &val) + { + return toUtf(val); + } + }; + + template + struct set_string + { + void operator()(string_literal &val, const char *str) + { +#ifdef _MSC_VER + strcpy_s(val, toUtf(str).data()); +#else + strcpy(val, toUtf(str).data()); +#endif + } + }; +} diff --git a/vnpy/api/tora/vntora/generated_files/generated_functions.h b/vnpy/api/tora/vntora/generated_files/generated_functions.h index 6682a63b..9e352908 100644 --- a/vnpy/api/tora/vntora/generated_files/generated_functions.h +++ b/vnpy/api/tora/vntora/generated_files/generated_functions.h @@ -8,6 +8,7 @@ #include "TORATstpTraderApi.h" #include "TORATstpUserApiDataType.h" #include "TORATstpUserApiStruct.h" +#include "custom/custom_wrappers.hpp" void generate_vntora(pybind11::module & parent); diff --git a/vnpy/api/tora/vntora/generated_files/generated_functions_0.cpp b/vnpy/api/tora/vntora/generated_files/generated_functions_0.cpp index d06d5d49..683879a5 100644 --- a/vnpy/api/tora/vntora/generated_files/generated_functions_0.cpp +++ b/vnpy/api/tora/vntora/generated_files/generated_functions_0.cpp @@ -11,6 +11,7 @@ #include "TORATstpTraderApi.h" #include "TORATstpUserApiDataType.h" #include "TORATstpUserApiStruct.h" +#include "custom/custom_wrappers.hpp" void generate_vntora(pybind11::module & parent) diff --git a/vnpy/api/tora/vntora/generated_files/generated_functions_1.cpp b/vnpy/api/tora/vntora/generated_files/generated_functions_1.cpp index 52f92ce7..b14018bc 100644 --- a/vnpy/api/tora/vntora/generated_files/generated_functions_1.cpp +++ b/vnpy/api/tora/vntora/generated_files/generated_functions_1.cpp @@ -11,6 +11,7 @@ #include "TORATstpTraderApi.h" #include "TORATstpUserApiDataType.h" #include "TORATstpUserApiStruct.h" +#include "custom/custom_wrappers.hpp" void generate_class_CTORATstpFensUserInfoField(pybind11::object & parent) diff --git a/vnpy/api/tora/vntora/generated_files/generated_functions_2.cpp b/vnpy/api/tora/vntora/generated_files/generated_functions_2.cpp index 652f398b..365fc2d3 100644 --- a/vnpy/api/tora/vntora/generated_files/generated_functions_2.cpp +++ b/vnpy/api/tora/vntora/generated_files/generated_functions_2.cpp @@ -11,6 +11,7 @@ #include "TORATstpTraderApi.h" #include "TORATstpUserApiDataType.h" #include "TORATstpUserApiStruct.h" +#include "custom/custom_wrappers.hpp" void generate_class_CTORATstpReqInquiryJZFundField(pybind11::object & parent) diff --git a/vnpy/api/tora/vntora/generated_files/generated_functions_3.cpp b/vnpy/api/tora/vntora/generated_files/generated_functions_3.cpp index 38c25de0..c60cd5de 100644 --- a/vnpy/api/tora/vntora/generated_files/generated_functions_3.cpp +++ b/vnpy/api/tora/vntora/generated_files/generated_functions_3.cpp @@ -11,6 +11,7 @@ #include "TORATstpTraderApi.h" #include "TORATstpUserApiDataType.h" #include "TORATstpUserApiStruct.h" +#include "custom/custom_wrappers.hpp" void generate_class_CTORATstpPeripheryPositionTransferDetailField(pybind11::object & parent) diff --git a/vnpy/api/tora/vntora/generated_files/generated_functions_4.cpp b/vnpy/api/tora/vntora/generated_files/generated_functions_4.cpp index 696d5699..e67015b8 100644 --- a/vnpy/api/tora/vntora/generated_files/generated_functions_4.cpp +++ b/vnpy/api/tora/vntora/generated_files/generated_functions_4.cpp @@ -11,6 +11,7 @@ #include "TORATstpTraderApi.h" #include "TORATstpUserApiDataType.h" #include "TORATstpUserApiStruct.h" +#include "custom/custom_wrappers.hpp" void generate_class_CTORATstpBusinessUnitField(pybind11::object & parent) diff --git a/vnpy/api/tora/vntora/generated_files/generated_functions_5.cpp b/vnpy/api/tora/vntora/generated_files/generated_functions_5.cpp index 5ac4c209..8ca07fd8 100644 --- a/vnpy/api/tora/vntora/generated_files/generated_functions_5.cpp +++ b/vnpy/api/tora/vntora/generated_files/generated_functions_5.cpp @@ -11,6 +11,7 @@ #include "TORATstpTraderApi.h" #include "TORATstpUserApiDataType.h" #include "TORATstpUserApiStruct.h" +#include "custom/custom_wrappers.hpp" void generate_class_CTORATstpStandardBondPositionField(pybind11::object & parent) diff --git a/vnpy/api/tora/vntora/generated_files/generated_functions_6.cpp b/vnpy/api/tora/vntora/generated_files/generated_functions_6.cpp index 3c2d2a87..c9eb96c4 100644 --- a/vnpy/api/tora/vntora/generated_files/generated_functions_6.cpp +++ b/vnpy/api/tora/vntora/generated_files/generated_functions_6.cpp @@ -11,6 +11,7 @@ #include "TORATstpTraderApi.h" #include "TORATstpUserApiDataType.h" #include "TORATstpUserApiStruct.h" +#include "custom/custom_wrappers.hpp" void generate_class_CTORATstpMdApi(pybind11::object & parent) diff --git a/vnpy/api/tora/vntora/generated_files/generated_functions_7.cpp b/vnpy/api/tora/vntora/generated_files/generated_functions_7.cpp index 342c35ce..4a76585b 100644 --- a/vnpy/api/tora/vntora/generated_files/generated_functions_7.cpp +++ b/vnpy/api/tora/vntora/generated_files/generated_functions_7.cpp @@ -11,6 +11,7 @@ #include "TORATstpTraderApi.h" #include "TORATstpUserApiDataType.h" #include "TORATstpUserApiStruct.h" +#include "custom/custom_wrappers.hpp" void generate_class_CTORATstpTraderApi(pybind11::object & parent) diff --git a/vnpy/api/tora/vntora/generated_files/generated_functions_8.cpp b/vnpy/api/tora/vntora/generated_files/generated_functions_8.cpp index 0d9f2b57..875e2a42 100644 --- a/vnpy/api/tora/vntora/generated_files/generated_functions_8.cpp +++ b/vnpy/api/tora/vntora/generated_files/generated_functions_8.cpp @@ -11,6 +11,7 @@ #include "TORATstpTraderApi.h" #include "TORATstpUserApiDataType.h" #include "TORATstpUserApiStruct.h" +#include "custom/custom_wrappers.hpp" void generate_enum_TORA_TE_RESUME_TYPE(pybind11::object & parent) diff --git a/vnpy/api/tora/vntora/generated_files/module.cpp b/vnpy/api/tora/vntora/generated_files/module.cpp index dbe167b2..62cf8374 100644 --- a/vnpy/api/tora/vntora/generated_files/module.cpp +++ b/vnpy/api/tora/vntora/generated_files/module.cpp @@ -11,6 +11,7 @@ #include "TORATstpTraderApi.h" #include "TORATstpUserApiDataType.h" #include "TORATstpUserApiStruct.h" +#include "custom/custom_wrappers.hpp" autocxxpy::cross_assign module_vntora::cross; @@ -26,7 +27,7 @@ void init_dispatcher(pybind11::module &m) m.def("set_async_callback_exception_handler", &autocxxpy::async_callback_exception_handler::set_handler); pybind11::class_ c(m, "AsyncDispatchException"); - c.def_property("what", &autocxxpy::async_dispatch_exception::what, nullptr); + c.def_property_readonly("what", &autocxxpy::async_dispatch_exception::what_mutable); c.def_readonly("instance", &autocxxpy::async_dispatch_exception::instance); c.def_readonly("function_name", &autocxxpy::async_dispatch_exception::function_name); diff --git a/vnpy/api/tora/vntora/generated_files/wrappers.hpp b/vnpy/api/tora/vntora/generated_files/wrappers.hpp index 9677f336..24384e53 100644 --- a/vnpy/api/tora/vntora/generated_files/wrappers.hpp +++ b/vnpy/api/tora/vntora/generated_files/wrappers.hpp @@ -9,6 +9,7 @@ #include "TORATstpTraderApi.h" #include "TORATstpUserApiDataType.h" #include "TORATstpUserApiStruct.h" +#include "custom/custom_wrappers.hpp" diff --git a/vnpy/api/tora/vntora/include/autocxxpy/callback_wrapper.hpp b/vnpy/api/tora/vntora/include/autocxxpy/callback_wrapper.hpp index f7994cf7..685b2156 100644 --- a/vnpy/api/tora/vntora/include/autocxxpy/callback_wrapper.hpp +++ b/vnpy/api/tora/vntora/include/autocxxpy/callback_wrapper.hpp @@ -3,6 +3,7 @@ #include #include #include +#include #include "./brigand.hpp" @@ -85,7 +86,9 @@ namespace autocxxpy {} pybind11::object instance; std::string function_name; - inline const char* what() noexcept + + // mutable version of what() for pybind11 to make it happy + inline const char* what_mutable() noexcept { return std::exception::what(); } @@ -104,11 +107,20 @@ namespace autocxxpy { custom_handler(e); } - catch (pybind11::error_already_set & e) + catch (pybind11::error_already_set & e2) { - std::cout << "error while calling custom async dispatcher:%s" << e.what() << std::endl; + std::cerr << "error while calling custom async callback exception handler:" << std::endl; + std::cerr << e2.what() << std::endl; + std::cerr << "while handling following exception:" << std::endl; + std::cerr << e.what() << std::endl; } } + else + { + std::cerr << e.what() << std::endl; + std::cerr << "custom async callback exception handler not set." << std::endl; + std::cerr << "Call set_async_callback_exception_handler() to set it. " << std::endl; + } } inline static void set_handler(const handler_type& handler) diff --git a/vnpy/api/tora/vntora/vntora.vcxproj b/vnpy/api/tora/vntora/vntora.vcxproj index be2927f2..3f98d39c 100644 --- a/vnpy/api/tora/vntora/vntora.vcxproj +++ b/vnpy/api/tora/vntora/vntora.vcxproj @@ -30,37 +30,48 @@ + + + + + + + + + + 16.0 {24BBDEB3-6AA7-43EE-A03C-AE527AB1B297} Win32Proj vntora - 10.0 + 10.0.17763.0 + x64 DynamicLibrary true - v142 + v141 Unicode DynamicLibrary false - v142 + v141 true Unicode DynamicLibrary true - v142 + v141 Unicode DynamicLibrary false - v142 + v141 true Unicode @@ -117,10 +128,11 @@ Level3 Disabled true - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + _SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) true true stdcpp17 + /bigobj %(AdditionalOptions) Console @@ -135,10 +147,11 @@ Level3 Disabled true - _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + _SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) true true stdcpp17 + /bigobj %(AdditionalOptions) Console @@ -155,11 +168,12 @@ true true true - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + _SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) true true stdcpp17 MultiThreaded + /bigobj %(AdditionalOptions) Console @@ -178,11 +192,12 @@ true true true - NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + _SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) true true stdcpp17 MultiThreaded + /bigobj %(AdditionalOptions) Console diff --git a/vnpy/api/tora/vntora/vntora.vcxproj.filters b/vnpy/api/tora/vntora/vntora.vcxproj.filters index 4f4971e0..92167a4f 100644 --- a/vnpy/api/tora/vntora/vntora.vcxproj.filters +++ b/vnpy/api/tora/vntora/vntora.vcxproj.filters @@ -46,4 +46,30 @@ Source Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + \ No newline at end of file