[C++-sig] Re: Pyste bug: Fails to pull in inherited members

Niall Douglas s_sourceforge at nedprod.com
Sat Oct 18 07:24:54 CEST 2003


On 18 Oct 2003 at 3:49, c++-sig at python.org wrote:

> I have absolutely no idea why, but when you feed all the pyste files
> to pyste at once it fails to wrap inherited members for my FXIODeviceS
> class, the ones it inherited from FXIODevice.
> 
> But when you pass FXIODeviceS.pyste on its own, it works fine. Very
> odd.
> 
> I'm afraid I've not been able to localise this one Bruno, so I'm
> guessing the only choice is to download v0.4 when it's released in the
> next week or so and work with that. Sorry about that.

Scratch that, I've found it!

In FXIODevice, I have the following:

virtual FXuval readBlock(char *data, FXuval maxlen)=0;

and its convenience overload:

FXuval readBlock(FXuchar *data, FXuval maxlen) { return 
readBlock((char *) data, maxlen); }

FXIODeviceS inherits from FXIODevice and pyste generates for it 
(IODeviceS):

        .def("readBlock", pure_virtual(&FX::FXIODevice::readBlock))

This is ambiguous. It should be:

        .def("readBlock", pure_virtual((long unsigned int 
(FX::FXIODevice::*)(char*, long unsigned int) 
)&FX::FXIODevice::readBlock))

... which is what pyste generates for FXIODevice.

I'm guessing pyste is somehow not noticing the base class overloads 
despite the use of Import()?

BTW, it was erratic before because sometimes IODevice was defined 
before IODeviceS, other times not.

Cheers,
Niall




-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 208 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/cplusplus-sig/attachments/20031018/ba7b3e4e/attachment.pgp>


More information about the Cplusplus-sig mailing list