I have a class in C++.
I create an object from this class in my C++ code. I want this object to be accessible in Python. I use boost::shared_ptr
to keep the object address.
I've checked out some posts about this but wasn't very helpful. I think the best way is to make an object in Python namespace after interpreter initialization and then assign my boost shared_ptr to the created object in Python.
I've wrapped my class using BOOST_PYTHON_MODULE
in cpp and tested some ways like namespace["my_module_name_in_python"] = class<"my_class">...
to be able to create an object in python and fill it with the shared_ptr
.
In summery my question is how's possible to pass a C++ object contained in a shared_ptr
to python.
Thanks in advance