ctpbee-opt-api 0.1.0__cp310-cp310-win_amd64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- ctpbee_api/__init__.py +17 -0
- ctpbee_api/ctp/__init__.py +3 -0
- ctpbee_api/ctp/ctp_constant.py +1253 -0
- ctpbee_api/ctp/generator/concat.py +93 -0
- ctpbee_api/ctp/generator/const.py +325 -0
- ctpbee_api/ctp/generator/ctp_constant.py +1274 -0
- ctpbee_api/ctp/generator/ctp_md_header_define.h +13 -0
- ctpbee_api/ctp/generator/ctp_md_header_function.h +6 -0
- ctpbee_api/ctp/generator/ctp_md_header_on.h +26 -0
- ctpbee_api/ctp/generator/ctp_md_header_process.h +26 -0
- ctpbee_api/ctp/generator/ctp_md_source_function.cpp +42 -0
- ctpbee_api/ctp/generator/ctp_md_source_module.cpp +18 -0
- ctpbee_api/ctp/generator/ctp_md_source_on.cpp +156 -0
- ctpbee_api/ctp/generator/ctp_md_source_process.cpp +282 -0
- ctpbee_api/ctp/generator/ctp_md_source_switch.cpp +78 -0
- ctpbee_api/ctp/generator/ctp_md_source_task.cpp +211 -0
- ctpbee_api/ctp/generator/ctp_struct.py +5640 -0
- ctpbee_api/ctp/generator/ctp_td_header_define.h +130 -0
- ctpbee_api/ctp/generator/ctp_td_header_function.h +174 -0
- ctpbee_api/ctp/generator/ctp_td_header_on.h +260 -0
- ctpbee_api/ctp/generator/ctp_td_header_process.h +260 -0
- ctpbee_api/ctp/generator/ctp_td_source_function.cpp +1456 -0
- ctpbee_api/ctp/generator/ctp_td_source_module.cpp +222 -0
- ctpbee_api/ctp/generator/ctp_td_source_on.cpp +1572 -0
- ctpbee_api/ctp/generator/ctp_td_source_process.cpp +5472 -0
- ctpbee_api/ctp/generator/ctp_td_source_switch.cpp +780 -0
- ctpbee_api/ctp/generator/ctp_td_source_task.cpp +2444 -0
- ctpbee_api/ctp/generator/ctp_typedef.py +800 -0
- ctpbee_api/ctp/generator/generate_api_functions.py +345 -0
- ctpbee_api/ctp/generator/generate_data_type.py +76 -0
- ctpbee_api/ctp/generator/generate_struct.py +84 -0
- ctpbee_api/ctp/include/mac/ctp/ThostFtdcMdApi.h +168 -0
- ctpbee_api/ctp/include/mac/ctp/ThostFtdcTraderApi.h +770 -0
- ctpbee_api/ctp/include/mac/ctp/ThostFtdcUserApiDataType.h +6878 -0
- ctpbee_api/ctp/include/mac/ctp/ThostFtdcUserApiStruct.h +10915 -0
- ctpbee_api/ctp/include/mac/pybind11/attr.h +690 -0
- ctpbee_api/ctp/include/mac/pybind11/buffer_info.h +208 -0
- ctpbee_api/ctp/include/mac/pybind11/cast.h +1704 -0
- ctpbee_api/ctp/include/mac/pybind11/chrono.h +225 -0
- ctpbee_api/ctp/include/mac/pybind11/common.h +2 -0
- ctpbee_api/ctp/include/mac/pybind11/complex.h +74 -0
- ctpbee_api/ctp/include/mac/pybind11/detail/class.h +743 -0
- ctpbee_api/ctp/include/mac/pybind11/detail/common.h +1255 -0
- ctpbee_api/ctp/include/mac/pybind11/detail/descr.h +171 -0
- ctpbee_api/ctp/include/mac/pybind11/detail/init.h +434 -0
- ctpbee_api/ctp/include/mac/pybind11/detail/internals.h +656 -0
- ctpbee_api/ctp/include/mac/pybind11/detail/type_caster_base.h +1177 -0
- ctpbee_api/ctp/include/mac/pybind11/detail/typeid.h +65 -0
- ctpbee_api/ctp/include/mac/pybind11/eigen/common.h +9 -0
- ctpbee_api/ctp/include/mac/pybind11/eigen/matrix.h +714 -0
- ctpbee_api/ctp/include/mac/pybind11/eigen/tensor.h +516 -0
- ctpbee_api/ctp/include/mac/pybind11/eigen.h +12 -0
- ctpbee_api/ctp/include/mac/pybind11/embed.h +316 -0
- ctpbee_api/ctp/include/mac/pybind11/eval.h +156 -0
- ctpbee_api/ctp/include/mac/pybind11/functional.h +137 -0
- ctpbee_api/ctp/include/mac/pybind11/gil.h +239 -0
- ctpbee_api/ctp/include/mac/pybind11/iostream.h +265 -0
- ctpbee_api/ctp/include/mac/pybind11/numpy.h +1998 -0
- ctpbee_api/ctp/include/mac/pybind11/operators.h +202 -0
- ctpbee_api/ctp/include/mac/pybind11/options.h +92 -0
- ctpbee_api/ctp/include/mac/pybind11/pybind11.h +2890 -0
- ctpbee_api/ctp/include/mac/pybind11/pytypes.h +2557 -0
- ctpbee_api/ctp/include/mac/pybind11/stl/filesystem.h +116 -0
- ctpbee_api/ctp/include/mac/pybind11/stl.h +447 -0
- ctpbee_api/ctp/include/mac/pybind11/stl_bind.h +851 -0
- ctpbee_api/ctp/include/mac/pybind11/type_caster_pyobject_ptr.h +61 -0
- ctpbee_api/ctp/include/new/ctp/ThostFtdcMdApi.h +168 -0
- ctpbee_api/ctp/include/new/ctp/ThostFtdcTraderApi.h +770 -0
- ctpbee_api/ctp/include/new/ctp/ThostFtdcUserApiDataType.h +6878 -0
- ctpbee_api/ctp/include/new/ctp/ThostFtdcUserApiStruct.h +10915 -0
- ctpbee_api/ctp/include/new/pybind11/attr.h +690 -0
- ctpbee_api/ctp/include/new/pybind11/buffer_info.h +208 -0
- ctpbee_api/ctp/include/new/pybind11/cast.h +1704 -0
- ctpbee_api/ctp/include/new/pybind11/chrono.h +225 -0
- ctpbee_api/ctp/include/new/pybind11/common.h +2 -0
- ctpbee_api/ctp/include/new/pybind11/complex.h +74 -0
- ctpbee_api/ctp/include/new/pybind11/detail/class.h +743 -0
- ctpbee_api/ctp/include/new/pybind11/detail/common.h +1255 -0
- ctpbee_api/ctp/include/new/pybind11/detail/descr.h +171 -0
- ctpbee_api/ctp/include/new/pybind11/detail/init.h +434 -0
- ctpbee_api/ctp/include/new/pybind11/detail/internals.h +656 -0
- ctpbee_api/ctp/include/new/pybind11/detail/type_caster_base.h +1177 -0
- ctpbee_api/ctp/include/new/pybind11/detail/typeid.h +65 -0
- ctpbee_api/ctp/include/new/pybind11/eigen/common.h +9 -0
- ctpbee_api/ctp/include/new/pybind11/eigen/matrix.h +714 -0
- ctpbee_api/ctp/include/new/pybind11/eigen/tensor.h +516 -0
- ctpbee_api/ctp/include/new/pybind11/eigen.h +12 -0
- ctpbee_api/ctp/include/new/pybind11/embed.h +316 -0
- ctpbee_api/ctp/include/new/pybind11/eval.h +156 -0
- ctpbee_api/ctp/include/new/pybind11/functional.h +137 -0
- ctpbee_api/ctp/include/new/pybind11/gil.h +239 -0
- ctpbee_api/ctp/include/new/pybind11/iostream.h +265 -0
- ctpbee_api/ctp/include/new/pybind11/numpy.h +1998 -0
- ctpbee_api/ctp/include/new/pybind11/operators.h +202 -0
- ctpbee_api/ctp/include/new/pybind11/options.h +92 -0
- ctpbee_api/ctp/include/new/pybind11/pybind11.h +2890 -0
- ctpbee_api/ctp/include/new/pybind11/pytypes.h +2557 -0
- ctpbee_api/ctp/include/new/pybind11/stl/filesystem.h +116 -0
- ctpbee_api/ctp/include/new/pybind11/stl.h +447 -0
- ctpbee_api/ctp/include/new/pybind11/stl_bind.h +851 -0
- ctpbee_api/ctp/include/new/pybind11/type_caster_pyobject_ptr.h +61 -0
- ctpbee_api/ctp/include/previous/ctp/ThostFtdcMdApi.h +168 -0
- ctpbee_api/ctp/include/previous/ctp/ThostFtdcTraderApi.h +770 -0
- ctpbee_api/ctp/include/previous/ctp/ThostFtdcUserApiDataType.h +6878 -0
- ctpbee_api/ctp/include/previous/ctp/ThostFtdcUserApiStruct.h +10915 -0
- ctpbee_api/ctp/include/previous/pybind11/attr.h +489 -0
- ctpbee_api/ctp/include/previous/pybind11/buffer_info.h +108 -0
- ctpbee_api/ctp/include/previous/pybind11/cast.h +2067 -0
- ctpbee_api/ctp/include/previous/pybind11/chrono.h +162 -0
- ctpbee_api/ctp/include/previous/pybind11/common.h +2 -0
- ctpbee_api/ctp/include/previous/pybind11/complex.h +61 -0
- ctpbee_api/ctp/include/previous/pybind11/detail/class.h +626 -0
- ctpbee_api/ctp/include/previous/pybind11/detail/common.h +803 -0
- ctpbee_api/ctp/include/previous/pybind11/detail/descr.h +185 -0
- ctpbee_api/ctp/include/previous/pybind11/detail/init.h +335 -0
- ctpbee_api/ctp/include/previous/pybind11/detail/internals.h +285 -0
- ctpbee_api/ctp/include/previous/pybind11/detail/typeid.h +53 -0
- ctpbee_api/ctp/include/previous/pybind11/eigen.h +604 -0
- ctpbee_api/ctp/include/previous/pybind11/embed.h +194 -0
- ctpbee_api/ctp/include/previous/pybind11/eval.h +117 -0
- ctpbee_api/ctp/include/previous/pybind11/functional.h +85 -0
- ctpbee_api/ctp/include/previous/pybind11/iostream.h +200 -0
- ctpbee_api/ctp/include/previous/pybind11/numpy.h +1601 -0
- ctpbee_api/ctp/include/previous/pybind11/operators.h +168 -0
- ctpbee_api/ctp/include/previous/pybind11/options.h +65 -0
- ctpbee_api/ctp/include/previous/pybind11/pybind11.h +1965 -0
- ctpbee_api/ctp/include/previous/pybind11/pytypes.h +1332 -0
- ctpbee_api/ctp/include/previous/pybind11/stl.h +376 -0
- ctpbee_api/ctp/include/previous/pybind11/stl_bind.h +599 -0
- ctpbee_api/ctp/libs/libcomunicationkey.a +0 -0
- ctpbee_api/ctp/libs/libcrypto.a +0 -0
- ctpbee_api/ctp/libs/libssl.a +0 -0
- ctpbee_api/ctp/libs/thostmduserapi_se.lib +0 -0
- ctpbee_api/ctp/libs/thosttraderapi_se.lib +0 -0
- ctpbee_api/ctp/libthostmduserapi_se.so +0 -0
- ctpbee_api/ctp/libthosttraderapi_se.so +0 -0
- ctpbee_api/ctp/thostmduserapi_se.dll +0 -0
- ctpbee_api/ctp/thosttraderapi_se.dll +0 -0
- ctpbee_api/ctp/vnctp/vnctp.h +189 -0
- ctpbee_api/ctp/vnctp/vnctp.sln +41 -0
- ctpbee_api/ctp/vnctp/vnctpmd/dllmain.cpp +19 -0
- ctpbee_api/ctp/vnctp/vnctpmd/stdafx.cpp +1 -0
- ctpbee_api/ctp/vnctp/vnctpmd/stdafx.h +17 -0
- ctpbee_api/ctp/vnctp/vnctpmd/targetver.h +8 -0
- ctpbee_api/ctp/vnctp/vnctpmd/vnctpmd.cpp +953 -0
- ctpbee_api/ctp/vnctp/vnctpmd/vnctpmd.h +209 -0
- ctpbee_api/ctp/vnctp/vnctpmd/vnctpmd.vcxproj +200 -0
- ctpbee_api/ctp/vnctp/vnctpmd/vnctpmd.vcxproj.filters +54 -0
- ctpbee_api/ctp/vnctp/vnctpmd/vnctpmd.vcxproj.user +4 -0
- ctpbee_api/ctp/vnctp/vnctptd/dllmain.cpp +19 -0
- ctpbee_api/ctp/vnctp/vnctptd/stdafx.cpp +1 -0
- ctpbee_api/ctp/vnctp/vnctptd/stdafx.h +16 -0
- ctpbee_api/ctp/vnctp/vnctptd/targetver.h +8 -0
- ctpbee_api/ctp/vnctp/vnctptd/vnctptd.cpp +12148 -0
- ctpbee_api/ctp/vnctp/vnctptd/vnctptd.h +1329 -0
- ctpbee_api/ctp/vnctp/vnctptd/vnctptd.vcxproj +198 -0
- ctpbee_api/ctp/vnctp/vnctptd/vnctptd.vcxproj.filters +54 -0
- ctpbee_api/ctp/vnctp/vnctptd/vnctptd.vcxproj.user +4 -0
- ctpbee_api/ctp/vnctpmd.cp310-win_amd64.pyd +0 -0
- ctpbee_api/ctp/vnctptd.cp310-win_amd64.pyd +0 -0
- ctpbee_api/ctp_mini/__init__.py +3 -0
- ctpbee_api/ctp_mini/generator/generate_api_functions.py +343 -0
- ctpbee_api/ctp_mini/generator/generate_data_type.py +76 -0
- ctpbee_api/ctp_mini/generator/generate_struct.py +85 -0
- ctpbee_api/ctp_mini/generator/mini_constant.py +1186 -0
- ctpbee_api/ctp_mini/generator/mini_md_header_define.h +13 -0
- ctpbee_api/ctp_mini/generator/mini_md_header_function.h +4 -0
- ctpbee_api/ctp_mini/generator/mini_md_header_on.h +26 -0
- ctpbee_api/ctp_mini/generator/mini_md_header_process.h +26 -0
- ctpbee_api/ctp_mini/generator/mini_md_source_function.cpp +29 -0
- ctpbee_api/ctp_mini/generator/mini_md_source_module.cpp +17 -0
- ctpbee_api/ctp_mini/generator/mini_md_source_on.cpp +156 -0
- ctpbee_api/ctp_mini/generator/mini_md_source_process.cpp +264 -0
- ctpbee_api/ctp_mini/generator/mini_md_source_switch.cpp +78 -0
- ctpbee_api/ctp_mini/generator/mini_md_source_task.cpp +203 -0
- ctpbee_api/ctp_mini/generator/mini_struct.py +4599 -0
- ctpbee_api/ctp_mini/generator/mini_td_header_define.h +63 -0
- ctpbee_api/ctp_mini/generator/mini_td_header_function.h +84 -0
- ctpbee_api/ctp_mini/generator/mini_td_header_on.h +126 -0
- ctpbee_api/ctp_mini/generator/mini_td_header_process.h +126 -0
- ctpbee_api/ctp_mini/generator/mini_td_source_function.cpp +663 -0
- ctpbee_api/ctp_mini/generator/mini_td_source_module.cpp +107 -0
- ctpbee_api/ctp_mini/generator/mini_td_source_on.cpp +756 -0
- ctpbee_api/ctp_mini/generator/mini_td_source_process.cpp +2492 -0
- ctpbee_api/ctp_mini/generator/mini_td_source_switch.cpp +378 -0
- ctpbee_api/ctp_mini/generator/mini_td_source_task.cpp +1193 -0
- ctpbee_api/ctp_mini/generator/mini_typedef.py +755 -0
- ctpbee_api/ctp_mini/generator/package/vnminimd.cpp +886 -0
- ctpbee_api/ctp_mini/generator/package/vnminimd.h +205 -0
- ctpbee_api/ctp_mini/include/new/mini/ThostFtdcMdApi.h +148 -0
- ctpbee_api/ctp_mini/include/new/mini/ThostFtdcTraderApi.h +419 -0
- ctpbee_api/ctp_mini/include/new/mini/ThostFtdcUserApiDataType.h +6458 -0
- ctpbee_api/ctp_mini/include/new/mini/ThostFtdcUserApiStruct.h +8890 -0
- ctpbee_api/ctp_mini/include/new/pybind11/attr.h +690 -0
- ctpbee_api/ctp_mini/include/new/pybind11/buffer_info.h +208 -0
- ctpbee_api/ctp_mini/include/new/pybind11/cast.h +1704 -0
- ctpbee_api/ctp_mini/include/new/pybind11/chrono.h +225 -0
- ctpbee_api/ctp_mini/include/new/pybind11/common.h +2 -0
- ctpbee_api/ctp_mini/include/new/pybind11/complex.h +74 -0
- ctpbee_api/ctp_mini/include/new/pybind11/detail/class.h +743 -0
- ctpbee_api/ctp_mini/include/new/pybind11/detail/common.h +1255 -0
- ctpbee_api/ctp_mini/include/new/pybind11/detail/descr.h +171 -0
- ctpbee_api/ctp_mini/include/new/pybind11/detail/init.h +434 -0
- ctpbee_api/ctp_mini/include/new/pybind11/detail/internals.h +656 -0
- ctpbee_api/ctp_mini/include/new/pybind11/detail/type_caster_base.h +1177 -0
- ctpbee_api/ctp_mini/include/new/pybind11/detail/typeid.h +65 -0
- ctpbee_api/ctp_mini/include/new/pybind11/eigen/common.h +9 -0
- ctpbee_api/ctp_mini/include/new/pybind11/eigen/matrix.h +714 -0
- ctpbee_api/ctp_mini/include/new/pybind11/eigen/tensor.h +516 -0
- ctpbee_api/ctp_mini/include/new/pybind11/eigen.h +12 -0
- ctpbee_api/ctp_mini/include/new/pybind11/embed.h +316 -0
- ctpbee_api/ctp_mini/include/new/pybind11/eval.h +156 -0
- ctpbee_api/ctp_mini/include/new/pybind11/functional.h +137 -0
- ctpbee_api/ctp_mini/include/new/pybind11/gil.h +239 -0
- ctpbee_api/ctp_mini/include/new/pybind11/iostream.h +265 -0
- ctpbee_api/ctp_mini/include/new/pybind11/numpy.h +1998 -0
- ctpbee_api/ctp_mini/include/new/pybind11/operators.h +202 -0
- ctpbee_api/ctp_mini/include/new/pybind11/options.h +92 -0
- ctpbee_api/ctp_mini/include/new/pybind11/pybind11.h +2890 -0
- ctpbee_api/ctp_mini/include/new/pybind11/pytypes.h +2557 -0
- ctpbee_api/ctp_mini/include/new/pybind11/stl/filesystem.h +116 -0
- ctpbee_api/ctp_mini/include/new/pybind11/stl.h +447 -0
- ctpbee_api/ctp_mini/include/new/pybind11/stl_bind.h +851 -0
- ctpbee_api/ctp_mini/include/new/pybind11/type_caster_pyobject_ptr.h +61 -0
- ctpbee_api/ctp_mini/include/previous/mini/ThostFtdcMdApi.h +148 -0
- ctpbee_api/ctp_mini/include/previous/mini/ThostFtdcTraderApi.h +419 -0
- ctpbee_api/ctp_mini/include/previous/mini/ThostFtdcUserApiDataType.h +6458 -0
- ctpbee_api/ctp_mini/include/previous/mini/ThostFtdcUserApiStruct.h +8890 -0
- ctpbee_api/ctp_mini/include/previous/pybind11/attr.h +489 -0
- ctpbee_api/ctp_mini/include/previous/pybind11/buffer_info.h +108 -0
- ctpbee_api/ctp_mini/include/previous/pybind11/cast.h +2067 -0
- ctpbee_api/ctp_mini/include/previous/pybind11/chrono.h +162 -0
- ctpbee_api/ctp_mini/include/previous/pybind11/common.h +2 -0
- ctpbee_api/ctp_mini/include/previous/pybind11/complex.h +61 -0
- ctpbee_api/ctp_mini/include/previous/pybind11/detail/class.h +626 -0
- ctpbee_api/ctp_mini/include/previous/pybind11/detail/common.h +803 -0
- ctpbee_api/ctp_mini/include/previous/pybind11/detail/descr.h +185 -0
- ctpbee_api/ctp_mini/include/previous/pybind11/detail/init.h +335 -0
- ctpbee_api/ctp_mini/include/previous/pybind11/detail/internals.h +285 -0
- ctpbee_api/ctp_mini/include/previous/pybind11/detail/typeid.h +53 -0
- ctpbee_api/ctp_mini/include/previous/pybind11/eigen.h +604 -0
- ctpbee_api/ctp_mini/include/previous/pybind11/embed.h +194 -0
- ctpbee_api/ctp_mini/include/previous/pybind11/eval.h +117 -0
- ctpbee_api/ctp_mini/include/previous/pybind11/functional.h +85 -0
- ctpbee_api/ctp_mini/include/previous/pybind11/iostream.h +200 -0
- ctpbee_api/ctp_mini/include/previous/pybind11/numpy.h +1601 -0
- ctpbee_api/ctp_mini/include/previous/pybind11/operators.h +168 -0
- ctpbee_api/ctp_mini/include/previous/pybind11/options.h +65 -0
- ctpbee_api/ctp_mini/include/previous/pybind11/pybind11.h +1965 -0
- ctpbee_api/ctp_mini/include/previous/pybind11/pytypes.h +1332 -0
- ctpbee_api/ctp_mini/include/previous/pybind11/stl.h +376 -0
- ctpbee_api/ctp_mini/include/previous/pybind11/stl_bind.h +599 -0
- ctpbee_api/ctp_mini/libs/thostmduserapi.lib +0 -0
- ctpbee_api/ctp_mini/libs/thosttraderapi.lib +0 -0
- ctpbee_api/ctp_mini/libthostmduserapi.so +0 -0
- ctpbee_api/ctp_mini/libthosttraderapi.so +0 -0
- ctpbee_api/ctp_mini/mini_constant.py +1186 -0
- ctpbee_api/ctp_mini/thostmduserapi.dll +0 -0
- ctpbee_api/ctp_mini/thosttraderapi.dll +0 -0
- ctpbee_api/ctp_mini/vnctp_mini/vnctp_mini.h +146 -0
- ctpbee_api/ctp_mini/vnctp_mini/vnctp_mini.sln +41 -0
- ctpbee_api/ctp_mini/vnctp_mini/vnctp_minimd/dllmain.cpp +0 -0
- ctpbee_api/ctp_mini/vnctp_mini/vnctp_minimd/stdafx.cpp +0 -0
- ctpbee_api/ctp_mini/vnctp_mini/vnctp_minimd/stdafx.h +0 -0
- ctpbee_api/ctp_mini/vnctp_mini/vnctp_minimd/targetver.h +0 -0
- ctpbee_api/ctp_mini/vnctp_mini/vnctp_minimd/vnctp_minimd.cpp +886 -0
- ctpbee_api/ctp_mini/vnctp_mini/vnctp_minimd/vnctp_minimd.h +203 -0
- ctpbee_api/ctp_mini/vnctp_mini/vnctp_minimd/vnctp_minimd.vcxproj +183 -0
- ctpbee_api/ctp_mini/vnctp_mini/vnctp_minimd/vnctp_minimd.vcxproj.filters +54 -0
- ctpbee_api/ctp_mini/vnctp_mini/vnctp_minimd/vnctp_minimd.vcxproj.user +4 -0
- ctpbee_api/ctp_mini/vnctp_mini/vnctp_minitd/dllmain.cpp +0 -0
- ctpbee_api/ctp_mini/vnctp_mini/vnctp_minitd/stdafx.cpp +0 -0
- ctpbee_api/ctp_mini/vnctp_mini/vnctp_minitd/stdafx.h +0 -0
- ctpbee_api/ctp_mini/vnctp_mini/vnctp_minitd/targetver.h +0 -0
- ctpbee_api/ctp_mini/vnctp_mini/vnctp_minitd/vnctp_minitd.cpp +5716 -0
- ctpbee_api/ctp_mini/vnctp_mini/vnctp_minitd/vnctp_minitd.h +680 -0
- ctpbee_api/ctp_mini/vnctp_mini/vnctp_minitd/vnctp_minitd.vcxproj +180 -0
- ctpbee_api/ctp_mini/vnctp_mini/vnctp_minitd/vnctp_minitd.vcxproj.filters +54 -0
- ctpbee_api/ctp_mini/vnctp_mini/vnctp_minitd/vnctp_minitd.vcxproj.user +4 -0
- ctpbee_api/ctp_mini/vnctp_minimd.cp310-win_amd64.pyd +0 -0
- ctpbee_api/ctp_mini/vnctp_minitd.cp310-win_amd64.pyd +0 -0
- ctpbee_api/ctp_mini/vnctp_minitd.lib +0 -0
- ctpbee_api/rohon/RohonBaseV64.dll +0 -0
- ctpbee_api/rohon/WinDataCollect.dll +0 -0
- ctpbee_api/rohon/__init__.py +3 -0
- ctpbee_api/rohon/generator/generate_api_functions.py +348 -0
- ctpbee_api/rohon/generator/generate_data_type.py +76 -0
- ctpbee_api/rohon/generator/generate_struct.py +84 -0
- ctpbee_api/rohon/generator/rohon_constant.py +1242 -0
- ctpbee_api/rohon/generator/rohon_md_header_define.h +13 -0
- ctpbee_api/rohon/generator/rohon_md_header_function.h +6 -0
- ctpbee_api/rohon/generator/rohon_md_header_on.h +26 -0
- ctpbee_api/rohon/generator/rohon_md_header_process.h +26 -0
- ctpbee_api/rohon/generator/rohon_md_source_function.cpp +40 -0
- ctpbee_api/rohon/generator/rohon_md_source_module.cpp +18 -0
- ctpbee_api/rohon/generator/rohon_md_source_on.cpp +156 -0
- ctpbee_api/rohon/generator/rohon_md_source_process.cpp +271 -0
- ctpbee_api/rohon/generator/rohon_md_source_switch.cpp +78 -0
- ctpbee_api/rohon/generator/rohon_md_source_task.cpp +211 -0
- ctpbee_api/rohon/generator/rohon_struct.py +4958 -0
- ctpbee_api/rohon/generator/rohon_td_header_define.h +125 -0
- ctpbee_api/rohon/generator/rohon_td_header_function.h +164 -0
- ctpbee_api/rohon/generator/rohon_td_header_on.h +250 -0
- ctpbee_api/rohon/generator/rohon_td_header_process.h +250 -0
- ctpbee_api/rohon/generator/rohon_td_source_function.cpp +1338 -0
- ctpbee_api/rohon/generator/rohon_td_source_module.cpp +209 -0
- ctpbee_api/rohon/generator/rohon_td_source_on.cpp +1500 -0
- ctpbee_api/rohon/generator/rohon_td_source_process.cpp +5125 -0
- ctpbee_api/rohon/generator/rohon_td_source_switch.cpp +750 -0
- ctpbee_api/rohon/generator/rohon_td_source_task.cpp +2339 -0
- ctpbee_api/rohon/generator/rohon_typedef.py +781 -0
- ctpbee_api/rohon/include/new/pybind11/attr.h +690 -0
- ctpbee_api/rohon/include/new/pybind11/buffer_info.h +208 -0
- ctpbee_api/rohon/include/new/pybind11/cast.h +1704 -0
- ctpbee_api/rohon/include/new/pybind11/chrono.h +225 -0
- ctpbee_api/rohon/include/new/pybind11/common.h +2 -0
- ctpbee_api/rohon/include/new/pybind11/complex.h +74 -0
- ctpbee_api/rohon/include/new/pybind11/detail/class.h +743 -0
- ctpbee_api/rohon/include/new/pybind11/detail/common.h +1255 -0
- ctpbee_api/rohon/include/new/pybind11/detail/descr.h +171 -0
- ctpbee_api/rohon/include/new/pybind11/detail/init.h +434 -0
- ctpbee_api/rohon/include/new/pybind11/detail/internals.h +656 -0
- ctpbee_api/rohon/include/new/pybind11/detail/type_caster_base.h +1177 -0
- ctpbee_api/rohon/include/new/pybind11/detail/typeid.h +65 -0
- ctpbee_api/rohon/include/new/pybind11/eigen/common.h +9 -0
- ctpbee_api/rohon/include/new/pybind11/eigen/matrix.h +714 -0
- ctpbee_api/rohon/include/new/pybind11/eigen/tensor.h +516 -0
- ctpbee_api/rohon/include/new/pybind11/eigen.h +12 -0
- ctpbee_api/rohon/include/new/pybind11/embed.h +316 -0
- ctpbee_api/rohon/include/new/pybind11/eval.h +156 -0
- ctpbee_api/rohon/include/new/pybind11/functional.h +137 -0
- ctpbee_api/rohon/include/new/pybind11/gil.h +239 -0
- ctpbee_api/rohon/include/new/pybind11/iostream.h +265 -0
- ctpbee_api/rohon/include/new/pybind11/numpy.h +1998 -0
- ctpbee_api/rohon/include/new/pybind11/operators.h +202 -0
- ctpbee_api/rohon/include/new/pybind11/options.h +92 -0
- ctpbee_api/rohon/include/new/pybind11/pybind11.h +2890 -0
- ctpbee_api/rohon/include/new/pybind11/pytypes.h +2557 -0
- ctpbee_api/rohon/include/new/pybind11/stl/filesystem.h +116 -0
- ctpbee_api/rohon/include/new/pybind11/stl.h +447 -0
- ctpbee_api/rohon/include/new/pybind11/stl_bind.h +851 -0
- ctpbee_api/rohon/include/new/pybind11/type_caster_pyobject_ptr.h +61 -0
- ctpbee_api/rohon/include/new/rohon/ThostFtdcMdApi.h +168 -0
- ctpbee_api/rohon/include/new/rohon/ThostFtdcTraderApi.h +739 -0
- ctpbee_api/rohon/include/new/rohon/ThostFtdcUserApiDataType.h +6708 -0
- ctpbee_api/rohon/include/new/rohon/ThostFtdcUserApiStruct.h +9580 -0
- ctpbee_api/rohon/include/previous/pybind11/attr.h +489 -0
- ctpbee_api/rohon/include/previous/pybind11/buffer_info.h +108 -0
- ctpbee_api/rohon/include/previous/pybind11/cast.h +2067 -0
- ctpbee_api/rohon/include/previous/pybind11/chrono.h +162 -0
- ctpbee_api/rohon/include/previous/pybind11/common.h +2 -0
- ctpbee_api/rohon/include/previous/pybind11/complex.h +61 -0
- ctpbee_api/rohon/include/previous/pybind11/detail/class.h +626 -0
- ctpbee_api/rohon/include/previous/pybind11/detail/common.h +803 -0
- ctpbee_api/rohon/include/previous/pybind11/detail/descr.h +185 -0
- ctpbee_api/rohon/include/previous/pybind11/detail/init.h +335 -0
- ctpbee_api/rohon/include/previous/pybind11/detail/internals.h +285 -0
- ctpbee_api/rohon/include/previous/pybind11/detail/typeid.h +53 -0
- ctpbee_api/rohon/include/previous/pybind11/eigen.h +604 -0
- ctpbee_api/rohon/include/previous/pybind11/embed.h +194 -0
- ctpbee_api/rohon/include/previous/pybind11/eval.h +117 -0
- ctpbee_api/rohon/include/previous/pybind11/functional.h +85 -0
- ctpbee_api/rohon/include/previous/pybind11/iostream.h +200 -0
- ctpbee_api/rohon/include/previous/pybind11/numpy.h +1601 -0
- ctpbee_api/rohon/include/previous/pybind11/operators.h +168 -0
- ctpbee_api/rohon/include/previous/pybind11/options.h +65 -0
- ctpbee_api/rohon/include/previous/pybind11/pybind11.h +1965 -0
- ctpbee_api/rohon/include/previous/pybind11/pytypes.h +1332 -0
- ctpbee_api/rohon/include/previous/pybind11/stl.h +376 -0
- ctpbee_api/rohon/include/previous/pybind11/stl_bind.h +599 -0
- ctpbee_api/rohon/include/previous/rohon/ThostFtdcMdApi.h +168 -0
- ctpbee_api/rohon/include/previous/rohon/ThostFtdcTraderApi.h +739 -0
- ctpbee_api/rohon/include/previous/rohon/ThostFtdcUserApiDataType.h +6708 -0
- ctpbee_api/rohon/include/previous/rohon/ThostFtdcUserApiStruct.h +9580 -0
- ctpbee_api/rohon/libLinuxDataCollect.so +0 -0
- ctpbee_api/rohon/librohonbase.so +0 -0
- ctpbee_api/rohon/librohonbase.so.1.1 +0 -0
- ctpbee_api/rohon/librohonbase.so.1.1.0.1 +0 -0
- ctpbee_api/rohon/libs/thostmduserapi_se.lib +0 -0
- ctpbee_api/rohon/libs/thosttraderapi_se.lib +0 -0
- ctpbee_api/rohon/libthostmduserapi_se.so +0 -0
- ctpbee_api/rohon/libthosttraderapi_se.so +0 -0
- ctpbee_api/rohon/rohon_constant.py +1242 -0
- ctpbee_api/rohon/thostmduserapi_se.dll +0 -0
- ctpbee_api/rohon/thosttraderapi_se.dll +0 -0
- ctpbee_api/rohon/vnrohon/.vs/vnrohon/v15/.suo +0 -0
- ctpbee_api/rohon/vnrohon/.vs/vnrohon/v15/Browse.VC.db +0 -0
- ctpbee_api/rohon/vnrohon/.vs/vnrohon/v15/Solution.VC.db +0 -0
- ctpbee_api/rohon/vnrohon/vnrohon.h +147 -0
- ctpbee_api/rohon/vnrohon/vnrohon.sln +41 -0
- ctpbee_api/rohon/vnrohon/vnrohonmd/dllmain.cpp +19 -0
- ctpbee_api/rohon/vnrohon/vnrohonmd/framework.h +5 -0
- ctpbee_api/rohon/vnrohon/vnrohonmd/pch.cpp +5 -0
- ctpbee_api/rohon/vnrohon/vnrohonmd/pch.h +13 -0
- ctpbee_api/rohon/vnrohon/vnrohonmd/vnrohonmd.cpp +931 -0
- ctpbee_api/rohon/vnrohon/vnrohonmd/vnrohonmd.h +207 -0
- ctpbee_api/rohon/vnrohon/vnrohonmd/vnrohonmd.vcxproj +188 -0
- ctpbee_api/rohon/vnrohon/vnrohonmd/vnrohonmd.vcxproj.filters +54 -0
- ctpbee_api/rohon/vnrohon/vnrohonmd/vnrohonmd.vcxproj.user +4 -0
- ctpbee_api/rohon/vnrohon/vnrohontd/dllmain.cpp +19 -0
- ctpbee_api/rohon/vnrohon/vnrohontd/framework.h +5 -0
- ctpbee_api/rohon/vnrohon/vnrohontd/pch.cpp +5 -0
- ctpbee_api/rohon/vnrohon/vnrohontd/pch.h +13 -0
- ctpbee_api/rohon/vnrohon/vnrohontd/vnrohontd.cpp +11395 -0
- ctpbee_api/rohon/vnrohon/vnrohontd/vnrohontd.h +1259 -0
- ctpbee_api/rohon/vnrohon/vnrohontd/vnrohontd.vcxproj +188 -0
- ctpbee_api/rohon/vnrohon/vnrohontd/vnrohontd.vcxproj.filters +54 -0
- ctpbee_api/rohon/vnrohon/vnrohontd/vnrohontd.vcxproj.user +4 -0
- ctpbee_api/rohon/vnrohonmd.cp310-win_amd64.pyd +0 -0
- ctpbee_api/rohon/vnrohontd.cp310-win_amd64.pyd +0 -0
- ctpbee_opt_api-0.1.0.dist-info/METADATA +46 -0
- ctpbee_opt_api-0.1.0.dist-info/RECORD +414 -0
- ctpbee_opt_api-0.1.0.dist-info/WHEEL +5 -0
- ctpbee_opt_api-0.1.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
/*
|
|
2
|
+
pybind11/detail/internals.h: Internal data structure and related functions
|
|
3
|
+
|
|
4
|
+
Copyright (c) 2017 Wenzel Jakob <wenzel.jakob@epfl.ch>
|
|
5
|
+
|
|
6
|
+
All rights reserved. Use of this source code is governed by a
|
|
7
|
+
BSD-style license that can be found in the LICENSE file.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
#pragma once
|
|
11
|
+
|
|
12
|
+
#include "../pytypes.h"
|
|
13
|
+
|
|
14
|
+
NAMESPACE_BEGIN(PYBIND11_NAMESPACE)
|
|
15
|
+
NAMESPACE_BEGIN(detail)
|
|
16
|
+
// Forward declarations
|
|
17
|
+
inline PyTypeObject *make_static_property_type();
|
|
18
|
+
inline PyTypeObject *make_default_metaclass();
|
|
19
|
+
inline PyObject *make_object_base_type(PyTypeObject *metaclass);
|
|
20
|
+
|
|
21
|
+
// The old Python Thread Local Storage (TLS) API is deprecated in Python 3.7 in favor of the new
|
|
22
|
+
// Thread Specific Storage (TSS) API.
|
|
23
|
+
#if PY_VERSION_HEX >= 0x03070000
|
|
24
|
+
# define PYBIND11_TLS_KEY_INIT(var) Py_tss_t *var = nullptr
|
|
25
|
+
# define PYBIND11_TLS_GET_VALUE(key) PyThread_tss_get((key))
|
|
26
|
+
# define PYBIND11_TLS_REPLACE_VALUE(key, value) PyThread_tss_set((key), (tstate))
|
|
27
|
+
# define PYBIND11_TLS_DELETE_VALUE(key) PyThread_tss_set((key), nullptr)
|
|
28
|
+
#else
|
|
29
|
+
// Usually an int but a long on Cygwin64 with Python 3.x
|
|
30
|
+
# define PYBIND11_TLS_KEY_INIT(var) decltype(PyThread_create_key()) var = 0
|
|
31
|
+
# define PYBIND11_TLS_GET_VALUE(key) PyThread_get_key_value((key))
|
|
32
|
+
# if PY_MAJOR_VERSION < 3
|
|
33
|
+
# define PYBIND11_TLS_DELETE_VALUE(key) \
|
|
34
|
+
PyThread_delete_key_value(key)
|
|
35
|
+
# define PYBIND11_TLS_REPLACE_VALUE(key, value) \
|
|
36
|
+
do { \
|
|
37
|
+
PyThread_delete_key_value((key)); \
|
|
38
|
+
PyThread_set_key_value((key), (value)); \
|
|
39
|
+
} while (false)
|
|
40
|
+
# else
|
|
41
|
+
# define PYBIND11_TLS_DELETE_VALUE(key) \
|
|
42
|
+
PyThread_set_key_value((key), nullptr)
|
|
43
|
+
# define PYBIND11_TLS_REPLACE_VALUE(key, value) \
|
|
44
|
+
PyThread_set_key_value((key), (value))
|
|
45
|
+
# endif
|
|
46
|
+
#endif
|
|
47
|
+
|
|
48
|
+
// Python loads modules by default with dlopen with the RTLD_LOCAL flag; under libc++ and possibly
|
|
49
|
+
// other STLs, this means `typeid(A)` from one module won't equal `typeid(A)` from another module
|
|
50
|
+
// even when `A` is the same, non-hidden-visibility type (e.g. from a common include). Under
|
|
51
|
+
// libstdc++, this doesn't happen: equality and the type_index hash are based on the type name,
|
|
52
|
+
// which works. If not under a known-good stl, provide our own name-based hash and equality
|
|
53
|
+
// functions that use the type name.
|
|
54
|
+
#if defined(__GLIBCXX__)
|
|
55
|
+
inline bool same_type(const std::type_info &lhs, const std::type_info &rhs) { return lhs == rhs; }
|
|
56
|
+
using type_hash = std::hash<std::type_index>;
|
|
57
|
+
using type_equal_to = std::equal_to<std::type_index>;
|
|
58
|
+
#else
|
|
59
|
+
inline bool same_type(const std::type_info &lhs, const std::type_info &rhs) {
|
|
60
|
+
return lhs.name() == rhs.name() || std::strcmp(lhs.name(), rhs.name()) == 0;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
struct type_hash {
|
|
64
|
+
size_t operator()(const std::type_index &t) const {
|
|
65
|
+
size_t hash = 5381;
|
|
66
|
+
const char *ptr = t.name();
|
|
67
|
+
while (auto c = static_cast<unsigned char>(*ptr++))
|
|
68
|
+
hash = (hash * 33) ^ c;
|
|
69
|
+
return hash;
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
struct type_equal_to {
|
|
74
|
+
bool operator()(const std::type_index &lhs, const std::type_index &rhs) const {
|
|
75
|
+
return lhs.name() == rhs.name() || std::strcmp(lhs.name(), rhs.name()) == 0;
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
#endif
|
|
79
|
+
|
|
80
|
+
template <typename value_type>
|
|
81
|
+
using type_map = std::unordered_map<std::type_index, value_type, type_hash, type_equal_to>;
|
|
82
|
+
|
|
83
|
+
struct overload_hash {
|
|
84
|
+
inline size_t operator()(const std::pair<const PyObject *, const char *>& v) const {
|
|
85
|
+
size_t value = std::hash<const void *>()(v.first);
|
|
86
|
+
value ^= std::hash<const void *>()(v.second) + 0x9e3779b9 + (value<<6) + (value>>2);
|
|
87
|
+
return value;
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
/// Internal data structure used to track registered instances and types.
|
|
92
|
+
/// Whenever binary incompatible changes are made to this structure,
|
|
93
|
+
/// `PYBIND11_INTERNALS_VERSION` must be incremented.
|
|
94
|
+
struct internals {
|
|
95
|
+
type_map<type_info *> registered_types_cpp; // std::type_index -> pybind11's type information
|
|
96
|
+
std::unordered_map<PyTypeObject *, std::vector<type_info *>> registered_types_py; // PyTypeObject* -> base type_info(s)
|
|
97
|
+
std::unordered_multimap<const void *, instance*> registered_instances; // void * -> instance*
|
|
98
|
+
std::unordered_set<std::pair<const PyObject *, const char *>, overload_hash> inactive_overload_cache;
|
|
99
|
+
type_map<std::vector<bool (*)(PyObject *, void *&)>> direct_conversions;
|
|
100
|
+
std::unordered_map<const PyObject *, std::vector<PyObject *>> patients;
|
|
101
|
+
std::forward_list<void (*) (std::exception_ptr)> registered_exception_translators;
|
|
102
|
+
std::unordered_map<std::string, void *> shared_data; // Custom data to be shared across extensions
|
|
103
|
+
std::vector<PyObject *> loader_patient_stack; // Used by `loader_life_support`
|
|
104
|
+
std::forward_list<std::string> static_strings; // Stores the std::strings backing detail::c_str()
|
|
105
|
+
PyTypeObject *static_property_type;
|
|
106
|
+
PyTypeObject *default_metaclass;
|
|
107
|
+
PyObject *instance_base;
|
|
108
|
+
#if defined(WITH_THREAD)
|
|
109
|
+
PYBIND11_TLS_KEY_INIT(tstate);
|
|
110
|
+
PyInterpreterState *istate = nullptr;
|
|
111
|
+
#endif
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
/// Additional type information which does not fit into the PyTypeObject.
|
|
115
|
+
/// Changes to this struct also require bumping `PYBIND11_INTERNALS_VERSION`.
|
|
116
|
+
struct type_info {
|
|
117
|
+
PyTypeObject *type;
|
|
118
|
+
const std::type_info *cpptype;
|
|
119
|
+
size_t type_size, holder_size_in_ptrs;
|
|
120
|
+
void *(*operator_new)(size_t);
|
|
121
|
+
void (*init_instance)(instance *, const void *);
|
|
122
|
+
void (*dealloc)(value_and_holder &v_h);
|
|
123
|
+
std::vector<PyObject *(*)(PyObject *, PyTypeObject *)> implicit_conversions;
|
|
124
|
+
std::vector<std::pair<const std::type_info *, void *(*)(void *)>> implicit_casts;
|
|
125
|
+
std::vector<bool (*)(PyObject *, void *&)> *direct_conversions;
|
|
126
|
+
buffer_info *(*get_buffer)(PyObject *, void *) = nullptr;
|
|
127
|
+
void *get_buffer_data = nullptr;
|
|
128
|
+
void *(*module_local_load)(PyObject *, const type_info *) = nullptr;
|
|
129
|
+
/* A simple type never occurs as a (direct or indirect) parent
|
|
130
|
+
* of a class that makes use of multiple inheritance */
|
|
131
|
+
bool simple_type : 1;
|
|
132
|
+
/* True if there is no multiple inheritance in this type's inheritance tree */
|
|
133
|
+
bool simple_ancestors : 1;
|
|
134
|
+
/* for base vs derived holder_type checks */
|
|
135
|
+
bool default_holder : 1;
|
|
136
|
+
/* true if this is a type registered with py::module_local */
|
|
137
|
+
bool module_local : 1;
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
/// Tracks the `internals` and `type_info` ABI version independent of the main library version
|
|
141
|
+
#define PYBIND11_INTERNALS_VERSION 2
|
|
142
|
+
|
|
143
|
+
#if defined(WITH_THREAD)
|
|
144
|
+
# define PYBIND11_INTERNALS_KIND ""
|
|
145
|
+
#else
|
|
146
|
+
# define PYBIND11_INTERNALS_KIND "_without_thread"
|
|
147
|
+
#endif
|
|
148
|
+
|
|
149
|
+
#define PYBIND11_INTERNALS_ID "__pybind11_internals_v" \
|
|
150
|
+
PYBIND11_TOSTRING(PYBIND11_INTERNALS_VERSION) PYBIND11_INTERNALS_KIND "__"
|
|
151
|
+
|
|
152
|
+
#define PYBIND11_MODULE_LOCAL_ID "__pybind11_module_local_v" \
|
|
153
|
+
PYBIND11_TOSTRING(PYBIND11_INTERNALS_VERSION) PYBIND11_INTERNALS_KIND "__"
|
|
154
|
+
|
|
155
|
+
/// Each module locally stores a pointer to the `internals` data. The data
|
|
156
|
+
/// itself is shared among modules with the same `PYBIND11_INTERNALS_ID`.
|
|
157
|
+
inline internals **&get_internals_pp() {
|
|
158
|
+
static internals **internals_pp = nullptr;
|
|
159
|
+
return internals_pp;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
/// Return a reference to the current `internals` data
|
|
163
|
+
PYBIND11_NOINLINE inline internals &get_internals() {
|
|
164
|
+
auto **&internals_pp = get_internals_pp();
|
|
165
|
+
if (internals_pp && *internals_pp)
|
|
166
|
+
return **internals_pp;
|
|
167
|
+
|
|
168
|
+
constexpr auto *id = PYBIND11_INTERNALS_ID;
|
|
169
|
+
auto builtins = handle(PyEval_GetBuiltins());
|
|
170
|
+
if (builtins.contains(id) && isinstance<capsule>(builtins[id])) {
|
|
171
|
+
internals_pp = static_cast<internals **>(capsule(builtins[id]));
|
|
172
|
+
|
|
173
|
+
// We loaded builtins through python's builtins, which means that our `error_already_set`
|
|
174
|
+
// and `builtin_exception` may be different local classes than the ones set up in the
|
|
175
|
+
// initial exception translator, below, so add another for our local exception classes.
|
|
176
|
+
//
|
|
177
|
+
// libstdc++ doesn't require this (types there are identified only by name)
|
|
178
|
+
#if !defined(__GLIBCXX__)
|
|
179
|
+
(*internals_pp)->registered_exception_translators.push_front(
|
|
180
|
+
[](std::exception_ptr p) -> void {
|
|
181
|
+
try {
|
|
182
|
+
if (p) std::rethrow_exception(p);
|
|
183
|
+
} catch (error_already_set &e) { e.restore(); return;
|
|
184
|
+
} catch (const builtin_exception &e) { e.set_error(); return;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
);
|
|
188
|
+
#endif
|
|
189
|
+
} else {
|
|
190
|
+
if (!internals_pp) internals_pp = new internals*();
|
|
191
|
+
auto *&internals_ptr = *internals_pp;
|
|
192
|
+
internals_ptr = new internals();
|
|
193
|
+
#if defined(WITH_THREAD)
|
|
194
|
+
PyEval_InitThreads();
|
|
195
|
+
PyThreadState *tstate = PyThreadState_Get();
|
|
196
|
+
#if PY_VERSION_HEX >= 0x03070000
|
|
197
|
+
internals_ptr->tstate = PyThread_tss_alloc();
|
|
198
|
+
if (!internals_ptr->tstate || PyThread_tss_create(internals_ptr->tstate))
|
|
199
|
+
pybind11_fail("get_internals: could not successfully initialize the TSS key!");
|
|
200
|
+
PyThread_tss_set(internals_ptr->tstate, tstate);
|
|
201
|
+
#else
|
|
202
|
+
internals_ptr->tstate = PyThread_create_key();
|
|
203
|
+
if (internals_ptr->tstate == -1)
|
|
204
|
+
pybind11_fail("get_internals: could not successfully initialize the TLS key!");
|
|
205
|
+
PyThread_set_key_value(internals_ptr->tstate, tstate);
|
|
206
|
+
#endif
|
|
207
|
+
internals_ptr->istate = tstate->interp;
|
|
208
|
+
#endif
|
|
209
|
+
builtins[id] = capsule(internals_pp);
|
|
210
|
+
internals_ptr->registered_exception_translators.push_front(
|
|
211
|
+
[](std::exception_ptr p) -> void {
|
|
212
|
+
try {
|
|
213
|
+
if (p) std::rethrow_exception(p);
|
|
214
|
+
} catch (error_already_set &e) { e.restore(); return;
|
|
215
|
+
} catch (const builtin_exception &e) { e.set_error(); return;
|
|
216
|
+
} catch (const std::bad_alloc &e) { PyErr_SetString(PyExc_MemoryError, e.what()); return;
|
|
217
|
+
} catch (const std::domain_error &e) { PyErr_SetString(PyExc_ValueError, e.what()); return;
|
|
218
|
+
} catch (const std::invalid_argument &e) { PyErr_SetString(PyExc_ValueError, e.what()); return;
|
|
219
|
+
} catch (const std::length_error &e) { PyErr_SetString(PyExc_ValueError, e.what()); return;
|
|
220
|
+
} catch (const std::out_of_range &e) { PyErr_SetString(PyExc_IndexError, e.what()); return;
|
|
221
|
+
} catch (const std::range_error &e) { PyErr_SetString(PyExc_ValueError, e.what()); return;
|
|
222
|
+
} catch (const std::exception &e) { PyErr_SetString(PyExc_RuntimeError, e.what()); return;
|
|
223
|
+
} catch (...) {
|
|
224
|
+
PyErr_SetString(PyExc_RuntimeError, "Caught an unknown exception!");
|
|
225
|
+
return;
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
);
|
|
229
|
+
internals_ptr->static_property_type = make_static_property_type();
|
|
230
|
+
internals_ptr->default_metaclass = make_default_metaclass();
|
|
231
|
+
internals_ptr->instance_base = make_object_base_type(internals_ptr->default_metaclass);
|
|
232
|
+
}
|
|
233
|
+
return **internals_pp;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
/// Works like `internals.registered_types_cpp`, but for module-local registered types:
|
|
237
|
+
inline type_map<type_info *> ®istered_local_types_cpp() {
|
|
238
|
+
static type_map<type_info *> locals{};
|
|
239
|
+
return locals;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
/// Constructs a std::string with the given arguments, stores it in `internals`, and returns its
|
|
243
|
+
/// `c_str()`. Such strings objects have a long storage duration -- the internal strings are only
|
|
244
|
+
/// cleared when the program exits or after interpreter shutdown (when embedding), and so are
|
|
245
|
+
/// suitable for c-style strings needed by Python internals (such as PyTypeObject's tp_name).
|
|
246
|
+
template <typename... Args>
|
|
247
|
+
const char *c_str(Args &&...args) {
|
|
248
|
+
auto &strings = get_internals().static_strings;
|
|
249
|
+
strings.emplace_front(std::forward<Args>(args)...);
|
|
250
|
+
return strings.front().c_str();
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
NAMESPACE_END(detail)
|
|
254
|
+
|
|
255
|
+
/// Returns a named pointer that is shared among all extension modules (using the same
|
|
256
|
+
/// pybind11 version) running in the current interpreter. Names starting with underscores
|
|
257
|
+
/// are reserved for internal usage. Returns `nullptr` if no matching entry was found.
|
|
258
|
+
inline PYBIND11_NOINLINE void *get_shared_data(const std::string &name) {
|
|
259
|
+
auto &internals = detail::get_internals();
|
|
260
|
+
auto it = internals.shared_data.find(name);
|
|
261
|
+
return it != internals.shared_data.end() ? it->second : nullptr;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
/// Set the shared data that can be later recovered by `get_shared_data()`.
|
|
265
|
+
inline PYBIND11_NOINLINE void *set_shared_data(const std::string &name, void *data) {
|
|
266
|
+
detail::get_internals().shared_data[name] = data;
|
|
267
|
+
return data;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
/// Returns a typed reference to a shared data entry (by using `get_shared_data()`) if
|
|
271
|
+
/// such entry exists. Otherwise, a new object of default-constructible type `T` is
|
|
272
|
+
/// added to the shared data under the given name and a reference to it is returned.
|
|
273
|
+
template<typename T>
|
|
274
|
+
T &get_or_create_shared_data(const std::string &name) {
|
|
275
|
+
auto &internals = detail::get_internals();
|
|
276
|
+
auto it = internals.shared_data.find(name);
|
|
277
|
+
T *ptr = (T *) (it != internals.shared_data.end() ? it->second : nullptr);
|
|
278
|
+
if (!ptr) {
|
|
279
|
+
ptr = new T();
|
|
280
|
+
internals.shared_data[name] = ptr;
|
|
281
|
+
}
|
|
282
|
+
return *ptr;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
NAMESPACE_END(PYBIND11_NAMESPACE)
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/*
|
|
2
|
+
pybind11/detail/typeid.h: Compiler-independent access to type identifiers
|
|
3
|
+
|
|
4
|
+
Copyright (c) 2016 Wenzel Jakob <wenzel.jakob@epfl.ch>
|
|
5
|
+
|
|
6
|
+
All rights reserved. Use of this source code is governed by a
|
|
7
|
+
BSD-style license that can be found in the LICENSE file.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
#pragma once
|
|
11
|
+
|
|
12
|
+
#include <cstdio>
|
|
13
|
+
#include <cstdlib>
|
|
14
|
+
|
|
15
|
+
#if defined(__GNUG__)
|
|
16
|
+
#include <cxxabi.h>
|
|
17
|
+
#endif
|
|
18
|
+
|
|
19
|
+
NAMESPACE_BEGIN(PYBIND11_NAMESPACE)
|
|
20
|
+
NAMESPACE_BEGIN(detail)
|
|
21
|
+
/// Erase all occurrences of a substring
|
|
22
|
+
inline void erase_all(std::string &string, const std::string &search) {
|
|
23
|
+
for (size_t pos = 0;;) {
|
|
24
|
+
pos = string.find(search, pos);
|
|
25
|
+
if (pos == std::string::npos) break;
|
|
26
|
+
string.erase(pos, search.length());
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
PYBIND11_NOINLINE inline void clean_type_id(std::string &name) {
|
|
31
|
+
#if defined(__GNUG__)
|
|
32
|
+
int status = 0;
|
|
33
|
+
std::unique_ptr<char, void (*)(void *)> res {
|
|
34
|
+
abi::__cxa_demangle(name.c_str(), nullptr, nullptr, &status), std::free };
|
|
35
|
+
if (status == 0)
|
|
36
|
+
name = res.get();
|
|
37
|
+
#else
|
|
38
|
+
detail::erase_all(name, "class ");
|
|
39
|
+
detail::erase_all(name, "struct ");
|
|
40
|
+
detail::erase_all(name, "enum ");
|
|
41
|
+
#endif
|
|
42
|
+
detail::erase_all(name, "pybind11::");
|
|
43
|
+
}
|
|
44
|
+
NAMESPACE_END(detail)
|
|
45
|
+
|
|
46
|
+
/// Return a string representation of a C++ type
|
|
47
|
+
template <typename T> static std::string type_id() {
|
|
48
|
+
std::string name(typeid(T).name());
|
|
49
|
+
detail::clean_type_id(name);
|
|
50
|
+
return name;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
NAMESPACE_END(PYBIND11_NAMESPACE)
|