python/generated-sources-pybind/mvsim/Comms/common.cpp
Go to the documentation of this file.
1 #include <mvsim/Comms/common.h>
2 #include <pybind11/pybind11.h>
3 #include <pybind11/stl.h>
4 
5 #include <functional>
6 #include <sstream> // __str__
7 #include <stdexcept>
8 #include <string>
9 
10 #ifndef BINDER_PYBIND11_TYPE_CASTER
11 #define BINDER_PYBIND11_TYPE_CASTER
12 PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr<T>)
13 PYBIND11_DECLARE_HOLDER_TYPE(T, T*)
14 PYBIND11_MAKE_OPAQUE(std::shared_ptr<void>)
15 #endif
16 
17 // mvsim::UnexpectedMessageException file:mvsim/Comms/common.h line:49
18 struct PyCallBack_mvsim_UnexpectedMessageException : public mvsim::UnexpectedMessageException
19 {
20  using mvsim::UnexpectedMessageException::UnexpectedMessageException;
21 
22  const char* what() const throw() override
23  {
24  pybind11::gil_scoped_acquire gil;
25  pybind11::function overload = pybind11::get_overload(
26  static_cast<const mvsim::UnexpectedMessageException*>(this), "what");
27  if (overload)
28  {
29  auto o = overload.operator()<pybind11::return_value_policy::reference>();
30  if (pybind11::detail::cast_is_temporary_value_reference<const char*>::value)
31  {
32 // pybind11 <=2.4: overload_caster_t, otherwise: override_caster_t
33 #if (PYBIND11_MAJOR_VERSION == 2 && PYBIND11_MINOR_VERSION <= 4)
34  static pybind11::detail::overload_caster_t<const char*> caster;
35 #else
36  static pybind11::detail::override_caster_t<const char*> caster;
37 #endif
38  return pybind11::detail::cast_ref<const char*>(std::move(o), caster);
39  }
40  else
41  return pybind11::detail::cast_safe<const char*>(std::move(o));
42  }
43  return runtime_error::what();
44  }
45 };
46 
47 void bind_mvsim_Comms_common(std::function<pybind11::module&(std::string const& namespace_)>& M)
48 {
49  { // mvsim::UnexpectedMessageException file:mvsim/Comms/common.h line:49
50  pybind11::class_<
51  mvsim::UnexpectedMessageException, std::shared_ptr<mvsim::UnexpectedMessageException>,
53  cl(M("mvsim"), "UnexpectedMessageException", "");
54  cl.def(pybind11::init<const char*>(), pybind11::arg("reason"));
55 
56  cl.def(pybind11::init([](PyCallBack_mvsim_UnexpectedMessageException const& o)
58  cl.def(pybind11::init([](mvsim::UnexpectedMessageException const& o)
59  { return new mvsim::UnexpectedMessageException(o); }));
60  cl.def(
61  "assign",
62  (class mvsim::UnexpectedMessageException &
63  (mvsim::UnexpectedMessageException::*)(const class mvsim::
64  UnexpectedMessageException&)) &
65  mvsim::UnexpectedMessageException::operator=,
66  "C++: mvsim::UnexpectedMessageException::operator=(const class "
67  "mvsim::UnexpectedMessageException &) --> class "
68  "mvsim::UnexpectedMessageException &",
69  pybind11::return_value_policy::automatic, pybind11::arg(""));
70  }
71 }
mvsim
Definition: Client.h:21
PyCallBack_mvsim_UnexpectedMessageException
Definition: python/generated-sources-pybind/mvsim/Comms/common.cpp:18
PyCallBack_mvsim_UnexpectedMessageException::what
const char * what() const override
Definition: python/generated-sources-pybind/mvsim/Comms/common.cpp:22
common.h
bind_mvsim_Comms_common
void bind_mvsim_Comms_common(std::function< pybind11::module &(std::string const &namespace_)> &M)
Definition: python/generated-sources-pybind/mvsim/Comms/common.cpp:47


mvsim
Author(s):
autogenerated on Wed May 28 2025 02:13:07