Emit a signal with a varying number of arguments,
paramArr is an array of the parameters.
Note: any parameter should be converted to long type.
Example:
TQObject *processor; // data processor
TH1F *hist; // filled with processor results
Emit a signal with a varying number of arguments,
paramArr is an array of the parameters.
Note: any parameter should be converted to long type.
Example:
TQObject *processor; // data processor
TH1F *hist; // filled with processor results
Well, I did convert the parameters to a Long_t. You will see that when you look at the example, that I’ve sent with the first post.
I believe that the signal will work with floats, because floats are represented by 32Bit, same as longs. But doubles are 64Bit variables, and I was wondering that this might be the problem with sending doubles. But how can one sent doubles using the signal/slot mechanism? Or is it only possible to send floats?
I was thinking about this solution myself. But unfortunatly this will make things more complicated than they already are. But if there is no way to send more than one double, exept for a double array, then I have to rewrite the classes.
I already tried also the following:
[code]
Long_t args[2]
args[0] = (Long_t) &first;
args[1] = (Long_t) &second;[/code]
This works, if one has the follwing Signal:
But again, it will make things more complicated for me. And I was just wondering wether there is something obvious, that I am missing in sending more than one double.
Hi Lutz,
the limitation with “doubles” is on
CINT lower level. Now it’s possible
to execute “pointers to longs” only.
I’ll try to discuss this problem with Masa.
As far as I understood you have problem
with sending several doubles in signal to some class method which is not possible
to change (it could be compiled class).
Is it true?
[quote]As far as I understood you have problem
with sending several doubles in signal to some class method which is not possible
to change (it could be compiled class).
Is it true? [/quote]
Not exactly. I can change the class method. But it takes some time to rewrite it, so that everything is working again. It is just a lot of work
Thats why I was wondering wether I am doing something wrong, or with root it is not possible to accomplish what I was trying to do.
I think I will stick to what you suggested earlier, sending a the doubles in an array.