[C++-sig] Py ++ generated code contains static ...

Roman Yakovenko roman.yakovenko at gmail.com
Fri Feb 9 11:33:55 CET 2007


On 2/9/07, Alexander Eisenhuth <newsuser at stacom-software.de> wrote:
> You ment this->Math_E::what(  );
>
> >
> > Can you test it?
>
> I've tested "this->Math_E::what(  )" and it compiled !
> Thanks a lot for that hint.

Thanks, I committed the fix to SVN( revision 897 )

> At stdout there are a lot of warnings like:
>
> WARNING: void Math::XYZ_TC<long unsigned int>::GetPolar(double & pol_,
double &
> pol_a, double & mer) const [member function]
>  > warning W1009: The function takes as argument (name=mer, pos=2)
>  > non-const reference to Python immutable type - function could not be
>  > called from Python. Take a look on "Function Transformation"
>  > functionality and define the transformation.
>
>
> The warning say that the methode couldn't be called from python because:
> - argument mer is a "in/out" argument
>
> The solution according to Function Transformation":
>
> 1) Write wrapper code
> 2) Use py++ on the python side
>
> Right?

No, ask Py++ to create wrapper code, but for this you will have to switch to
API.
The GUI has "generate Py++ code" button. This will generate skeleton for
your
project. Than you have to add next code:

from pyplusplus import function_transformers as FT

mb = module_builder_t( ... )
GetPolar = mb.member_function( 'GetPolar' )
#search API explained here:
http://language-binding.net/pygccxml/query_interface.html
GetPolar.add_transformation( FT.output( 'pol_' ),  FT.output( 'pol_a' ),
FT.output( 'mer' ) )

That's all. Py++ will generate function wrapper, which will return tuple(
pol_ value, pol_a value, mer value ).

Function Transformers docs:
http://language-binding.net/pyplusplus/documentation/functions/transformation/built_in/output.html

-- 
Roman Yakovenko
C++ Python language binding
http://www.language-binding.net/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/cplusplus-sig/attachments/20070209/9e8064cd/attachment.htm>


More information about the Cplusplus-sig mailing list