Exposing non immutable fixed size array members #52
pthom
started this conversation in
Development Corner
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Concerning the C arrays and their sharing via the generator, the first thing to do is to study whether it is feasible and reasonnable to share them as an array (or something close).
So, I have a setup a test inside pybind_immapp.cpp:
With this in place, we can write:
However this it still not bound as an array, like it is the case for immutable numeric types (arrays of numeric type are exposed as a numpy array with shared memory, which means modifications propagate between C++ and python).
The trick to make it work is that the underlying "void *buffer" is shared between python and C++ (and actually it is shared between two C++ dynamic libraries: numpy and imgui_bundle: python only helped by transferring it address).
Challenge: sutdy whether it is feasible to enable array-like access on this simple code (first by making manual attempts, without modifying the generator)?
Beta Was this translation helpful? Give feedback.
All reactions