diff --git a/modules/comms/python/generated-sources-pybind/mvsim/Comms/Client.cpp b/modules/comms/python/generated-sources-pybind/mvsim/Comms/Client.cpp index b2ceb9d3..ef3aac56 100644 --- a/modules/comms/python/generated-sources-pybind/mvsim/Comms/Client.cpp +++ b/modules/comms/python/generated-sources-pybind/mvsim/Comms/Client.cpp @@ -1,6 +1,5 @@ #include #include -#include #include #include @@ -13,27 +12,24 @@ #ifndef BINDER_PYBIND11_TYPE_CASTER #define BINDER_PYBIND11_TYPE_CASTER -PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr) -PYBIND11_DECLARE_HOLDER_TYPE(T, T*) +PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr, false) +PYBIND11_DECLARE_HOLDER_TYPE(T, T*, false) PYBIND11_MAKE_OPAQUE(std::shared_ptr) #endif void bind_mvsim_Comms_Client(std::function& M) { - { // mvsim::Client file:mvsim/Comms/Client.h line:48 + { // mvsim::Client file:mvsim/Comms/Client.h line:54 pybind11::class_> cl( M("mvsim"), "Client", - "This is the connection of any user program with the MVSIM server, " - "so\n it can advertise and subscribe to topics and use remote " - "services.\n\n Users should instance a class mvsim::Client (C++) " - "or mvsim.Client (Python) to\n communicate with the simulation " - "runnin in mvsim::World or any other module.\n\n Usage:\n - " - "Instantiate a Client object.\n - Call connect(). It will return " - "immediately.\n - The client will be working on the background as " - "long as the object is not\n destroyed.\n\n Messages and topics " - "are described as Protobuf messages, and communications\n are done " - "via ZMQ sockets.\n\n See: https://mvsimulator.readthedocs.io/\n\n " - "\n\n "); + "This is the connection of any user program with the MVSIM server, so\n it can " + "advertise and subscribe to topics and use remote services.\n\n Users should instance " + "a class mvsim::Client (C++) or mvsim.Client (Python) to\n communicate with the " + "simulation runnin in mvsim::World or any other module.\n\n Usage:\n - Instantiate a " + "Client object.\n - Call connect(). It will return immediately.\n - The client will " + "be working on the background as long as the object is not\n destroyed.\n\n Messages " + "and topics are described as Protobuf messages, and communications\n are done via ZMQ " + "sockets.\n\n See: https://mvsimulator.readthedocs.io/\n\n \n\n "); cl.def(pybind11::init([]() { return new mvsim::Client(); })); cl.def(pybind11::init(), pybind11::arg("nodeName")); @@ -44,58 +40,59 @@ void bind_mvsim_Comms_Client(std::function const " - "std::string &", + "C++: mvsim::Client::serverHostAddress() const --> const std::string &", pybind11::return_value_policy::automatic); cl.def( "serverHostAddress", (void(mvsim::Client::*)(const std::string&)) & mvsim::Client::serverHostAddress, - "C++: mvsim::Client::serverHostAddress(const std::string &) --> " - "void", + "C++: mvsim::Client::serverHostAddress(const std::string &) --> void", pybind11::arg("serverIpOrAddressName")); cl.def( "connect", (void(mvsim::Client::*)()) & mvsim::Client::connect, - "Connects to the server in a parallel thread.\n Default server " - "address is `localhost`, can be changed with\n " - "serverHostAddress().\n\nC++: mvsim::Client::connect() --> void"); + "Connects to the server in a parallel thread.\n Default server address is " + "`localhost`, can be changed with\n serverHostAddress().\n\nC++: " + "mvsim::Client::connect() --> void"); cl.def( "connected", (bool(mvsim::Client::*)() const) & mvsim::Client::connected, "Whether the client is correctly connected to the server. \n\nC++: " "mvsim::Client::connected() const --> bool"); cl.def( "shutdown", (void(mvsim::Client::*)()) & mvsim::Client::shutdown, - "Shutdowns the communication thread. Blocks until the thread is " - "stopped.\n There is no need to manually call this method, it is " - "called upon\n destruction. \n\nC++: mvsim::Client::shutdown() --> " - "void"); + "Shutdowns the communication thread. Blocks until the thread is stopped.\n There is no " + "need to manually call this method, it is called upon\n destruction. \n\nC++: " + "mvsim::Client::shutdown() --> void"); cl.def( "callService", - (std::string(mvsim::Client::*)(const std::string&, const std::string&)) & + (class pybind11::bytes(mvsim::Client::*)(const std::string&, const std::string&)) & mvsim::Client::callService, - "Overload for python wrapper\n\nC++: " - "mvsim::Client::callService(const std::string &, const std::string " - "&) --> std::string", + "Overload for python wrapper\n\nC++: mvsim::Client::callService(const std::string &, " + "const std::string &) --> class pybind11::bytes", pybind11::arg("serviceName"), pybind11::arg("inputSerializedMsg")); cl.def( "subscribeTopic", (void(mvsim::Client::*)( const std::string&, const class std::function>&)>&)) & + const std::string&, const class std::vector&)>&)) & mvsim::Client::subscribeTopic, - "Overload for python wrapper (callback accepts " - "bytes-string)\n\nC++: mvsim::Client::subscribeTopic(const " - "std::string &, const class std::function > &)> &) --> void", + "Overload for python wrapper (callback accepts bytes-string)\n\nC++: " + "mvsim::Client::subscribeTopic(const std::string &, const class std::function &)> &) --> void", + pybind11::arg("topicName"), pybind11::arg("callback")); + cl.def( + "subscribe_topic_raw", + (void(mvsim::Client::*)( + const std::string&, + const class std::function&)) & + mvsim::Client::subscribe_topic_raw, + "C++: mvsim::Client::subscribe_topic_raw(const std::string &, const class " + "std::function &) --> void", pybind11::arg("topicName"), pybind11::arg("callback")); cl.def( "enable_profiler", (void(mvsim::Client::*)(bool)) & mvsim::Client::enable_profiler, "C++: mvsim::Client::enable_profiler(bool) --> void", pybind11::arg("enable")); - { // mvsim::Client::InfoPerNode file:mvsim/Comms/Client.h line:113 + { // mvsim::Client::InfoPerNode file:mvsim/Comms/Client.h line:117 auto& enclosing_class = cl; pybind11::class_< mvsim::Client::InfoPerNode, std::shared_ptr> @@ -110,12 +107,11 @@ void bind_mvsim_Comms_Client(std::function struct " - "mvsim::Client::InfoPerNode &", + "mvsim::Client::InfoPerNode &) --> struct mvsim::Client::InfoPerNode &", pybind11::return_value_policy::automatic, pybind11::arg("")); } - { // mvsim::Client::InfoPerTopic file:mvsim/Comms/Client.h line:119 + { // mvsim::Client::InfoPerTopic file:mvsim/Comms/Client.h line:123 auto& enclosing_class = cl; pybind11::class_< mvsim::Client::InfoPerTopic, std::shared_ptr> @@ -133,8 +129,7 @@ void bind_mvsim_Comms_Client(std::function struct " - "mvsim::Client::InfoPerTopic &", + "mvsim::Client::InfoPerTopic &) --> struct mvsim::Client::InfoPerTopic &", pybind11::return_value_policy::automatic, pybind11::arg("")); } } diff --git a/modules/comms/python/generated-sources-pybind/mvsim/Comms/common.cpp b/modules/comms/python/generated-sources-pybind/mvsim/Comms/common.cpp index dfc010d6..6f16ea86 100644 --- a/modules/comms/python/generated-sources-pybind/mvsim/Comms/common.cpp +++ b/modules/comms/python/generated-sources-pybind/mvsim/Comms/common.cpp @@ -9,12 +9,12 @@ #ifndef BINDER_PYBIND11_TYPE_CASTER #define BINDER_PYBIND11_TYPE_CASTER -PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr) -PYBIND11_DECLARE_HOLDER_TYPE(T, T*) +PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr, false) +PYBIND11_DECLARE_HOLDER_TYPE(T, T*, false) PYBIND11_MAKE_OPAQUE(std::shared_ptr) #endif -// mvsim::UnexpectedMessageException file:mvsim/Comms/common.h line:49 +// mvsim::UnexpectedMessageException file:mvsim/Comms/common.h line:51 struct PyCallBack_mvsim_UnexpectedMessageException : public mvsim::UnexpectedMessageException { using mvsim::UnexpectedMessageException::UnexpectedMessageException; @@ -29,16 +29,10 @@ struct PyCallBack_mvsim_UnexpectedMessageException : public mvsim::UnexpectedMes auto o = overload.operator()(); if (pybind11::detail::cast_is_temporary_value_reference::value) { -// pybind11 <=2.4: overload_caster_t, otherwise: override_caster_t -#if (PYBIND11_MAJOR_VERSION == 2 && PYBIND11_MINOR_VERSION <= 4) - static pybind11::detail::overload_caster_t caster; -#else static pybind11::detail::override_caster_t caster; -#endif return pybind11::detail::cast_ref(std::move(o), caster); } - else - return pybind11::detail::cast_safe(std::move(o)); + return pybind11::detail::cast_safe(std::move(o)); } return runtime_error::what(); } @@ -46,7 +40,7 @@ struct PyCallBack_mvsim_UnexpectedMessageException : public mvsim::UnexpectedMes void bind_mvsim_Comms_common(std::function& M) { - { // mvsim::UnexpectedMessageException file:mvsim/Comms/common.h line:49 + { // mvsim::UnexpectedMessageException file:mvsim/Comms/common.h line:51 pybind11::class_< mvsim::UnexpectedMessageException, std::shared_ptr, PyCallBack_mvsim_UnexpectedMessageException, std::runtime_error> @@ -64,8 +58,7 @@ void bind_mvsim_Comms_common(std::function class " - "mvsim::UnexpectedMessageException &", + "mvsim::UnexpectedMessageException &) --> class mvsim::UnexpectedMessageException &", pybind11::return_value_policy::automatic, pybind11::arg("")); } } diff --git a/modules/comms/python/generated-sources-pybind/pymvsim_comms.cpp b/modules/comms/python/generated-sources-pybind/pymvsim_comms.cpp index 67222138..7e19fcfb 100644 --- a/modules/comms/python/generated-sources-pybind/pymvsim_comms.cpp +++ b/modules/comms/python/generated-sources-pybind/pymvsim_comms.cpp @@ -7,7 +7,7 @@ #include #include -typedef std::function ModuleGetter; +using ModuleGetter = std::function; void bind_std_exception(std::function& M); void bind_std_stdexcept(std::function& M); @@ -42,8 +42,7 @@ PYBIND11_MODULE(pymvsim_comms, root_module) if (std::find(reserved_python_words.begin(), reserved_python_words.end(), ns) == reserved_python_words.end()) return ns; - else - return ns + '_'; + return ns + '_'; }); std::vector> sub_modules{ @@ -51,7 +50,7 @@ PYBIND11_MODULE(pymvsim_comms, root_module) {"", "std"}, }; for (auto& p : sub_modules) - modules[p.first.size() ? p.first + "::" + p.second : p.second] = + modules[p.first.empty() ? p.second : p.first + "::" + p.second] = modules[p.first].def_submodule( mangle_namespace_name(p.second).c_str(), ("Bindings for " + p.first + "::" + p.second + " namespace").c_str()); diff --git a/modules/comms/python/generated-sources-pybind/std/exception.cpp b/modules/comms/python/generated-sources-pybind/std/exception.cpp index ebac1bfc..fef751c3 100644 --- a/modules/comms/python/generated-sources-pybind/std/exception.cpp +++ b/modules/comms/python/generated-sources-pybind/std/exception.cpp @@ -8,8 +8,8 @@ #ifndef BINDER_PYBIND11_TYPE_CASTER #define BINDER_PYBIND11_TYPE_CASTER -PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr) -PYBIND11_DECLARE_HOLDER_TYPE(T, T*) +PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr, false) +PYBIND11_DECLARE_HOLDER_TYPE(T, T*, false) PYBIND11_MAKE_OPAQUE(std::shared_ptr) #endif @@ -28,16 +28,10 @@ struct PyCallBack_std_exception : public std::exception auto o = overload.operator()(); if (pybind11::detail::cast_is_temporary_value_reference::value) { -// pybind11 <=2.4: overload_caster_t, otherwise: override_caster_t -#if (PYBIND11_MAJOR_VERSION == 2 && PYBIND11_MINOR_VERSION <= 4) - static pybind11::detail::overload_caster_t caster; -#else static pybind11::detail::override_caster_t caster; -#endif return pybind11::detail::cast_ref(std::move(o), caster); } - else - return pybind11::detail::cast_safe(std::move(o)); + return pybind11::detail::cast_safe(std::move(o)); } return exception::what(); } @@ -58,8 +52,8 @@ void bind_std_exception(std::function " - "class std::exception &", + "C++: std::exception::operator=(const class std::exception &) --> class std::exception " + "&", pybind11::return_value_policy::automatic, pybind11::arg("")); cl.def( "what", (const char* (std::exception::*)() const) & std::exception::what, diff --git a/modules/comms/python/generated-sources-pybind/std/stdexcept.cpp b/modules/comms/python/generated-sources-pybind/std/stdexcept.cpp index aa9b2d44..92bd7b92 100644 --- a/modules/comms/python/generated-sources-pybind/std/stdexcept.cpp +++ b/modules/comms/python/generated-sources-pybind/std/stdexcept.cpp @@ -10,8 +10,8 @@ #ifndef BINDER_PYBIND11_TYPE_CASTER #define BINDER_PYBIND11_TYPE_CASTER -PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr) -PYBIND11_DECLARE_HOLDER_TYPE(T, T*) +PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr, false) +PYBIND11_DECLARE_HOLDER_TYPE(T, T*, false) PYBIND11_MAKE_OPAQUE(std::shared_ptr) #endif @@ -30,16 +30,10 @@ struct PyCallBack_std_runtime_error : public std::runtime_error auto o = overload.operator()(); if (pybind11::detail::cast_is_temporary_value_reference::value) { -// pybind11 <=2.4: overload_caster_t, otherwise: override_caster_t -#if (PYBIND11_MAJOR_VERSION == 2 && PYBIND11_MINOR_VERSION <= 4) - static pybind11::detail::overload_caster_t caster; -#else static pybind11::detail::override_caster_t caster; -#endif return pybind11::detail::cast_ref(std::move(o), caster); } - else - return pybind11::detail::cast_safe(std::move(o)); + return pybind11::detail::cast_safe(std::move(o)); } return runtime_error::what(); } @@ -64,8 +58,8 @@ void bind_std_stdexcept(std::function class std::runtime_error &", + "C++: std::runtime_error::operator=(const class std::runtime_error &) --> class " + "std::runtime_error &", pybind11::return_value_policy::automatic, pybind11::arg("")); cl.def( "what", (const char* (std::runtime_error::*)() const) & std::runtime_error::what,