[ANNOUNCE] D-Bus 1.0 RC 2 (0.94) released

Thiago Macieira thiago at kde.org
Sun Oct 15 13:09:12 PDT 2006


Havoc Pennington wrote:
>DBusBasicValue value;
>dbus_message_iter_get_basic(iter, &value);
>dbus_message_iter_append_basic(other_iter, &value);
>
>i.e. the void* serves as a simple variant type without introducing
>DBusVariant.
>
>(Obviously the above example of copying message-to-message is
>artificial, but copying message-to-some-binding-specific-something is
>not artificial.)

Not really :-)

It exists as such in QtDBus code:
bool QDBusMarshaller::appendCrossMarshalling(QDBusDemarshaller 
*demarshaller)
{
    int code = dbus_message_iter_get_arg_type(&demarshaller->iterator);
    if (dbus_type_is_basic(code)) {
        // easy: just append
        // do exactly like the D-BUS docs suggest
        // (see apidocs for dbus_message_iter_get_basic)

        qlonglong value;
        dbus_message_iter_get_basic(&demarshaller->iterator, &value);
        dbus_message_iter_next(&demarshaller->iterator);
        dbus_message_iter_append_basic(&iterator, code, &value);
        return true;
    }

    [.... other, more complex types follow ...]
}

This is a real use-case situation due to the way the lazy demarshaller 
works.

-- 
  Thiago Macieira  -  thiago (AT) macieira.info - thiago (AT) kde.org
    PGP/GPG: 0x6EF45358; fingerprint:
    E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/dbus/attachments/20061015/bf329f3c/attachment.pgp


More information about the dbus mailing list