[Gambas-user] DBusVariant or DBusValues?

Hans Lehmann hans at gambas-buch.de
Tue Mar 13 09:21:15 CET 2018


Am 23.02.2018 um 15:00 schrieb Benoît Minisini:
> Le 23/02/2018 à 14:56, Hans Lehmann a écrit :
>> Am 22.02.2018 um 22:44 schrieb Benoît Minisini:
>>> The reason is that if they were the same, i.e. if we had only 
>>> DBusVariant, it would not be possible to make the difference between 
>>> a DBus method that returns of array of three variants with a method 
>>> that returns three values, each one being a variant.
>>>
>>> With DBusValues, we are sure that we want to return several values, 
>>> and that if it the value of the DBusValues is an array, then we have 
>>> multiple values.
>>>
>>> The DBus signature associated with these things are different: "av" 
>>> for the DBusVariant, "vvv" for the DBusValues. 
>> Hello!
>>
>> Would this description also be correct?
>>
>> The reason for the existence of two classes is that only such a 
>> distinction can be made between two methods, one of which returns an 
>> array of three Variant type values and the other three values, each 
>> of which is Variant. In both cases there are exactly three values! 
>> Using DBusValues makes it clear that you want to return several 
>> values. This is also reflected in the different DBus signatures: for 
>> DBusVariant it is "av" and for DBusValues it is "vvv".
>> ?
>>
>> Regards
>>
>> Honsek
>>
>
> Mmm. I think so... If it's for a book, you can provide an example to 
> explain that if you want to return several values, you have to use 
> DBusValues because DBusVariant is ambiguous.
>
> -- 
> Benoît Minisini

Hello,

do all the above considerations for the return value of methods also 
apply in the same way for signals to be sent with complex signatures?
Or are there serious differences?

With kind regards

Hans


More information about the User mailing list