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
19  : public mvsim::UnexpectedMessageException
20 {
21  using mvsim::UnexpectedMessageException::UnexpectedMessageException;
22 
23  const char* what() const throw() override
24  {
25  pybind11::gil_scoped_acquire gil;
26  pybind11::function overload = pybind11::get_overload(
27  static_cast<const mvsim::UnexpectedMessageException*>(this),
28  "what");
29  if (overload)
30  {
31  auto o =
32  overload.operator()<pybind11::return_value_policy::reference>();
33  if (pybind11::detail::cast_is_temporary_value_reference<
34  const char*>::value)
35  {
36 // pybind11 <=2.4: overload_caster_t, otherwise: override_caster_t
37 #if (PYBIND11_MAJOR_VERSION == 2 && PYBIND11_MINOR_VERSION <= 4)
38  static pybind11::detail::overload_caster_t<const char*> caster;
39 #else
40  static pybind11::detail::override_caster_t<const char*> caster;
41 #endif
42  return pybind11::detail::cast_ref<const char*>(
43  std::move(o), caster);
44  }
45  else
46  return pybind11::detail::cast_safe<const char*>(std::move(o));
47  }
48  return runtime_error::what();
49  }
50 };
51 
53  std::function<pybind11::module&(std::string const& namespace_)>& M)
54 {
55  { // mvsim::UnexpectedMessageException file:mvsim/Comms/common.h line:49
56  pybind11::class_<
57  mvsim::UnexpectedMessageException,
58  std::shared_ptr<mvsim::UnexpectedMessageException>,
60  cl(M("mvsim"), "UnexpectedMessageException", "");
61  cl.def(pybind11::init<const char*>(), pybind11::arg("reason"));
62 
63  cl.def(pybind11::init(
64  [](PyCallBack_mvsim_UnexpectedMessageException const& o) {
65  return new PyCallBack_mvsim_UnexpectedMessageException(o);
66  }));
67  cl.def(pybind11::init([](mvsim::UnexpectedMessageException const& o) {
68  return new mvsim::UnexpectedMessageException(o);
69  }));
70  cl.def(
71  "assign",
72  (class mvsim::UnexpectedMessageException &
73  (mvsim::
74  UnexpectedMessageException::*)(const class mvsim::
75  UnexpectedMessageException&)) &
76  mvsim::UnexpectedMessageException::operator=,
77  "C++: mvsim::UnexpectedMessageException::operator=(const class "
78  "mvsim::UnexpectedMessageException &) --> class "
79  "mvsim::UnexpectedMessageException &",
80  pybind11::return_value_policy::automatic, pybind11::arg(""));
81  }
82 }
void bind_mvsim_Comms_common(std::function< pybind11::module &(std::string const &namespace_)> &M)


mvsim
Author(s):
autogenerated on Tue Jul 4 2023 03:08:19