5 #include <pybind11/pybind11.h> 8 #include <pybind11/stl.h> 11 #ifndef BINDER_PYBIND11_TYPE_CASTER 12 #define BINDER_PYBIND11_TYPE_CASTER 20 using mvsim::UnexpectedMessageException::UnexpectedMessageException;
22 const char *
what() const noexcept
override {
23 pybind11::gil_scoped_acquire gil;
24 pybind11::function overload = pybind11::get_overload(static_cast<const mvsim::UnexpectedMessageException *>(
this),
"what");
26 auto o = overload.operator()<pybind11::return_value_policy::reference>();
27 if (pybind11::detail::cast_is_temporary_value_reference<const char *>::value) {
28 static pybind11::detail::overload_caster_t<const char *> caster;
29 return pybind11::detail::cast_ref<const char *>(std::move(o), caster);
31 else return pybind11::detail::cast_safe<const char *>(std::move(o));
33 return runtime_error::what();
40 pybind11::class_<mvsim::UnexpectedMessageException, std::shared_ptr<mvsim::UnexpectedMessageException>,
PyCallBack_mvsim_UnexpectedMessageException, std::runtime_error> cl(M(
"mvsim"),
"UnexpectedMessageException",
"");
41 cl.def( pybind11::init<const char *>(), pybind11::arg(
"reason") );
43 cl.def( pybind11::init( [](PyCallBack_mvsim_UnexpectedMessageException
const &o){
return new PyCallBack_mvsim_UnexpectedMessageException(o); } ) );
44 cl.def( pybind11::init( [](mvsim::UnexpectedMessageException
const &o){
return new mvsim::UnexpectedMessageException(o); } ) );
45 cl.def(
"assign", (
class mvsim::UnexpectedMessageException & (mvsim::UnexpectedMessageException::*)(
const class mvsim::UnexpectedMessageException &)) &mvsim::UnexpectedMessageException::operator=,
"C++: mvsim::UnexpectedMessageException::operator=(const class mvsim::UnexpectedMessageException &) --> class mvsim::UnexpectedMessageException &", pybind11::return_value_policy::automatic, pybind11::arg(
""));
void bind_mvsim_Comms_common(std::function< pybind11::module &(std::string const &namespace_) > &M)
PYBIND11_MAKE_OPAQUE(std::shared_ptr< void >)
const char * what() const noexceptoverride
PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr< T >)