swig - Extending embedded Python in C++ - Design to interact with C++ instances -
there several packages out there in automating task of writing bindings between c\c++ , other languages.
in case, i'd bind python, options such packages are: swig, boost.python , robin.
it seems straight forward process use these packages create c\c++ linkable libraries (with static functions) , have higher language extended using them.
however, situation have developed working system in c++ therefore plan embed python future development in python.
it's not clear me how, , if @ possible, use these packages in helping extend embedded python in such way python code able interact various singleton instances running in system, , instantiate c++ classes , interact them.
what i'm looking insight regarding design best fitted situation.
boost.python lets lot of things right out of box, if use smart pointers. can inherit c++ classes in python, pass instances of c++ code , have still work. favorite resource on how various stuff (especially check out "how to" section): http://wiki.python.org/moin/boost.python/ .
boost.python if you're using smart pointers or intrusive pointers, translate transparently pyobject reference counting. also, it's @ making factory functions python constructors, makes clean python apis.
if you're not using smart pointers, it's still possible things want, have mess various return , lifetime policies, can give headache.
Comments
Post a Comment