[C++-sig] TnFOX with the latest py++ from SVN
Niall Douglas
s_sourceforge at nedprod.com
Sun Oct 1 20:21:06 CEST 2006
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.
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'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 ) )
py++ still tries to subclass unions with wrappers, or expose them as
read only data. This of course fails.
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?
The old problem of badly ordered declarations still occurs. After
linking and on running I get:
exceptions.TypeError,No to_python (by-value) converter found for C++
type: enum FX::FXACL::EntityType at line ? in ?
This is due to:
{ //::FX::FXACL
typedef bp::class_< FXACL_wrapper > FXACL_exposer_t;
FXACL_exposer_t FXACL_exposer = FXACL_exposer_t( "FXACL",
bp::init< bp::optional< FX::FXACL::EntityType, FX::FXACLEntity const
& > >(( bp::arg("type")=::FX::FXACL::Unknown,
bp::arg("owner")=FX::FXACLEntity::currentUser( ) )) );
bp::scope FXACL_scope( FXACL_exposer );
bp::enum_< FX::FXACL::EntityType>("EntityType")
.value("Unknown", FX::FXACL::Unknown)
.value("File", FX::FXACL::File)
.value("Directory", FX::FXACL::Directory)
.value("Pipe", FX::FXACL::Pipe)
.value("MemMap", FX::FXACL::MemMap)
.export_values()
;
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.
Otherwise, things have improved greatly! I especially like the new
bitfield support.
Cheers,
Niall
More information about the Cplusplus-sig
mailing list