Go to the documentation of this file.
16 std::string
arg =
"(default arg inspector 1)";
20 std::string
arg =
"(default arg inspector 2)";
30 #ifdef PYBIND11_DETAIL_UNDERSCORE_BACKWARD_COMPATIBILITY
37 value.arg =
"loading ArgInspector1 argument " + std::string(
convert ?
"WITH" :
"WITHOUT")
38 +
" conversion allowed. "
40 + (std::string)
str(src);
45 return str(src.
arg).release();
54 value.arg =
"loading ArgInspector2 argument " + std::string(
convert ?
"WITH" :
"WITHOUT")
55 +
" conversion allowed. "
57 + (std::string)
str(src);
62 return str(src.
arg).release();
73 return py::none().release();
103 return py::bool_(
true).release();
117 namespace py_ = ::pybind11;
122 bool load(py_::handle,
bool) {
return true; }
125 return py_::bool_(
true).release();
153 return a.arg +
"\n" +
b.arg +
"\n" + std::to_string(
c) +
"\n" +
d->arg;
158 py::class_<ArgInspector>(
m,
"ArgInspector")
165 "c"_a.noconvert() = 13,
172 return a.arg +
"\n" +
b.arg;
179 "floats_preferred", [](
double f) {
return 0.5 *
f; },
"f"_a);
181 "floats_only", [](
double f) {
return 0.5 *
f; },
"f"_a.noconvert());
183 "ints_preferred", [](
int i) {
return i / 2; },
"i"_a);
185 "ints_only", [](
int i) {
return i / 2; },
"i"_a.noconvert());
191 m.def(
"custom_caster_no_destroy", []() {
197 "custom_caster_destroy",
199 py::return_value_policy::take_ownership);
201 "custom_caster_destroy_const",
203 py::return_value_policy::take_ownership);
204 m.def(
"destruction_tester_cstats",
205 &ConstructorStats::get<DestructionTester>,
206 py::return_value_policy::reference);
bool load(handle, bool convert)
DestructionTester & operator=(DestructionTester &&) noexcept
DestructionTester(const DestructionTester &)
constexpr descr< N - 1 > const_name(char const (&text)[N])
static const double d[K][N]
return_value_policy
Approach used to cast a previously unknown C++ instance into a Python object.
set noclip points set clip one set noclip two set bar set border lt lw set xdata set ydata set zdata set x2data set y2data set boxwidth set dummy x
PYBIND11_TYPE_CASTER(MyType, py_::detail::const_name("MyType"))
void print_copy_created(T *inst, Values &&...values)
void print_default_created(T *inst, Values &&...values)
static handle cast(const ArgInspector2 &src, return_value_policy, handle)
void print_copy_assigned(T *inst, Values &&...values)
DestructionTester & operator=(const DestructionTester &)
static handle cast(const DestructionTester &, return_value_policy, handle)
EIGEN_DEVICE_FUNC const EIGEN_STRONG_INLINE ArgReturnType arg() const
bool load(handle src, bool convert)
void g(const string &key, int i)
Point2(* f)(const Point3 &, OptionalJacobian< 2, 3 >)
#define PYBIND11_TYPE_CASTER(type, py_name)
DestructionTester(DestructionTester &&) noexcept
static handle cast(const ArgInspector1 &src, return_value_policy, handle)
void print_move_created(T *inst, Values &&...values)
static handle cast(const ArgAlwaysConverts &, return_value_policy, handle)
static py_::handle cast(const MyType &, py_::return_value_policy, py_::handle)
void print_destroyed(T *inst, Values &&...values)
bool load(py_::handle, bool)
void print_move_assigned(T *inst, Values &&...values)
TEST_SUBMODULE(custom_type_casters, m)
constexpr descr< N - 1 > _(char const (&text)[N])
static BinaryMeasurement< Rot3 > convert(const BetweenFactor< Pose3 >::shared_ptr &f)
bool load(handle src, bool convert)
gtsam
Author(s):
autogenerated on Thu Jun 13 2024 03:08:52