I'm a newbie to boost and one of its libraries which I can't understand it is Boost.Python. Can anyone explain me in details how does this interoperability achieved?In the documentation there only a few words about metaprogramming.
P.S. I tried to look code but because of my lack of C++ knowledge I didn't understand principles.
Thanks in advance
There are two ways to interoperate:
1) from a "Python process", call functions written in C++.
Python already has a system to load dlls, they're called "extension modules". Boost.Python can compile your source to produce one. Basically you write a little wrapper to declare a function callable from Python, and the "metaprogramming" is there to do stuff like detecting what types the C++ function takes and returns, so that it can emit the right code to convert those from/to the equivalent Python types.
2) from a "C++ process", launch and control the Python interpreter.
Python provides a C API to do this, and Boost.Python knows how to use it.
How does boost::python work?Any ideas about the realisation details?