[C++-sig] TnFOX with the latest py++ from SVN

Roman Yakovenko roman.yakovenko at gmail.com
Sun Oct 1 21:51:15 CEST 2006


On 10/1/06, Niall Douglas <s_sourceforge at nedprod.com> wrote:
> Sorry it's taken so long to get onto this - but I have some
> conclusions.
>
> WARNING: void FX::FXGLViewer::eyeToScreen(FX::FXint & sx, FX::FXint &
> sy, FX::FXVec3f e) [member_function]
> > The function takes as argument (name=sx, pos=0 ) non-const reference
> > to C++ fundamental type - function could not be called from Python.
>
> Surely BPL can rebind the value of sx on output back to the input? I
> remember something in the tutorial about this just working out of the
> box.

No it can not. In near future it will be very easy to instruct Py++ to
create wrapper
for such functions.

>
> In
> vector_less_fx_scope_fxwindow_ptr__comma_std_scope_allocator_less_fx_s
> cope_fxwindow_ptr__grate___grate_.pypp.cpp, it doesn't automatically
> include boost/python/suite/indexing/vector_indexing_suite.hpp which
> it should as it uses it.

I am not sure about this one. I just checked this use case and it
works as expected.
I think I need more information here. May be this is an old file or
something like this?

> I've added the insertion of a preprocessor define to indicate the
> file being compiled so a general include 'patches.h' can insert
> custom code:
>
> Index: multiple_files.py
> ===================================================================
> --- multiple_files.py   (revision 609)
> +++ multiple_files.py   (working copy)
> @@ -198,6 +198,7 @@
>          if self.extmodule.license:
>              answer.append( self.extmodule.license.create() )
>
> +        answer.append( '#define
> PYPP_BUILDING_'+file_name.replace('.', '_').upper() )
>          head_headers = [ file_name + self.HEADER_EXT ]
>          answer.append( self.create_include_code( creators,
> head_headers ) )

You don't need this trick any more. It is possible to insert custom code to
a file:
http://language-binding.net/pyplusplus/documentation/inserting_code.html

> py++ still tries to subclass unions with wrappers, or expose them as
> read only data. This of course fails.

Bug! I will fix it. The way I will fix it is by excluding them. For a
time being you will
have to wrap them manually.

> I have a class called SysRandomness inheriting off FRandomness ie;
> class SysRandomness : protected QMutex, protected FRandomness. This
> causes py++ to specify FRandomness as the base class but this causes
> BPL to give an error as a pointer to SysRandomness cannot be
> converted to FRandomness. How do I disable py++ using bases<> for
> this class?

You can't. I think this is a bug in Py++. I fixed it and the fix in svn.

> exceptions.TypeError,No to_python (by-value) converter found for C++
> type: enum FX::FXACL::EntityType at line ? in ?
>...
> py++ specifies FXACL::EntityType as an optional construction
> parameter, but BPL needs it declared before usage. Not sure how this
> can be done sadly other than fixing BPL.

Fixed. The fix in svn. From now every constructor that has default argument
of type "enum" that is declared in the class, the default value will be replaced
with long( %default_values ) string. This does not fix the general
case, but until
now this is the only case the users asked to fix.

I remember you had other problems with registration order.
Take a look on this feature:
http://sourceforge.net/mailarchive/message.php?msg_id=36710872
In short Py++ supports Boost.Python Auto-Overloading functionality
( http://boost.org/libs/python/doc/tutorial/doc/html/python/functions.html#python.auto_overloading
)

-- 
Roman Yakovenko
C++ Python language binding
http://www.language-binding.net/



More information about the Cplusplus-sig mailing list