DBus-1-TQt  1.0
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
TQT_DBusData Class Reference

#include <tqdbusdata.h>

+ Collaboration diagram for TQT_DBusData:

Classes

class  Private

Public Types

enum  Type {
  Invalid = 0, Bool, Byte, Int16,
  UInt16, Int32, UInt32, Int64,
  UInt64, Double, String, ObjectPath,
  UnixFd, List, Struct, Variant,
  Map
}

Public Member Functions

 TQT_DBusData ()
 TQT_DBusData (const TQT_DBusData &other)
 ~TQT_DBusData ()
TQT_DBusDataoperator= (const TQT_DBusData &other)
bool operator== (const TQT_DBusData &other) const
bool operator!= (const TQT_DBusData &other) const
bool isValid () const
Type type () const
Type keyType () const
const char * typeName () const
bool toBool (bool *ok=0) const
TQ_UINT8 toByte (bool *ok=0) const
TQ_INT16 toInt16 (bool *ok=0) const
TQ_UINT16 toUInt16 (bool *ok=0) const
TQ_INT32 toInt32 (bool *ok=0) const
TQ_UINT32 toUInt32 (bool *ok=0) const
TQ_INT64 toInt64 (bool *ok=0) const
TQ_UINT64 toUInt64 (bool *ok=0) const
double toDouble (bool *ok=0) const
TQString toString (bool *ok=0) const
TQT_DBusObjectPath toObjectPath (bool *ok=0) const
TQT_DBusUnixFd toUnixFd (bool *ok=0) const
TQT_DBusDataList toList (bool *ok=0) const
TQValueList< TQT_DBusDatatoTQValueList (bool *ok=0) const
TQValueList< TQT_DBusDatatoStruct (bool *ok=0) const
TQT_DBusVariant toVariant (bool *ok=0) const
TQT_DBusData getAsVariantData ()
TQT_DBusDataMap< TQ_UINT8 > toByteKeyMap (bool *ok=0) const
TQT_DBusDataMap< TQ_INT16 > toInt16KeyMap (bool *ok=0) const
TQT_DBusDataMap< TQ_UINT16 > toUInt16KeyMap (bool *ok=0) const
TQT_DBusDataMap< TQ_INT32 > toInt32KeyMap (bool *ok=0) const
TQT_DBusDataMap< TQ_UINT32 > toUInt32KeyMap (bool *ok=0) const
TQT_DBusDataMap< TQ_INT64 > toInt64KeyMap (bool *ok=0) const
TQT_DBusDataMap< TQ_UINT64 > toUInt64KeyMap (bool *ok=0) const
TQT_DBusDataMap< TQString > toStringKeyMap (bool *ok=0) const
TQT_DBusDataMap
< TQT_DBusObjectPath
toObjectPathKeyMap (bool *ok=0) const
TQT_DBusDataMap< TQT_DBusUnixFdtoUnixFdKeyMap (bool *ok=0) const
TQCString buildDBusSignature () const

Static Public Member Functions

static const char * typeName (Type type)
static TQT_DBusData fromBool (bool value)
static TQT_DBusData fromByte (TQ_UINT8 value)
static TQT_DBusData fromInt16 (TQ_INT16 value)
static TQT_DBusData fromUInt16 (TQ_UINT16 value)
static TQT_DBusData fromInt32 (TQ_INT32 value)
static TQT_DBusData fromUInt32 (TQ_UINT32 value)
static TQT_DBusData fromInt64 (TQ_INT64 value)
static TQT_DBusData fromUInt64 (TQ_UINT64 value)
static TQT_DBusData fromDouble (double value)
static TQT_DBusData fromString (const TQString &value)
static TQT_DBusData fromObjectPath (const TQT_DBusObjectPath &value)
static TQT_DBusData fromUnixFd (const TQT_DBusUnixFd &value)
static TQT_DBusData fromList (const TQT_DBusDataList &list)
static TQT_DBusData fromTQValueList (const TQValueList< TQT_DBusData > &list)
static TQT_DBusData fromStruct (const TQValueList< TQT_DBusData > &memberList)
static TQT_DBusData fromVariant (const TQT_DBusVariant &value)
static TQT_DBusData fromByteKeyMap (const TQT_DBusDataMap< TQ_UINT8 > &map)
static TQT_DBusData fromInt16KeyMap (const TQT_DBusDataMap< TQ_INT16 > &map)
static TQT_DBusData fromUInt16KeyMap (const TQT_DBusDataMap< TQ_UINT16 > &map)
static TQT_DBusData fromInt32KeyMap (const TQT_DBusDataMap< TQ_INT32 > &map)
static TQT_DBusData fromUInt32KeyMap (const TQT_DBusDataMap< TQ_UINT32 > &map)
static TQT_DBusData fromInt64KeyMap (const TQT_DBusDataMap< TQ_INT64 > &map)
static TQT_DBusData fromUInt64KeyMap (const TQT_DBusDataMap< TQ_UINT64 > &map)
static TQT_DBusData fromStringKeyMap (const TQT_DBusDataMap< TQString > &map)
static TQT_DBusData fromObjectPathKeyMap (const TQT_DBusDataMap< TQT_DBusObjectPath > &map)
static TQT_DBusData fromUnixFdKeyMap (const TQT_DBusDataMap< TQT_DBusUnixFd > &map)

Private Attributes

Privated

Detailed Description

Class for accurately representing D-Bus data types.

The TQT_DBusData class can be compared to TQt's TQVariant class, but specialized to contain data types used in D-Bus messages.

Like TQVariant objects of TQT_DBusData use implicit sharing, i.e. copying a TQT_DBusData object is a cheap operation and does not require that the content itself is copied.

Depending on the Type of the object, the content can be a recursive construct of TQT_DBusData objects, e.g. a List can contain elements that are containers themselves, e.g. Map, Struct, Variant or even List again.

See Also
TQT_DBusDataList
TQT_DBusDataMap
TQT_DBusDataConverter

Definition at line 58 of file tqdbusdata.h.

Member Enumeration Documentation

Enum for the data types used in D-Bus messages.

In order to provide correct mapping of C++ and TQt types and the data types used in D-Bus messages, TQT_DBusData uses explicit naming of types where the name is usually the one used in D-Bus, with the exception of List and Map since this is closer to the TQt container they are implemented with (TQValueList and TQMap respectively)

See Also
type(), keyType()
typeName()
Enumerator:
Invalid 

Base type for TQT_DBusData objects created by the default constructor.

Also used as the type of returned objects when getter type methods fail due to type incompatabilties, i.e. toInt32() called on a List object.

See Also
isValid()
Bool 

Type when encapsulating a boolean value.

See Also
fromBool(), toBool()
Byte 

Type when encapsulating a byte (unsigned char) value.

See Also
fromByte(), toByte()
Int16 

Type when encapsulating a signed 16-bit integer value.

See Also
fromInt16(), toInt16()
UInt16 

Type when encapsulating an unsigned 16-bit integer value.

See Also
fromUInt16(), toUInt16()
Int32 

Type when encapsulating a signed 32-bit integer value.

See Also
fromInt32(), toInt32()
UInt32 

Type when encapsulating an unsigned 32-bit integer value.

See Also
fromUInt32(), toUInt32()
Int64 

Type when encapsulating a signed 64-bit integer value.

See Also
fromInt64(), toInt64()
UInt64 

Type when encapsulating an unsigned 64-bit integer value.

See Also
fromUInt64(), toUInt64()
Double 

Type when encapsulating a double value.

See Also
fromDouble(), toDouble()
String 

Type when encapsulating a string value.

All strings are converted to UTF-8 during transmission

See Also
fromString(), toString()
ObjectPath 

Type when encapsulating a D-Bus object path.

D-Bus defines a special string variation for transporting the paths used to address objects within D-Bus services, see Object paths for formatting details.

Note
from the point of view of this bindings an object path is pretty much a normal string with externally checked restrictions. However, method calls or return values can require a signature to include an object path and any remote peer might then reject the normal string signature.
See Also
fromObjectPath(), toObjectPath()
UnixFd 

Type when encapsulating a D-Bus unix file handle.

See Also
fromUnixFd(), toUnixFd()
List 

Type when encapsulating a list of values.

The D-Bus type this maps to is called array but since the TQt container class used to implement this type is TQValueList (or rather TQT_DBusDataList), the TQT_DBusData type is called List instead.

A list can contain any of the supported types as elements, even container types. However it can only contain elements with the same type per list object.

See Also
fromList(), toList()
Struct 

Type when encapsulating a struct of values.

A struct is basically a list of struct member variables, each member can be any of the supported types, even containers types.

The C++/TQt value type used in the converter methods is a TQValueList with type TQT_DBusData. For example a TQRect could be mapped like this:

TQRect rect(0, 0, 640, 480);
TQValueList<TQT_DBusData> memberList;
memberList << TQT_DBusData::fromInt32(rect.x());
memberList << TQT_DBusData::fromInt32(rect.y());
memberList << TQT_DBusData::fromInt32(rect.width());
memberList << TQT_DBusData::fromInt32(rect.height());

And reconstructed like this:

memberList = data.toStruct();
int x = memberList[0].toInt32();
int y = memberList[1].toInt32();
int w = memberList[2].toInt32();
int h = memberList[3].toInt32();
rect = TQRect(x, y, w, h);
Note
Empty structs, i.e. an empty member list, are not allowed
See Also
fromStruct(), toStruct()
TQT_DBusDataConverter
Variant 

Type when encapsulating a special variable container value.

See TQT_DBusVariant for details on variant usage.

See Also
fromVariant(), toVariant()
Map 

Type when encapsulating a map of keys to values.

The D-Bus type this maps to is called dict but since the TQt container class used to implement this type is TQMap (or rather TQT_DBusDataMap), the TQT_DBusData type is called Map instead.

A map can contain any of the supported types as values, even container types, but only the following basic types as keys:

All values need to be of the same type.

See Also
fromByteKeyMap(), toByteKeyMap()
fromInt16KeyMap(), toInt16KeyMap()
fromUInt16KeyMap(), toUInt16KeyMap()
fromInt32KeyMap(), toInt32KeyMap()
fromUInt32KeyMap(), toUInt32KeyMap()
fromInt64KeyMap(), toInt64KeyMap()
fromUInt64KeyMap(), toUInt64KeyMap()
fromStringKeyMap(), toStringKeyMap()
fromObjectPathKeyMap(), toObjectPathKeyMap()
fromUnixFdKeyMap(), toUnixFdKeyMap()

Definition at line 73 of file tqdbusdata.h.

Constructor & Destructor Documentation

TQT_DBusData::TQT_DBusData ( )

Creates an empty, Invalid data object.

Definition at line 176 of file tqdbusdata.cpp.

: d(new Private())
{
}

+ Here is the caller graph for this function:

TQT_DBusData::TQT_DBusData ( const TQT_DBusData other)

Copies a given other data object.

Since TQT_DBusData is implicitly shared, both objects will have the same content and the last object to reference it will delete it.

Parameters
otherthe object to copy

Definition at line 180 of file tqdbusdata.cpp.

References d.

: d(0)
{
d = other.d;
d->ref();
}
TQT_DBusData::~TQT_DBusData ( )

Destroys the data object.

If this is the last instance to a shared content, it will delete it as well.

Definition at line 187 of file tqdbusdata.cpp.

References d.

{
if (d->deref()) delete d;
}

Member Function Documentation

TQCString TQT_DBusData::buildDBusSignature ( ) const

Creates the data objects D-Bus signature.

Recursivly builds the D-Bus signature of the data object if it holds a container type, i.e. if the object is of type List, Map or Struct

This can be used to create a signature for TQT_DBusVariant when creating one for sending over D-Bus.

Returns
a string containing the content's signature, or a null string if the data object is Invalid

Definition at line 1034 of file tqdbusdata.cpp.

References buildDBusSignature(), Byte, TQT_DBusDataList::containerItemType(), d, TQT_DBusDataList::hasContainerItemType(), Int16, Int32, Int64, keyType(), List, Map, ObjectPath, TQT_DBusData::Private::pointer, qDBusTypeForTQT_DBusType(), String, Struct, TQT_DBusData::Private::type, TQT_DBusDataList::type(), UInt16, UInt32, UInt64, UnixFd, and TQT_DBusData::Private::value.

{
TQCString signature;
switch (d->type)
{
{
signature = DBUS_TYPE_ARRAY_AS_STRING;
if (list->hasContainerItemType())
signature += list->containerItemType().buildDBusSignature();
else
signature += qDBusTypeForTQT_DBusType(list->type());
break;
}
{
signature += DBUS_STRUCT_BEGIN_CHAR;
TQValueList<TQT_DBusData>* memberList =
(TQValueList<TQT_DBusData>*) d->value.pointer;
TQValueList<TQT_DBusData>::const_iterator it = (*memberList).begin();
TQValueList<TQT_DBusData>::const_iterator endIt = (*memberList).end();
for (; it != endIt; ++it)
{
signature += (*it).buildDBusSignature();
}
signature += DBUS_STRUCT_END_CHAR;
break;
}
signature += DBUS_TYPE_ARRAY_AS_STRING;
signature += DBUS_DICT_ENTRY_BEGIN_CHAR;
switch (keyType())
{
signature += qDBusSignatureForMapValue<TQ_UINT8>(
break;
signature += qDBusSignatureForMapValue<TQ_INT16>(
break;
signature += qDBusSignatureForMapValue<TQ_UINT16>(
break;
signature += qDBusSignatureForMapValue<TQ_INT32>(
break;
signature += qDBusSignatureForMapValue<TQ_UINT32>(
break;
signature += qDBusSignatureForMapValue<TQ_INT64>(
break;
signature += qDBusSignatureForMapValue<TQ_UINT64>(
break;
signature += qDBusSignatureForMapValue<TQString>(
break;
signature += qDBusSignatureForMapValue<TQT_DBusObjectPath>(
break;
signature += qDBusSignatureForMapValue<TQT_DBusUnixFd>(
break;
default:
break;
}
signature += DBUS_DICT_ENTRY_END_CHAR;
break;
default:
break;
}
return signature;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

TQT_DBusData TQT_DBusData::fromBool ( bool  value)
static

Creates a data object for the given boolean value.

Parameters
valuethe value to encapsulate
Returns
a data object of type Bool containing the value
See Also
toBool()

Definition at line 355 of file tqdbusdata.cpp.

References Bool, TQT_DBusData::Private::boolValue, d, TQT_DBusData::Private::type, and TQT_DBusData::Private::value.

{
data.d->value.boolValue = value;
return data;
}

+ Here is the caller graph for this function:

TQT_DBusData TQT_DBusData::fromByte ( TQ_UINT8  value)
static

Creates a data object for the given byte (unsigned char) value.

Parameters
valuethe value to encapsulate
Returns
a data object of type Byte containing the value
See Also
toByte()

Definition at line 378 of file tqdbusdata.cpp.

References Byte, TQT_DBusData::Private::byteValue, d, TQT_DBusData::Private::type, and TQT_DBusData::Private::value.

{
data.d->value.byteValue = value;
return data;
}

+ Here is the caller graph for this function:

TQT_DBusData TQT_DBusData::fromByteKeyMap ( const TQT_DBusDataMap< TQ_UINT8 > &  map)
static

Creates a data object for the given map.

Note
The map is allowed to be empty but is required to have a valid value type

The resulting data object will have the keyType() set to Byte.

Parameters
mapthe map to encapsulate
Returns
a data object of type Map containing the map or an Invalid object if the map's value type is Invalid
See Also
toByteKeyMap()

Definition at line 742 of file tqdbusdata.cpp.

References d, TQT_DBusData::Private::keyType, TQT_DBusDataMap< T >::keyType(), Map, TQT_DBusData::Private::pointer, TQT_DBusData::Private::type, and TQT_DBusData::Private::value.

{
data.d->keyType = map.keyType();
return data;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

TQT_DBusData TQT_DBusData::fromDouble ( double  value)
static

Creates a data object for the given double value.

Parameters
valuethe value to encapsulate
Returns
a data object of type Double containing the value
See Also
toDouble()

Definition at line 539 of file tqdbusdata.cpp.

References d, Double, TQT_DBusData::Private::doubleValue, TQT_DBusData::Private::type, and TQT_DBusData::Private::value.

{
data.d->value.doubleValue = value;
return data;
}

+ Here is the caller graph for this function:

TQT_DBusData TQT_DBusData::fromInt16 ( TQ_INT16  value)
static

Creates a data object for the given signed 16-bit integer value.

Parameters
valuethe value to encapsulate
Returns
a data object of type Int16 containing the value
See Also
toInt16()

Definition at line 401 of file tqdbusdata.cpp.

References d, Int16, TQT_DBusData::Private::int16Value, TQT_DBusData::Private::type, and TQT_DBusData::Private::value.

{
data.d->value.int16Value = value;
return data;
}

+ Here is the caller graph for this function:

TQT_DBusData TQT_DBusData::fromInt16KeyMap ( const TQT_DBusDataMap< TQ_INT16 > &  map)
static

Creates a data object for the given map.

Note
The map is allowed to be empty but is required to have a valid value type

The resulting data object will have the keyType() set to Int16.

Parameters
mapthe map to encapsulate
Returns
a data object of type Map containing the map or an Invalid object if the map's value type is Invalid
See Also
toInt16KeyMap()

Definition at line 766 of file tqdbusdata.cpp.

References d, TQT_DBusData::Private::keyType, TQT_DBusDataMap< T >::keyType(), Map, TQT_DBusData::Private::pointer, TQT_DBusData::Private::type, and TQT_DBusData::Private::value.

{
data.d->keyType = map.keyType();
return data;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

TQT_DBusData TQT_DBusData::fromInt32 ( TQ_INT32  value)
static

Creates a data object for the given signed 32-bit integer value.

Parameters
valuethe value to encapsulate
Returns
a data object of type Int32 containing the value
See Also
toInt32()

Definition at line 447 of file tqdbusdata.cpp.

References d, Int32, TQT_DBusData::Private::int32Value, TQT_DBusData::Private::type, and TQT_DBusData::Private::value.

{
data.d->value.int32Value = value;
return data;
}

+ Here is the caller graph for this function:

TQT_DBusData TQT_DBusData::fromInt32KeyMap ( const TQT_DBusDataMap< TQ_INT32 > &  map)
static

Creates a data object for the given map.

Note
The map is allowed to be empty but is required to have a valid value type

The resulting data object will have the keyType() set to Int32.

Parameters
mapthe map to encapsulate
Returns
a data object of type Map containing the map or an Invalid object if the map's value type is Invalid
See Also
toInt32KeyMap()

Definition at line 815 of file tqdbusdata.cpp.

References d, TQT_DBusData::Private::keyType, TQT_DBusDataMap< T >::keyType(), Map, TQT_DBusData::Private::pointer, TQT_DBusData::Private::type, and TQT_DBusData::Private::value.

{
data.d->keyType = map.keyType();
return data;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

TQT_DBusData TQT_DBusData::fromInt64 ( TQ_INT64  value)
static

Creates a data object for the given signed 64-bit integer value.

Parameters
valuethe value to encapsulate
Returns
a data object of type Int64 containing the value
See Also
toInt64()

Definition at line 493 of file tqdbusdata.cpp.

References d, Int64, TQT_DBusData::Private::int64Value, TQT_DBusData::Private::type, and TQT_DBusData::Private::value.

{
data.d->value.int64Value = value;
return data;
}

+ Here is the caller graph for this function:

TQT_DBusData TQT_DBusData::fromInt64KeyMap ( const TQT_DBusDataMap< TQ_INT64 > &  map)
static

Creates a data object for the given map.

Note
The map is allowed to be empty but is required to have a valid value type

The resulting data object will have the keyType() set to Int64.

Parameters
mapthe map to encapsulate
Returns
a data object of type Map containing the map or an Invalid object if the map's value type is Invalid
See Also
toInt64KeyMap()

Definition at line 864 of file tqdbusdata.cpp.

References d, TQT_DBusData::Private::keyType, TQT_DBusDataMap< T >::keyType(), Map, TQT_DBusData::Private::pointer, TQT_DBusData::Private::type, and TQT_DBusData::Private::value.

{
data.d->keyType = map.keyType();
return data;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

TQT_DBusData TQT_DBusData::fromList ( const TQT_DBusDataList list)
static

Creates a data object for the given list.

Note
The list is allowed to be empty but is required to have a valid type

Unless the list the is empty, the convenience method fromTQValueList() will usually be easier to use since it does not require to create a TQT_DBusDataList first. For empty lists this method has to be used to make sure there is sufficient type information on the list's elements available for the binding's marshalling code.

Parameters
listthe list to encapsulate
Returns
a data object of type List containing the list or an Invalid object if the list's type is Invalid
See Also
toList()

Definition at line 637 of file tqdbusdata.cpp.

References d, Invalid, List, TQT_DBusData::Private::pointer, TQT_DBusData::Private::type, TQT_DBusDataList::type(), and TQT_DBusData::Private::value.

{
if (list.type() == TQT_DBusData::Invalid) return data;
data.d->value.pointer = new TQT_DBusDataList(list);
return data;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

TQT_DBusData TQT_DBusData::fromObjectPath ( const TQT_DBusObjectPath value)
static

Creates a data object for the given object path value.

Parameters
valuethe value to encapsulate
Returns
a data object of type ObjectPath containing the value
See Also
toObjectPath()

Definition at line 585 of file tqdbusdata.cpp.

References d, TQT_DBusObjectPath::isValid(), ObjectPath, TQT_DBusData::Private::pointer, TQT_DBusData::Private::type, and TQT_DBusData::Private::value.

{
if (value.isValid())
{
data.d->value.pointer = new TQT_DBusObjectPath(value);
}
return data;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

TQT_DBusData TQT_DBusData::fromObjectPathKeyMap ( const TQT_DBusDataMap< TQT_DBusObjectPath > &  map)
static

Creates a data object for the given map.

Note
The map is allowed to be empty but is required to have a valid value type

The resulting data object will have the keyType() set to ObjectPath.

Parameters
mapthe map to encapsulate
Returns
a data object of type Map containing the map or an Invalid object if the map's value type is Invalid
See Also
toObjectPathKeyMap()

Definition at line 937 of file tqdbusdata.cpp.

References d, TQT_DBusData::Private::keyType, TQT_DBusDataMap< T >::keyType(), Map, TQT_DBusData::Private::pointer, TQT_DBusData::Private::type, and TQT_DBusData::Private::value.

{
data.d->keyType = map.keyType();
return data;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

TQT_DBusData TQT_DBusData::fromString ( const TQString &  value)
static

Creates a data object for the given string value.

Parameters
valuethe value to encapsulate
Returns
a data object of type String containing the value
See Also
toString()

Definition at line 562 of file tqdbusdata.cpp.

References d, TQT_DBusData::Private::pointer, String, TQT_DBusData::Private::type, and TQT_DBusData::Private::value.

{
data.d->value.pointer = new TQString(value);
return data;
}

+ Here is the caller graph for this function:

TQT_DBusData TQT_DBusData::fromStringKeyMap ( const TQT_DBusDataMap< TQString > &  map)
static

Creates a data object for the given map.

Note
The map is allowed to be empty but is required to have a valid value type

The resulting data object will have the keyType() set to String.

Parameters
mapthe map to encapsulate
Returns
a data object of type Map containing the map or an Invalid object if the map's value type is Invalid
See Also
toStringKeyMap()

Definition at line 913 of file tqdbusdata.cpp.

References d, TQT_DBusData::Private::keyType, TQT_DBusDataMap< T >::keyType(), Map, TQT_DBusData::Private::pointer, TQT_DBusData::Private::type, and TQT_DBusData::Private::value.

{
data.d->keyType = map.keyType();
return data;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

TQT_DBusData TQT_DBusData::fromStruct ( const TQValueList< TQT_DBusData > &  memberList)
static

Creates a data object for the given struct's memberList.

See the documentation of Struct for an example.

Parameters
memberListthe list of already encapsulated struct members
Returns
a data object of type Struct containing the memberList
See Also
toStruct()

Definition at line 681 of file tqdbusdata.cpp.

References d, Invalid, TQT_DBusData::Private::pointer, Struct, TQT_DBusData::Private::type, and TQT_DBusData::Private::value.

{
TQValueList<TQT_DBusData>::const_iterator it = memberList.begin();
TQValueList<TQT_DBusData>::const_iterator endIt = memberList.end();
for (; it != endIt; ++it)
{
if ((*it).d->type == Invalid) return data;
}
data.d->value.pointer = new TQValueList<TQT_DBusData>(memberList);
return data;
}

+ Here is the caller graph for this function:

TQT_DBusData TQT_DBusData::fromTQValueList ( const TQValueList< TQT_DBusData > &  list)
static

Creates a data object for the given list.

Warning
All elements of the list have to be of the same Type

Convenience overload for fromList(), usually more straight forward to use because it doesn't require to create a TQT_DBusDataList object first, however it can only handle lists which contain elements, for empty lists fromList() is the only option.

Parameters
listthe list to encapsulate
Returns
a data object of type List containing the list or an Invalid object if the list is empty or if elements have different types.
See Also
toTQValueList()

Definition at line 662 of file tqdbusdata.cpp.

References fromList().

{
return fromList(TQT_DBusDataList(list));
}

+ Here is the call graph for this function:

TQT_DBusData TQT_DBusData::fromUInt16 ( TQ_UINT16  value)
static

Creates a data object for the given unsigned 16-bit integer value.

Parameters
valuethe value to encapsulate
Returns
a data object of type UInt16 containing the value
See Also
toUInt16()

Definition at line 424 of file tqdbusdata.cpp.

References d, TQT_DBusData::Private::type, UInt16, TQT_DBusData::Private::uint16Value, and TQT_DBusData::Private::value.

{
data.d->value.uint16Value = value;
return data;
}

+ Here is the caller graph for this function:

TQT_DBusData TQT_DBusData::fromUInt16KeyMap ( const TQT_DBusDataMap< TQ_UINT16 > &  map)
static

Creates a data object for the given map.

Note
The map is allowed to be empty but is required to have a valid value type

The resulting data object will have the keyType() set to UInt16.

Parameters
mapthe map to encapsulate
Returns
a data object of type Map containing the map or an Invalid object if the map's value type is Invalid
See Also
toUInt16KeyMap()

Definition at line 790 of file tqdbusdata.cpp.

References d, TQT_DBusData::Private::keyType, TQT_DBusDataMap< T >::keyType(), Map, TQT_DBusData::Private::pointer, TQT_DBusData::Private::type, and TQT_DBusData::Private::value.

{
data.d->keyType = map.keyType();
return data;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

TQT_DBusData TQT_DBusData::fromUInt32 ( TQ_UINT32  value)
static

Creates a data object for the given unsigned 32-bit integer value.

Parameters
valuethe value to encapsulate
Returns
a data object of type UInt32 containing the value
See Also
toUInt32()

Definition at line 470 of file tqdbusdata.cpp.

References d, TQT_DBusData::Private::type, UInt32, TQT_DBusData::Private::uint32Value, and TQT_DBusData::Private::value.

{
data.d->value.uint32Value = value;
return data;
}

+ Here is the caller graph for this function:

TQT_DBusData TQT_DBusData::fromUInt32KeyMap ( const TQT_DBusDataMap< TQ_UINT32 > &  map)
static

Creates a data object for the given map.

Note
The map is allowed to be empty but is required to have a valid value type

The resulting data object will have the keyType() set to UInt32.

Parameters
mapthe map to encapsulate
Returns
a data object of type Map containing the map or an Invalid object if the map's value type is Invalid
See Also
toUInt32KeyMap()

Definition at line 839 of file tqdbusdata.cpp.

References d, TQT_DBusData::Private::keyType, TQT_DBusDataMap< T >::keyType(), Map, TQT_DBusData::Private::pointer, TQT_DBusData::Private::type, and TQT_DBusData::Private::value.

{
data.d->keyType = map.keyType();
return data;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

TQT_DBusData TQT_DBusData::fromUInt64 ( TQ_UINT64  value)
static

Creates a data object for the given unsigned 64-bit integer value.

Parameters
valuethe value to encapsulate
Returns
a data object of type UInt64 containing the value
See Also
toUInt64()

Definition at line 516 of file tqdbusdata.cpp.

References d, TQT_DBusData::Private::type, UInt64, TQT_DBusData::Private::uint64Value, and TQT_DBusData::Private::value.

{
data.d->value.uint64Value = value;
return data;
}

+ Here is the caller graph for this function:

TQT_DBusData TQT_DBusData::fromUInt64KeyMap ( const TQT_DBusDataMap< TQ_UINT64 > &  map)
static

Creates a data object for the given map.

Note
The map is allowed to be empty but is required to have a valid value type

The resulting data object will have the keyType() set to UInt64.

Parameters
mapthe map to encapsulate
Returns
a data object of type Map containing the map or an Invalid object if the map's value type is Invalid
See Also
toUInt64KeyMap()

Definition at line 888 of file tqdbusdata.cpp.

References d, TQT_DBusData::Private::keyType, TQT_DBusDataMap< T >::keyType(), Map, TQT_DBusData::Private::pointer, TQT_DBusData::Private::type, and TQT_DBusData::Private::value.

{
data.d->keyType = map.keyType();
return data;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

TQT_DBusData TQT_DBusData::fromUnixFd ( const TQT_DBusUnixFd value)
static

Creates a data object for the given unix file handle value.

Parameters
valuethe value to encapsulate
Returns
a data object of type UnixFd containing the value
See Also
toUnixFd()

Definition at line 611 of file tqdbusdata.cpp.

References d, TQT_DBusUnixFd::isValid(), TQT_DBusData::Private::pointer, TQT_DBusData::Private::type, UnixFd, and TQT_DBusData::Private::value.

{
if (value.isValid())
{
data.d->value.pointer = new TQT_DBusUnixFd(value);
}
return data;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

TQT_DBusData TQT_DBusData::fromUnixFdKeyMap ( const TQT_DBusDataMap< TQT_DBusUnixFd > &  map)
static

Creates a data object for the given map.

Note
The map is allowed to be empty but is required to have a valid value type

The resulting data object will have the keyType() set to UnixFd.

Parameters
mapthe map to encapsulate
Returns
a data object of type Map containing the map or an Invalid object if the map's value type is Invalid
See Also
toUnixFdhKeyMap()

Definition at line 962 of file tqdbusdata.cpp.

References d, TQT_DBusData::Private::keyType, TQT_DBusDataMap< T >::keyType(), Map, TQT_DBusData::Private::pointer, TQT_DBusData::Private::type, and TQT_DBusData::Private::value.

{
data.d->keyType = map.keyType();
return data;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

TQT_DBusData TQT_DBusData::fromVariant ( const TQT_DBusVariant value)
static

Creates a data object for the given variant value.

Parameters
valuethe value to encapsulate
Returns
a data object of type Variant containing the value
See Also
toVariant()

Definition at line 711 of file tqdbusdata.cpp.

References d, TQT_DBusData::Private::pointer, TQT_DBusData::Private::type, TQT_DBusData::Private::value, and Variant.

{
data.d->value.pointer = new TQT_DBusVariant(value);
return data;
}

+ Here is the caller graph for this function:

TQT_DBusData TQT_DBusData::getAsVariantData ( )

Creates a variant from this object and returns it as a TQT_DBusData object.

Returns
a data object of type Variant containing this object

Definition at line 734 of file tqdbusdata.cpp.

References buildDBusSignature(), fromVariant(), TQT_DBusVariant::signature, and TQT_DBusVariant::value.

{
TQT_DBusVariant variant;
variant.value = *this;
variant.signature = variant.value.buildDBusSignature();
return TQT_DBusData::fromVariant(variant);
}

+ Here is the call graph for this function:

bool TQT_DBusData::isValid ( ) const
inline

Checks whether the data object contains a valid content.

This is equal to checking type() for not being Invalid

Returns
true if the data object is valid, otherwise false

Definition at line 349 of file tqdbusdata.h.

References Invalid.

{ return type() != TQT_DBusData::Invalid; }

+ Here is the caller graph for this function:

TQT_DBusData::Type TQT_DBusData::keyType ( ) const

Returns the Type of the key type for maps.

If the type of the data object is Map, this method returns the type of the map's key, String for a TQT_DBusDataMap<TQString>

If the type of the data object is not Map, it will return Invalid

Returns
one of the values of the Type enum, Invalid if the object is not holding a Map
See Also
type()
typeName()

Definition at line 322 of file tqdbusdata.cpp.

References d, Invalid, TQT_DBusData::Private::keyType, Map, and TQT_DBusData::Private::type.

{
return d->keyType;
}

+ Here is the caller graph for this function:

bool TQT_DBusData::operator!= ( const TQT_DBusData other) const

Checks if the given other data object is different from this instance.

Parameters
otherthe object to compare with
Returns
false if the two data objects are not equal, otherwise false
See Also
operator==()

Definition at line 312 of file tqdbusdata.cpp.

References operator==().

{
return !operator==(other);
}

+ Here is the call graph for this function:

TQT_DBusData & TQT_DBusData::operator= ( const TQT_DBusData other)

Copies a given other data object.

Since TQT_DBusData is implicitly shared, both objects will have the same content and the last object to reference it will delete it.

Parameters
otherthe object to copy
Returns
a reference to this instance

Definition at line 192 of file tqdbusdata.cpp.

References d.

{
if (&other == this) return *this;
if (d->deref()) delete d;
d = other.d;
d->ref();
return *this;
}

+ Here is the caller graph for this function:

bool TQT_DBusData::operator== ( const TQT_DBusData other) const

Checks if the given other data object is equal to this instance.

Two TQT_DBusData object are considered equal if they reference the same shared content or have the same type and the content's equality operator says the contents are equal.

Parameters
otherthe object to compare with
Returns
true if the two data objects are equal, otherwise false

Definition at line 205 of file tqdbusdata.cpp.

References Bool, TQT_DBusData::Private::boolValue, Byte, TQT_DBusData::Private::byteValue, d, Double, TQT_DBusData::Private::doubleValue, Int16, TQT_DBusData::Private::int16Value, Int32, TQT_DBusData::Private::int32Value, Int64, TQT_DBusData::Private::int64Value, Invalid, TQT_DBusData::Private::keyType, List, Map, ObjectPath, String, Struct, toByteKeyMap(), toInt16KeyMap(), toInt32KeyMap(), toInt64KeyMap(), toList(), toObjectPath(), toObjectPathKeyMap(), toString(), toStringKeyMap(), toStruct(), toUInt16KeyMap(), toUInt32KeyMap(), toUInt64KeyMap(), toUnixFd(), toUnixFdKeyMap(), toVariant(), TQT_DBusData::Private::type, typeName(), UInt16, TQT_DBusData::Private::uint16Value, UInt32, TQT_DBusData::Private::uint32Value, UInt64, TQT_DBusData::Private::uint64Value, UnixFd, TQT_DBusData::Private::value, and Variant.

{
if (&other == this) return true;
if (d == other.d) return true;
if (d->type == other.d->type)
{
switch (d->type)
{
return true;
return d->value.boolValue == other.d->value.boolValue;
return d->value.byteValue == other.d->value.byteValue;
return d->value.int16Value == other.d->value.int16Value;
return d->value.uint16Value == other.d->value.uint16Value;
return d->value.int32Value == other.d->value.int32Value;
return d->value.uint32Value == other.d->value.uint64Value;
return d->value.int64Value == other.d->value.int64Value;
return d->value.uint64Value == other.d->value.uint64Value;
// FIXME: should not compare doubles for equality like this
return d->value.doubleValue == other.d->value.doubleValue;
return toString() == other.toString();
return toObjectPath() == other.toObjectPath();
return toUnixFd() == other.toUnixFd();
return toList() == other.toList();
return toStruct() == other.toStruct();
return toVariant() == other.toVariant();
if (d->keyType != other.d->keyType) return false;
switch (d->keyType)
{
return toByteKeyMap() == other.toByteKeyMap();
return toInt16KeyMap() == other.toInt16KeyMap();
return toUInt16KeyMap() == other.toUInt16KeyMap();
return toInt32KeyMap() == other.toInt32KeyMap();
return toUInt32KeyMap() == other.toUInt32KeyMap();
return toInt64KeyMap() == other.toInt64KeyMap();
return toUInt64KeyMap() == other.toUInt64KeyMap();
return toStringKeyMap() == other.toStringKeyMap();
return toUnixFdKeyMap() == other.toUnixFdKeyMap();
default:
tqFatal("TQT_DBusData operator== unhandled map key type %d(%s)",
break;
}
break;
}
}
return false;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool TQT_DBusData::toBool ( bool *  ok = 0) const

Tries to get the encapsulated boolean value.

If the data object is not of type Bool this will fail, i.e. the parameter ok will be set to false if present.

Parameters
okoptional pointer to a bool variable to store the success information in, i.e. will be set to true on success and to false if the conversion failed (not of type Bool)
Returns
the encapsulated boolean value or false if it fails
See Also
fromBool()

Definition at line 365 of file tqdbusdata.cpp.

References Bool, TQT_DBusData::Private::boolValue, d, TQT_DBusData::Private::type, and TQT_DBusData::Private::value.

{
{
if (ok != 0) *ok = false;
return false;
}
if (ok != 0) *ok = true;
return d->value.boolValue;
}

+ Here is the caller graph for this function:

TQ_UINT8 TQT_DBusData::toByte ( bool *  ok = 0) const

Tries to get the encapsulated byte (unsigned char) value.

If the data object is not of type Byte this will fail, i.e. the parameter ok will be set to false if present.

Parameters
okoptional pointer to a bool variable to store the success information in, i.e. will be set to true on success and to false if the conversion failed (not of type Byte)
Returns
the encapsulated byte (unsigned char) value or 0 if it fails
See Also
fromByte()

Definition at line 388 of file tqdbusdata.cpp.

References Byte, TQT_DBusData::Private::byteValue, d, TQT_DBusData::Private::type, and TQT_DBusData::Private::value.

{
{
if (ok != 0) *ok = false;
return 0;
}
if (ok != 0) *ok = true;
return d->value.byteValue;
}

+ Here is the caller graph for this function:

TQT_DBusDataMap< TQ_UINT8 > TQT_DBusData::toByteKeyMap ( bool *  ok = 0) const

Tries to get the encapsulated map.

If the data object is not of type Map or if its value type is not Byte this will fail, i.e. the parameter ok will be set to false if present.

Parameters
okoptional pointer to a bool variable to store the success information in, i.e. will be set to true on success and to false if the conversion failed (not of type Map or value type not Byte)
Returns
the encapsulated map or an empty and Invalid map if it fails
See Also
fromByteKeyMap()

Definition at line 753 of file tqdbusdata.cpp.

References d, TQT_DBusData::Private::keyType, Map, TQT_DBusData::Private::pointer, TQT_DBusData::Private::type, and TQT_DBusData::Private::value.

{
{
if (ok != 0) *ok = false;
}
if (ok != 0) *ok = true;
}

+ Here is the caller graph for this function:

double TQT_DBusData::toDouble ( bool *  ok = 0) const

Tries to get the encapsulated double value.

If the data object is not of type Double this will fail, i.e. the parameter ok will be set to false if present.

Parameters
okoptional pointer to a bool variable to store the success information in, i.e. will be set to true on success and to false if the conversion failed (not of type Double)
Returns
the encapsulated double value or 0.0 if it fails
See Also
fromDouble()

Definition at line 549 of file tqdbusdata.cpp.

References d, Double, TQT_DBusData::Private::doubleValue, TQT_DBusData::Private::type, and TQT_DBusData::Private::value.

{
{
if (ok != 0) *ok = false;
return 0.0;
}
if (ok != 0) *ok = true;
return d->value.doubleValue;
}

+ Here is the caller graph for this function:

TQ_INT16 TQT_DBusData::toInt16 ( bool *  ok = 0) const

Tries to get the encapsulated signed 16-bit integer value.

If the data object is not of type Int16 this will fail, i.e. the parameter ok will be set to false if present.

Parameters
okoptional pointer to a bool variable to store the success information in, i.e. will be set to true on success and to false if the conversion failed (not of type Int16)
Returns
the encapsulated signed 16-bit integer value or 0 if it fails
See Also
fromInt16()

Definition at line 411 of file tqdbusdata.cpp.

References d, Int16, TQT_DBusData::Private::int16Value, TQT_DBusData::Private::type, and TQT_DBusData::Private::value.

{
{
if (ok != 0) *ok = false;
return 0;
}
if (ok != 0) *ok = true;
return d->value.int16Value;
}

+ Here is the caller graph for this function:

TQT_DBusDataMap< TQ_INT16 > TQT_DBusData::toInt16KeyMap ( bool *  ok = 0) const

Tries to get the encapsulated map.

If the data object is not of type Map or if its value type is not Int16 this will fail, i.e. the parameter ok will be set to false if present.

Parameters
okoptional pointer to a bool variable to store the success information in, i.e. will be set to true on success and to false if the conversion failed (not of type Map or value type not Int16)
Returns
the encapsulated map or an empty and Invalid map if it fails
See Also
fromInt16KeyMap()

Definition at line 777 of file tqdbusdata.cpp.

References d, TQT_DBusData::Private::keyType, Map, TQT_DBusData::Private::pointer, TQT_DBusData::Private::type, and TQT_DBusData::Private::value.

{
{
if (ok != 0) *ok = false;
}
if (ok != 0) *ok = true;
}

+ Here is the caller graph for this function:

TQ_INT32 TQT_DBusData::toInt32 ( bool *  ok = 0) const

Tries to get the encapsulated signed 32-bit integer value.

If the data object is not of type Int32 this will fail, i.e. the parameter ok will be set to false if present.

Parameters
okoptional pointer to a bool variable to store the success information in, i.e. will be set to true on success and to false if the conversion failed (not of type Int32)
Returns
the encapsulated signed 32-bit integer value or 0 if it fails
See Also
fromInt32()

Definition at line 457 of file tqdbusdata.cpp.

References d, Int32, TQT_DBusData::Private::int32Value, TQT_DBusData::Private::type, and TQT_DBusData::Private::value.

{
{
if (ok != 0) *ok = false;
return 0;
}
if (ok != 0) *ok = true;
return d->value.int32Value;
}

+ Here is the caller graph for this function:

TQT_DBusDataMap< TQ_INT32 > TQT_DBusData::toInt32KeyMap ( bool *  ok = 0) const

Tries to get the encapsulated map.

If the data object is not of type Map or if its value type is not Int32 this will fail, i.e. the parameter ok will be set to false if present.

Parameters
okoptional pointer to a bool variable to store the success information in, i.e. will be set to true on success and to false if the conversion failed (not of type Map or value type not Int32)
Returns
the encapsulated map or an empty and Invalid map if it fails
See Also
fromInt32KeyMap()

Definition at line 826 of file tqdbusdata.cpp.

References d, TQT_DBusData::Private::keyType, Map, TQT_DBusData::Private::pointer, TQT_DBusData::Private::type, and TQT_DBusData::Private::value.

{
{
if (ok != 0) *ok = false;
}
if (ok != 0) *ok = true;
}

+ Here is the caller graph for this function:

TQ_INT64 TQT_DBusData::toInt64 ( bool *  ok = 0) const

Tries to get the encapsulated signed 64-bit integer value.

If the data object is not of type Int64 this will fail, i.e. the parameter ok will be set to false if present.

Parameters
okoptional pointer to a bool variable to store the success information in, i.e. will be set to true on success and to false if the conversion failed (not of type Int64)
Returns
the encapsulated signed 64-bit integer value or 0 if it fails
See Also
fromInt64()

Definition at line 503 of file tqdbusdata.cpp.

References d, Int64, TQT_DBusData::Private::int64Value, TQT_DBusData::Private::type, and TQT_DBusData::Private::value.

{
{
if (ok != 0) *ok = false;
return 0;
}
if (ok != 0) *ok = true;
return d->value.int64Value;
}

+ Here is the caller graph for this function:

TQT_DBusDataMap< TQ_INT64 > TQT_DBusData::toInt64KeyMap ( bool *  ok = 0) const

Tries to get the encapsulated map.

If the data object is not of type Map or if its value type is not Int64 this will fail, i.e. the parameter ok will be set to false if present.

Parameters
okoptional pointer to a bool variable to store the success information in, i.e. will be set to true on success and to false if the conversion failed (not of type Map or value type not Int64)
Returns
the encapsulated map or an empty and Invalid map if it fails
See Also
fromInt64KeyMap()

Definition at line 875 of file tqdbusdata.cpp.

References d, TQT_DBusData::Private::keyType, Map, TQT_DBusData::Private::pointer, TQT_DBusData::Private::type, and TQT_DBusData::Private::value.

{
{
if (ok != 0) *ok = false;
}
if (ok != 0) *ok = true;
}

+ Here is the caller graph for this function:

TQT_DBusDataList TQT_DBusData::toList ( bool *  ok = 0) const

Tries to get the encapsulated list.

If the data object is not of type List this will fail, i.e. the parameter ok will be set to false if present.

Parameters
okoptional pointer to a bool variable to store the success information in, i.e. will be set to true on success and to false if the conversion failed (not of type List)
Returns
the encapsulated list or an empty and Invalid list if it fails
See Also
fromList()

Definition at line 649 of file tqdbusdata.cpp.

References d, List, TQT_DBusData::Private::pointer, TQT_DBusData::Private::type, and TQT_DBusData::Private::value.

{
{
if (ok != 0) *ok = false;
return TQT_DBusDataList();
}
if (ok != 0) *ok = true;
}

+ Here is the caller graph for this function:

TQT_DBusObjectPath TQT_DBusData::toObjectPath ( bool *  ok = 0) const

Tries to get the encapsulated object path value.

If the data object is not of type ObjectPath this will fail, i.e. the parameter ok will be set to false if present.

Parameters
okoptional pointer to a bool variable to store the success information in, i.e. will be set to true on success and to false if the conversion failed (not of type ObjectPath)
Returns
the encapsulated object path value or an empty and invalid object if it fails
See Also
fromObjectPath()

Definition at line 598 of file tqdbusdata.cpp.

References d, ObjectPath, TQT_DBusData::Private::pointer, TQT_DBusData::Private::type, and TQT_DBusData::Private::value.

{
{
if (ok != 0) *ok = false;
}
if (ok != 0) *ok = true;
}

+ Here is the caller graph for this function:

TQT_DBusDataMap< TQT_DBusObjectPath > TQT_DBusData::toObjectPathKeyMap ( bool *  ok = 0) const

Tries to get the encapsulated map.

If the data object is not of type Map or if its value type is not ObjectPath this will fail, i.e. the parameter ok will be set to false if present.

Parameters
okoptional pointer to a bool variable to store the success information in, i.e. will be set to true on success and to false if the conversion failed (not of type Map or value type not ObjectPath)
Returns
the encapsulated map or an empty and Invalid map if it fails
See Also
fromObjectPathKeyMap()

Definition at line 948 of file tqdbusdata.cpp.

References d, TQT_DBusData::Private::keyType, Map, TQT_DBusData::Private::pointer, TQT_DBusData::Private::type, and TQT_DBusData::Private::value.

{
{
if (ok != 0) *ok = false;
}
if (ok != 0) *ok = true;
}

+ Here is the caller graph for this function:

TQString TQT_DBusData::toString ( bool *  ok = 0) const

Tries to get the encapsulated string value.

If the data object is not of type String this will fail, i.e. the parameter ok will be set to false if present.

Parameters
okoptional pointer to a bool variable to store the success information in, i.e. will be set to true on success and to false if the conversion failed (not of type String)
Returns
the encapsulated string value or TQString() if it fails
See Also
fromString()

Definition at line 572 of file tqdbusdata.cpp.

References d, TQT_DBusData::Private::pointer, String, TQT_DBusData::Private::type, and TQT_DBusData::Private::value.

{
{
if (ok != 0) *ok = false;
return TQString();
}
if (ok != 0) *ok = true;
return *((TQString*)d->value.pointer);
}

+ Here is the caller graph for this function:

TQT_DBusDataMap< TQString > TQT_DBusData::toStringKeyMap ( bool *  ok = 0) const

Tries to get the encapsulated map.

If the data object is not of type Map or if its value type is not String this will fail, i.e. the parameter ok will be set to false if present.

Parameters
okoptional pointer to a bool variable to store the success information in, i.e. will be set to true on success and to false if the conversion failed (not of type Map or value type not String)
Returns
the encapsulated map or an empty and Invalid map if it fails
See Also
fromStringKeyMap()

Definition at line 924 of file tqdbusdata.cpp.

References d, TQT_DBusData::Private::keyType, Map, TQT_DBusData::Private::pointer, TQT_DBusData::Private::type, and TQT_DBusData::Private::value.

{
{
if (ok != 0) *ok = false;
}
if (ok != 0) *ok = true;
}

+ Here is the caller graph for this function:

TQValueList< TQT_DBusData > TQT_DBusData::toStruct ( bool *  ok = 0) const

Tries to get the encapsulated struct memberList.

If the data object is not of type Struct this will fail, i.e. the parameter ok will be set to false if present.

See the documentation of Struct for an example.

Parameters
okoptional pointer to a bool variable to store the success information in, i.e. will be set to true on success and to false if the conversion failed (not of type Struct)
Returns
the encapsulated memberList or an empty list if it fails
See Also
fromStruct()

Definition at line 698 of file tqdbusdata.cpp.

References d, TQT_DBusData::Private::pointer, Struct, TQT_DBusData::Private::type, and TQT_DBusData::Private::value.

{
{
if (ok != 0) *ok = false;
return TQValueList<TQT_DBusData>();
}
if (ok != 0) *ok = true;
return *((TQValueList<TQT_DBusData>*)d->value.pointer);
}

+ Here is the caller graph for this function:

TQValueList< TQT_DBusData > TQT_DBusData::toTQValueList ( bool *  ok = 0) const

Tries to get the encapsulated list.

Convenience overload for toList().

Parameters
okoptional pointer to a bool variable to store the success information in, i.e. will be set to true on success and to false if the conversion failed (not of type List)
Returns
the encapsulated list or an empty and Invalid list if it fails
See Also
fromTQValueList()

Definition at line 667 of file tqdbusdata.cpp.

References toList(), and TQT_DBusDataList::toTQValueList().

{
bool internalOk = false;
TQT_DBusDataList list = toList(&internalOk);
if (!internalOk)
{
if (ok != 0) *ok = false;
return TQValueList<TQT_DBusData>();
}
return list.toTQValueList();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

TQ_UINT16 TQT_DBusData::toUInt16 ( bool *  ok = 0) const

Tries to get the encapsulated unsigned 16-bit integer value.

If the data object is not of type UInt16 this will fail, i.e. the parameter ok will be set to false if present.

Parameters
okoptional pointer to a bool variable to store the success information in, i.e. will be set to true on success and to false if the conversion failed (not of type UInt16)
Returns
the encapsulated unsigned 16-bit integer value or 0 if it fails
See Also
fromUInt16()

Definition at line 434 of file tqdbusdata.cpp.

References d, TQT_DBusData::Private::type, UInt16, TQT_DBusData::Private::uint16Value, and TQT_DBusData::Private::value.

{
{
if (ok != 0) *ok = false;
return 0;
}
if (ok != 0) *ok = true;
return d->value.uint16Value;
}

+ Here is the caller graph for this function:

TQT_DBusDataMap< TQ_UINT16 > TQT_DBusData::toUInt16KeyMap ( bool *  ok = 0) const

Tries to get the encapsulated map.

If the data object is not of type Map or if its value type is not UInt16 this will fail, i.e. the parameter ok will be set to false if present.

Parameters
okoptional pointer to a bool variable to store the success information in, i.e. will be set to true on success and to false if the conversion failed (not of type Map or value type not UInt16)
Returns
the encapsulated map or an empty and Invalid map if it fails
See Also
fromUInt16KeyMap()

Definition at line 801 of file tqdbusdata.cpp.

References d, TQT_DBusData::Private::keyType, Map, TQT_DBusData::Private::pointer, TQT_DBusData::Private::type, and TQT_DBusData::Private::value.

{
{
if (ok != 0) *ok = false;
}
if (ok != 0) *ok = true;
}

+ Here is the caller graph for this function:

TQ_UINT32 TQT_DBusData::toUInt32 ( bool *  ok = 0) const

Tries to get the encapsulated unsigned 32-bit integer value.

If the data object is not of type UInt32 this will fail, i.e. the parameter ok will be set to false if present.

Parameters
okoptional pointer to a bool variable to store the success information in, i.e. will be set to true on success and to false if the conversion failed (not of type UInt32)
Returns
the encapsulated unsigned 32-bit integer value or 0 if it fails
See Also
fromUInt32()

Definition at line 480 of file tqdbusdata.cpp.

References d, TQT_DBusData::Private::type, UInt32, TQT_DBusData::Private::uint32Value, and TQT_DBusData::Private::value.

{
{
if (ok != 0) *ok = false;
return 0;
}
if (ok != 0) *ok = true;
return d->value.uint32Value;
}

+ Here is the caller graph for this function:

TQT_DBusDataMap< TQ_UINT32 > TQT_DBusData::toUInt32KeyMap ( bool *  ok = 0) const

Tries to get the encapsulated map.

If the data object is not of type Map or if its value type is not UInt32 this will fail, i.e. the parameter ok will be set to false if present.

Parameters
okoptional pointer to a bool variable to store the success information in, i.e. will be set to true on success and to false if the conversion failed (not of type Map or value type not UInt32)
Returns
the encapsulated map or an empty and Invalid map if it fails
See Also
fromUInt32KeyMap()

Definition at line 850 of file tqdbusdata.cpp.

References d, TQT_DBusData::Private::keyType, Map, TQT_DBusData::Private::pointer, TQT_DBusData::Private::type, and TQT_DBusData::Private::value.

{
{
if (ok != 0) *ok = false;
}
if (ok != 0) *ok = true;
}

+ Here is the caller graph for this function:

TQ_UINT64 TQT_DBusData::toUInt64 ( bool *  ok = 0) const

Tries to get the encapsulated unsigned 64-bit integer value.

If the data object is not of type UInt64 this will fail, i.e. the parameter ok will be set to false if present.

Parameters
okoptional pointer to a bool variable to store the success information in, i.e. will be set to true on success and to false if the conversion failed (not of type UInt64)
Returns
the encapsulated unsigned 64-bit integer value or 0 if it fails
See Also
fromUInt64()

Definition at line 526 of file tqdbusdata.cpp.

References d, TQT_DBusData::Private::type, UInt64, TQT_DBusData::Private::uint64Value, and TQT_DBusData::Private::value.

{
{
if (ok != 0) *ok = false;
return 0;
}
if (ok != 0) *ok = true;
return d->value.uint64Value;
}

+ Here is the caller graph for this function:

TQT_DBusDataMap< TQ_UINT64 > TQT_DBusData::toUInt64KeyMap ( bool *  ok = 0) const

Tries to get the encapsulated map.

If the data object is not of type Map or if its value type is not UInt64 this will fail, i.e. the parameter ok will be set to false if present.

Parameters
okoptional pointer to a bool variable to store the success information in, i.e. will be set to true on success and to false if the conversion failed (not of type Map or value type not UInt64)
Returns
the encapsulated map or an empty and Invalid map if it fails
See Also
fromUInt64KeyMap()

Definition at line 899 of file tqdbusdata.cpp.

References d, TQT_DBusData::Private::keyType, Map, TQT_DBusData::Private::pointer, TQT_DBusData::Private::type, and TQT_DBusData::Private::value.

{
{
if (ok != 0) *ok = false;
}
if (ok != 0) *ok = true;
}

+ Here is the caller graph for this function:

TQT_DBusUnixFd TQT_DBusData::toUnixFd ( bool *  ok = 0) const

Tries to get the encapsulated unix file handle value.

If the data object is not of type UnixFd this will fail, i.e. the parameter ok will be set to false if present.

Parameters
okoptional pointer to a bool variable to store the success information in, i.e. will be set to true on success and to false if the conversion failed (not of type UnixFd)
Returns
the encapsulated object path value or an empty and invalid object if it fails
See Also
fromUnixFd()

Definition at line 624 of file tqdbusdata.cpp.

References d, TQT_DBusData::Private::pointer, TQT_DBusData::Private::type, UnixFd, and TQT_DBusData::Private::value.

{
{
if (ok != 0) *ok = false;
return TQT_DBusUnixFd();
}
if (ok != 0) *ok = true;
return *((TQT_DBusUnixFd*)d->value.pointer);
}

+ Here is the caller graph for this function:

TQT_DBusDataMap< TQT_DBusUnixFd > TQT_DBusData::toUnixFdKeyMap ( bool *  ok = 0) const

Tries to get the encapsulated map.

If the data object is not of type Map or if its value type is not UnixFd this will fail, i.e. the parameter ok will be set to false if present.

Parameters
okoptional pointer to a bool variable to store the success information in, i.e. will be set to true on success and to false if the conversion failed (not of type Map or value type not UnixFd)
Returns
the encapsulated map or an empty and Invalid map if it fails
See Also
fromUnixFdKeyMap()

Definition at line 973 of file tqdbusdata.cpp.

References d, TQT_DBusData::Private::keyType, Map, TQT_DBusData::Private::pointer, TQT_DBusData::Private::type, and TQT_DBusData::Private::value.

{
{
if (ok != 0) *ok = false;
}
if (ok != 0) *ok = true;
}

+ Here is the caller graph for this function:

TQT_DBusVariant TQT_DBusData::toVariant ( bool *  ok = 0) const

Tries to get the encapsulated variant value.

If the data object is not of type Variant this will fail, i.e. the parameter ok will be set to false if present.

Parameters
okoptional pointer to a bool variable to store the success information in, i.e. will be set to true on success and to false if the conversion failed (not of type Variant)
Returns
the encapsulated variant value or an empty variant if it fails
See Also
fromVariant()

Definition at line 721 of file tqdbusdata.cpp.

References d, TQT_DBusData::Private::pointer, TQT_DBusData::Private::type, TQT_DBusData::Private::value, and Variant.

{
{
if (ok != 0) *ok = false;
return TQT_DBusVariant();
}
if (ok != 0) *ok = true;
}

+ Here is the caller graph for this function:

TQT_DBusData::Type TQT_DBusData::type ( ) const

Returns the Type of the data object.

Returns
one of the values of the Type enum
See Also
keyType()
typeName()

Definition at line 317 of file tqdbusdata.cpp.

References d, and TQT_DBusData::Private::type.

{
return d->type;
}

+ Here is the caller graph for this function:

const char* TQT_DBusData::typeName ( ) const
inline

Returns the string representation of the object's Type.

Returns
an ASCII C-string for the object's type
See Also
type()
typeName(Type)

Definition at line 385 of file tqdbusdata.h.

References typeName().

{ return typeName(type()); }

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

const char * TQT_DBusData::typeName ( Type  type)
static

Returns the string representation for the given type.

Parameters
typethe Type to get the string representation for
Returns
an ASCII C-string for the given type
See Also
type()
typeName()

Definition at line 329 of file tqdbusdata.cpp.

References Bool, Byte, Double, Int16, Int32, Int64, Invalid, List, Map, ObjectPath, String, Struct, UInt16, UInt32, UInt64, UnixFd, and Variant.

{
switch (type)
{
case TQT_DBusData::Invalid: return "Invalid";
case TQT_DBusData::Bool: return "Bool";
case TQT_DBusData::Byte: return "Byte";
case TQT_DBusData::Int16: return "Int16";
case TQT_DBusData::UInt16: return "UInt16";
case TQT_DBusData::Int32: return "Int32";
case TQT_DBusData::UInt32: return "UInt32";
case TQT_DBusData::Int64: return "Int64";
case TQT_DBusData::UInt64: return "UInt64";
case TQT_DBusData::Double: return "Double";
case TQT_DBusData::String: return "String";
case TQT_DBusData::ObjectPath: return "ObjectPath";
case TQT_DBusData::UnixFd: return "UnixFd";
case TQT_DBusData::List: return "List";
case TQT_DBusData::Struct: return "Struct";
case TQT_DBusData::Variant: return "Variant";
case TQT_DBusData::Map: return "Map";
}
return 0;
}

Member Data Documentation

Private* TQT_DBusData::d
private

Definition at line 1226 of file tqdbusdata.h.


The documentation for this class was generated from the following files: