Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
wrap
pybind11
tests
test_embed
external_module.cpp
Go to the documentation of this file.
1
#include <
pybind11/pybind11.h
>
2
3
namespace
py
=
pybind11
;
4
5
/* Simple test module/test class to check that the referenced internals data of external pybind11
6
* modules aren't preserved over a finalize/initialize.
7
*/
8
9
PYBIND11_MODULE
(external_module,
m
) {
10
class
A
{
11
public
:
12
A
(
int
value
) :
v
{value} {};
13
int
v
;
14
};
15
16
py::class_<A>(
m
,
"A"
)
17
.def(py::init<int>())
18
.def_readwrite(
"value"
, &
A::v
);
19
20
m.def(
"internals_at"
, []() {
21
return
reinterpret_cast<
uintptr_t
>
(&
py::detail::get_internals
());
22
});
23
}
m
Matrix3f m
Definition:
AngleAxis_mimic_euler.cpp:1
E1::A
v
ArrayXcf v
Definition:
Cwise_arg.cpp:1
pybind11
Definition:
wrap/pybind11/pybind11/__init__.py:1
get_internals
PYBIND11_NOINLINE internals & get_internals()
Return a reference to the current internals data.
Definition:
internals.h:245
pybind11.h
test_callbacks.value
value
Definition:
test_callbacks.py:116
A
Definition:
test_numpy_dtypes.cpp:254
uintptr_t
_W64 unsigned int uintptr_t
Definition:
ms_stdint.h:124
PYBIND11_MODULE
PYBIND11_MODULE(external_module, m)
Definition:
external_module.cpp:9
gtsam
Author(s):
autogenerated on Sat May 8 2021 02:42:03