Re: dconf

Hi Ronald

Ronald S. Bultje wrote:
                                           what is GVariant, how does
it relate to GValue, will it deprecate GValue and if so, why is it not
possible to just fix GValue instead? It's not in your email which I am
responding to, and it's not in the email which announces the existence
of GVariant either.

GVariant and GValue have two very different goals.

A GValue is designed to hold values that will be passed around inside of a single process. Things inside of GValues have GTypes. They can contain pointers. They are not generally serialisable and therefore cannot, in the general case, be sent between processes. The GType system is shallow in the sense that only the toplevel type is given. For example, you can have G_TYPE_HASH_TABLE, but not "hash table that maps strings to pairs of strings and integers".

A GVariant is exactly equal to what can be sent over DBus -- and in the most direct way. It is exactly the data as it will be sent: no additional encoding required. A GVariant has a completely specified type. You don't just say "array", but you specify the entire type in the same way that you specify DBus "signatures": an array of pairs of strings and integers would be "a(si)". A GVariant (being by definition something that can be sent over the bus) can not contain pointers.

GVariant can not possibly replace GValue for most of the things that we currently use it for so there is no intention that GValue will be deprecated by it. They solve two different problems.

Thanks for the question :)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]