代码语言:javascript复制
PYBIND11_MODULE(tradecpt, module){
module.doc()="tradecpt plugin";
pybind11::class_<tradecpy::pyTradeApi>(module, "pyTradeApi")
.def(pybind11::init<std::map<std::string,std::string>>())
.def("Connect", &tradecpy::pyTradeApi::Connect);
module.def("add", &add, "A function which adds two numbers", pybind11::arg("a")=1, pybind11::arg("b")=2);
}
编译输出的文件名必须与PYBIND11_MODULE(tradecpt, module)的tradecpt保持一致