[PD-dev] [flext] how to call the right setup function

Thomas Grill gr at grrrr.org
Tue Nov 1 15:16:22 CET 2005


Hi,

> when I make it in the way as below, the constructor of class A will be 
> called before the setup function ... is that correct behauviour?
> The problem is, that I have to setup some stuff (at setup time), which 
> is also needed by calls A ... :(
>

the constructor should only be called upon instantiation of an actual 
object, not during class setup (in the course of the lib_setup 
function).
Do you have working source code illustrating the problem?

gr~~~


>
>> class A : public flext_dsp
>> {
>>   FLEXT_HEADER(A,flext_dsp)
>>   [...]
>>   // no setup function here
>> }
>> class B : public A
>> {
>>   FLEXT_HEADER_S(B,A,setup)
>>   [...]
>>   private:
>>     static void setup(t_classid c);
>>     FLEXT_CALLBACK(some_methods_from_A_or_B)
>> };
>> FLEXT_LIB_DSP_V("B",B)
>> void B::setup(t_classid c)
>> {
>>   [...]
>> }
>> static void lib_setup()
>> {
>>   // call the objects' setup routines
>>   FLEXT_DSP_SETUP(B);
>> }
>> // setup the library
>> FLEXT_LIB_SETUP(B,lib_setup)
>> LG
>> Georg
>> _______________________________________________
>> PD-dev mailing list
>> PD-dev at iem.at
>> http://lists.puredata.info/listinfo/pd-dev
>
>
> -- 
> =%)!:?"§<§0&-"|>*
> http://grh.mur.at
>
> _______________________________________________
> PD-dev mailing list
> PD-dev at iem.at
> http://lists.puredata.info/listinfo/pd-dev
>
>
>





More information about the Pd-dev mailing list