TQT_DBusVariant Class Reference

Data type for representing a D-Bus variant. More...

#include <tqdbusvariant.h>

Collaboration diagram for TQT_DBusVariant:
[legend]

List of all members.

Public Member Functions

 TQT_DBusVariant ()
 TQT_DBusVariant (const TQT_DBusVariant &other)
bool operator== (const TQT_DBusVariant &other) const
bool operator!= (const TQT_DBusVariant &other) const

Public Attributes

TQString signature
TQT_DBusData value

Detailed Description

Data type for representing a D-Bus variant.

When D-Bus methods or signal require that a paramater can have any of the D-Bus data types, a D-Bus variant can be used.

Basically a D-Bus variant includes the actual data and a D-Bus data signature to allow a receiver to determine the contents.

Since the TQT_DBusVariant's value member will already be fully de-marshalled, a receiver using this bindings can savely ignore the signature if it doesn't need it for a different purpose (e.g. logging).

However, when creating a TQT_DBusVariant object for sending, make sure the signature member is correctly setup, for example by using the value member's buildDBusSignature() method.

 TQT_DBusVariant variant;

 variant.value     = TQT_DBusData::fromInt32(131719);
 variant.signature = variant.value.buildDBusSignature();

Definition at line 56 of file tqdbusvariant.h.


Constructor & Destructor Documentation

TQT_DBusVariant::TQT_DBusVariant (  )  [inline]

Creates an empty variant object.

Definition at line 62 of file tqdbusvariant.h.

00062 {}

TQT_DBusVariant::TQT_DBusVariant ( const TQT_DBusVariant other  )  [inline]

Copies the given other variant object.

Parameters:
other the variant object to copy from

Definition at line 69 of file tqdbusvariant.h.

References signature, and value.

00070     {
00071         signature = other.signature;
00072         value = other.value;
00073     }


Member Function Documentation

bool TQT_DBusVariant::operator!= ( const TQT_DBusVariant other  )  const [inline]

Checks if the given other variant is not equal to this one.

Parameters:
other the variant object to compare with
Returns:
true if either signature or value is different, otherwise false

Definition at line 98 of file tqdbusvariant.h.

References signature, and value.

00099     {
00100         if (&other == this) return false;
00101 
00102         return signature != other.signature || value != other.value;
00103     }

bool TQT_DBusVariant::operator== ( const TQT_DBusVariant other  )  const [inline]

Checks if the given other variant is equal to this one.

Parameters:
other the variant object to compare with
Returns:
true if both signature and value are equal, otherwise false

Definition at line 83 of file tqdbusvariant.h.

References signature, and value.

00084     {
00085         if (&other == this) return true;
00086 
00087         return signature == other.signature && value == other.value;
00088     }


Member Data Documentation

The D-Bus data signature of the data contained in value.

See also:
TQT_DBusData::buildDBusSignature()

Definition at line 111 of file tqdbusvariant.h.

The D-Bus data type to transport as a variant.

Definition at line 116 of file tqdbusvariant.h.


The documentation for this class was generated from the following file:
Generated on Fri Apr 26 16:30:22 2019 for DBus-1-TQt by  doxygen 1.6.3