[C++-sig] Using C++ classes exposed by other modules

Bryant Gipson gipson_b at yahoo.com
Thu Oct 14 19:17:13 CEST 2010


Hi All,



Maybe a simple question, maybe not:



I have a binary-only module which was automatically generated by Py++ and its associated pre-compiled C++ libraries. 

There's a basic C++ type "A" which was exposed along with plenty of support functions in the associated C++ library which operate on it in both C++ and Python. 


i.e.

python:

a = mod.A();

mod.helpfulFunction(a); >>Some helpful output. 



My problem is now I want to write a module which operates on the C++ class A.



C++:



void mySlightlyHelpfulFunction(cppmodule::A &a)

{

  ...

}



BOOST_PYTHON_MODULE(myModule)

{

  def("mySlightlyHelpfulFunction",mySlightlyHelpfulFunction);

}



Python:

a = mod.A()

myModule.mySlightlyHelpfulFunction(a)

    myModule.mySlightlyHelpfulFunction(A)

did not match C++ signature:

    mySlightlyHelpfulFunction(mod::A {lvalue})



I've also tried this with Py++ with the same results.

Thus far it appears that no converter has been globally registered by the module mod.



Any help would be hugely appreciated.


I apologise if this is a trivial question, I'm still new to hybrid C++/python.



Thanks.







      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/cplusplus-sig/attachments/20101014/dfcd5723/attachment.html>


More information about the Cplusplus-sig mailing list