Re: [ROOT] TQObject::Emit()

From: Valeriy Onuchin (onuchin@fnal.gov)
Date: Thu Mar 22 2001 - 23:27:24 MET


 Hi Anton,

Anton Fokin wrote:

>
>
> Hi,
>
> If I want to use singal/slots I have to add Emit("DataChanged()"); or alike
> in my TQObject inherited class method to emit a signal. I am curious if this
> call is costly or not.

 What cost do you mean?

 Memory?

    TQObject has 2 data members which are pointers to TLists( sizeof(TList*) = 4 ).
    These TLists are created(new TList) only when connection is established
    ( sizeof(TList) = 44 ). During creation of connection some internal structures
    are also initiated, but it was designed to make it minimal amd reuses existent ones.


>
>
> I am also not sure what it takes in Qt/moc. In Qt you do not need to call
> Emit() in a signal method - the signal will be emitted automatically once
> the method is declared as signal.
>

("It is not correct ..."  Valery Fine;)


I studied Qt code ... it also uses "Emit" method inside "signal"
Suppose looking at the code produced after MOC preprocessor will reveal it.



>
> So could you comment on performance of Emit("DataCahnged()") decoding (with
> CINT dict, etc.) compare to Qt moc processing.

Fair comparison of benchmark tests is always difficult task
( btw it's not a bad business http://www.tpc.org/information/about/join.asp )

Suggest the "fair test" and I/we can try it.


Regards.    Valeriy



This archive was generated by hypermail 2b29 : Tue Jan 01 2002 - 17:50:40 MET