diff options
author | Thiago Macieira <thiago.macieira@nokia.com> | 2009-06-30 09:13:47 (GMT) |
---|---|---|
committer | Thiago Macieira <thiago.macieira@nokia.com> | 2009-07-02 09:43:31 (GMT) |
commit | e7ca74ed8a41eb4c05f436007417d160b6cf94f7 (patch) | |
tree | 458d268e0bd3019a346caad43a731e5a7203757a /src/dbus/qdbusmessage_p.h | |
parent | 8d4657764b0c4362dc25aa79a6e2853b8c98f0ad (diff) | |
download | Qt-e7ca74ed8a41eb4c05f436007417d160b6cf94f7.zip Qt-e7ca74ed8a41eb4c05f436007417d160b6cf94f7.tar.gz Qt-e7ca74ed8a41eb4c05f436007417d160b6cf94f7.tar.bz2 |
Avoid revalidating message parameters.
This is a small performance improvement when making a call: we don't
need to validate what we already know to be valid because we either
designed it to be so or because we've already validated.
The D-Bus library unfortunately validates again and there's nothing we
can do about it. But we can avoid doing it twice in our own code.
Reviewed-By: Marius Bugge Monsen
Diffstat (limited to 'src/dbus/qdbusmessage_p.h')
-rw-r--r-- | src/dbus/qdbusmessage_p.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/dbus/qdbusmessage_p.h b/src/dbus/qdbusmessage_p.h index a0a681f..b8f23dc 100644 --- a/src/dbus/qdbusmessage_p.h +++ b/src/dbus/qdbusmessage_p.h @@ -55,6 +55,7 @@ #include <qatomic.h> #include <qstring.h> +#include <qdbusmessage.h> struct DBusMessage; @@ -69,7 +70,11 @@ public: ~QDBusMessagePrivate(); QList<QVariant> arguments; + + // the following parameters are "const": they are not changed after the constructors + // the parametersValidated member below controls whether they've been validated already QString service, path, interface, name, message, signature; + DBusMessage *msg; DBusMessage *reply; int type; @@ -79,6 +84,10 @@ public: mutable uint delayedReply : 1; uint localMessage : 1; + mutable uint parametersValidated : 1; + + static void setParametersValidated(QDBusMessage &msg, bool enable) + { msg.d_ptr->parametersValidated = enable; } static DBusMessage *toDBusMessage(const QDBusMessage &message, QDBusError *error); static QDBusMessage fromDBusMessage(DBusMessage *dmsg); |