py++

Boost.Python: Fill in a passed in buffer in Python

≡放荡痞女 提交于 2019-12-11 03:06:09
问题 I was wondering whether it's possible to fill in a buffer (with the following conditions) in Python and if so how? I have a buffer in C++ that I need to fill in Python. The Address of the buffer is obtained through the GetAddress method which returns a void pointer to the buffer's address. #include <boost/smart_ptr/shared_ptr.hpp> class Foo { public: Foo(const unsigned int length) { m_buffer = boost::shared_ptr< unsigned char >( new unsigned char[ length ] ); } ~Foo(){} void* GetAddress( )