These are small PyBind11 examples that I've built in isolation while figuring out how to use various features while building Python bindings for CrocoFIX.
These examples rely on the smart_holder branch of PyBind11.
git submodule add -f -b smart_holder [email protected]:pybind/pybind11 extern/pybind11
You may need to adjust the Python referenced in the test scripts.
This has only been tested on macOS.
This is an example of implementing an abstract C++ class in Python and pass that implementation back to C++ code where it will be called.
This is an example of exposing a C++ class with a std::function member, exposing this member as a Python property and invoking the propery via Python->C++.
This is an example of exposing a derived C++ class with properties defined on the Python type that belong to a C++ base class.