![]() |
Shamrock 2025.10.0
Astrophysical Code
|
Pybind11 include and definitions. More...
#include <pybind11/pybind11.h>
Include dependency graph for pybindaliases.hpp:
This graph shows which files directly or indirectly include this file:Go to the source code of this file.
Classes | |
| struct | PyBindStaticInit |
| Utility struct to register python modules through static init. More... | |
Macros | |
| #define | Register_pymod(placeholdername) |
| Register a python module init function using static initialisation. | |
Typedefs | |
| using | fct_sig = std::function< void(py::module &)> |
| alias to pybind11 namespace | |
Functions | |
| void | register_pybind_init_func (fct_sig) |
| Register a python module init function to be ran on init. | |
Pybind11 include and definitions.
If we build shamrock executable we embed python in Shamrock hence the include pybind11/embed.h. If we build shamrock as python lib we import pybind11/pybind11.h. Both options defines a similar syntax for the python module definition, we can then wrap them conveniently in a single macro call.
Definition in file pybindaliases.hpp.
| #define Register_pymod | ( | placeholdername | ) |
Register a python module init function using static initialisation.
Usage (in any source files) :
Definition at line 56 of file pybindaliases.hpp.
| using fct_sig = std::function<void(py::module &)> |
alias to pybind11 namespace
function signature used to register python modules
Definition at line 30 of file pybindaliases.hpp.
| void register_pybind_init_func | ( | fct_sig | fct | ) |
Register a python module init function to be ran on init.
Register a python module init function to be ran on init.
Definition at line 59 of file pybindings.cpp.