[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    Re: [PyKDE] More SIP questions
From:       Phil Thompson <phil () river-bank ! demon ! co ! uk>
Date:       2003-03-25 22:26:53
[Download RAW message or body]

On Tuesday 25 March 2003 10:03 pm, WELCH,DONALD J (HP-Vancouver,ex1) wrote:
> Greetings,
>
> Thanks again for the quick response to my earlier queries. I have an
> additional point of contention:
>
> Each of these 5 variables and methods in the class are causing me grief.
>
> // channel.h
> class Channel
> {
>     public:
>         static const int MAX_LEN = 4096;
>         static const char DEF_NAME[] = "UNKNOWN";
>
>         Channel & operator=( const Channel & chan );
>
>         virtual ~Channel();
>
>         static void delay( struct timeval value);
>     ...
> };
>
> Tried this:
>
> //channel.sip
> class Channel
> {
> %HeaderCode
> #include "channel.h"
> %End
>
> public:
>     static const MAX_LEN; // Correct?
>     static const char DEF_NAME[]; // Error

Python doesn't have const values. You could define them as variables, and you 
can also provide handwritten code using %VariableCode if you need to fiddle 
with them. To be honest I can't remember the details as PyQt no longer makes 
use of this. Try...

static int MAX_LEN;
%VariableCode
	Replace this when we've worked out what to do.
%End

...and look at the generated code.

>     Channel & operator=( const Channel & ); //Error

Not supported, just comment out.

>     virtual ~Channel(); //Error

Remove the "virtual".

>     static void delay( struct timeval ); //Error

I assume it's complaining about "struct timeval". You need to wrap this as 
well - or use %MappedType to use something like a tuple instead.

Phil

_______________________________________________
PyKDE mailing list    PyKDE@mats.gmd.de
http://mats.gmd.de/mailman/listinfo/pykde
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic