471,348 Members | 1,424 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,348 software developers and data experts.

Support for C++ std::vector in Python wrapper

Hi all,

I am new to Python so apologies in advance for my ignorance. I have created a C++ DLL which needs to be wrapped for Python users.

The problem is that some of the functions for my DLL require std::vector as argument to be passed. From what I understand, the equivalent in Python to std::vector is list.

This is the definition of the fucntion that needs the std::vector:
int userStreamInput( const std::vector <unsigned char > & )


BOOST_PYTHON_MODULE( _RFCPython )
{

class_< UIImpl >( "RFCPython" )
.def( init< const std::string& > () )
.def( "stream", &UIImpl::userStreamInput )
;
}

Does anyone have suggestions on how to pass a std::vector to my function?

Thanks,

Ste
Dec 4 '07 #1
0 951

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

9 posts views Thread by kathy | last post: by
7 posts views Thread by Thomas | last post: by
8 posts views Thread by jacek.dziedzic | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.