Class to transport maps of D-Bus data types. More...
#include <tqdbusdatamap.h>
Public Types | |
| typedef TQMapConstIterator< T, TQT_DBusData > | const_iterator |
Public Member Functions | |
| TQT_DBusDataMap () | |
| TQT_DBusDataMap (TQT_DBusData::Type simpleValueType) | |
| TQT_DBusDataMap (const TQT_DBusData &containerValueType) | |
| TQT_DBusDataMap (const TQT_DBusDataMap< T > &other) | |
| TQT_DBusDataMap (const TQMap< T, TQT_DBusData > &other) | |
| TQT_DBusDataMap (const TQMap< T, bool > &other) | |
| TQT_DBusDataMap (const TQMap< T, TQ_UINT8 > &other) | |
| TQT_DBusDataMap (const TQMap< T, TQ_INT16 > &other) | |
| TQT_DBusDataMap (const TQMap< T, TQ_UINT16 > &other) | |
| TQT_DBusDataMap (const TQMap< T, TQ_INT32 > &other) | |
| TQT_DBusDataMap (const TQMap< T, TQ_UINT32 > &other) | |
| TQT_DBusDataMap (const TQMap< T, TQ_INT64 > &other) | |
| TQT_DBusDataMap (const TQMap< T, TQ_UINT64 > &other) | |
| TQT_DBusDataMap (const TQMap< T, double > &other) | |
| TQT_DBusDataMap (const TQMap< T, TQString > &other) | |
| TQT_DBusDataMap (const TQMap< T, TQT_DBusObjectPath > &other) | |
| TQT_DBusDataMap (const TQMap< T, TQT_DBusUnixFd > &other) | |
| TQT_DBusDataMap (const TQMap< T, TQT_DBusVariant > &other) | |
| TQT_DBusDataMap< T > & | operator= (const TQT_DBusDataMap< T > &other) |
| TQT_DBusDataMap< T > & | operator= (const TQMap< T, TQT_DBusData > &other) |
| TQT_DBusData::Type | keyType () const |
| TQT_DBusData::Type | valueType () const |
| bool | hasContainerValueType () const |
| TQT_DBusData | containerValueType () const |
| bool | isValid () const |
| bool | isEmpty () const |
| uint | count () const |
| bool | operator== (const TQT_DBusDataMap< T > &other) const |
| void | clear () |
| const_iterator | begin () const |
| const_iterator | end () const |
| bool | insert (const T &key, const TQT_DBusData &data) |
| TQMap< T, TQT_DBusData > | toTQMap () const |
| TQMap< T, bool > | toBoolMap (bool *ok=0) const |
| TQMap< T, TQ_UINT8 > | toByteMap (bool *ok=0) const |
| TQMap< T, TQ_INT16 > | toInt16Map (bool *ok=0) const |
| TQMap< T, TQ_UINT16 > | toUInt16Map (bool *ok=0) const |
| TQMap< T, TQ_INT32 > | toInt32Map (bool *ok=0) const |
| TQMap< T, TQ_UINT32 > | toUInt32Map (bool *ok=0) const |
| TQMap< T, TQ_INT64 > | toInt64Map (bool *ok=0) const |
| TQMap< T, TQ_UINT64 > | toUInt64Map (bool *ok=0) const |
| TQMap< T, double > | toDoubleMap (bool *ok=0) const |
| TQMap< T, TQString > | toStringMap (bool *ok=0) const |
| TQMap< T, TQT_DBusObjectPath > | toObjectPathMap (bool *ok=0) const |
| TQMap< T, TQT_DBusObjectPath > | toUnixFdMap (bool *ok=0) const |
| TQMap< T, TQT_DBusVariant > | toVariantMap (bool *ok=0) const |
| template<> | |
| const TQT_DBusData::Type | m_keyType |
| template<> | |
| const TQT_DBusData::Type | m_keyType |
| template<> | |
| const TQT_DBusData::Type | m_keyType |
| template<> | |
| const TQT_DBusData::Type | m_keyType |
| template<> | |
| const TQT_DBusData::Type | m_keyType |
| template<> | |
| const TQT_DBusData::Type | m_keyType |
| template<> | |
| const TQT_DBusData::Type | m_keyType |
| template<> | |
| const TQT_DBusData::Type | m_keyType |
| template<> | |
| const TQT_DBusData::Type | m_keyType |
| template<> | |
| const TQT_DBusData::Type | m_keyType |
Private Attributes | |
| TQT_DBusData::Type | m_valueType |
| TQT_DBusData | m_containerValueType |
Static Private Attributes | |
| static const TQT_DBusData::Type | m_keyType |
Friends | |
| class | TQT_DBusData |
Class to transport maps of D-Bus data types.
dict this bindings use the term map since TQT_DBusDataMap is essentially a TQMapThere are basically two ways to create TQT_DBusDataMap objects:
Example for creating a filled map from content
TQMap<TQ_INT16, TQString> intToStringMap; map.insert(2, "two"); map.insert(3, "three"); map.insert(5, "five"); map.insert(7, "seven"); TQT_DBusDataMap<TQ_INT16> dbusMap(intToStringMap); TQT_DBusData data = TQT_DBusData::fromInt16KeyMap(dbusMap); // or even shorter, using implicit conversion TQT_DBusData other = TQT_DBusData::fromInt16KeyMap(intList);
Example for creating an empty map
// empty map for a simple type, mapping from TQString to double TQT_DBusDataMap<TQString> list(TQT_DBusData::Double); // empty map for value type string lists TQT_DBusData valueType = TQT_DBusData::fromList(TQT_DBusDataList(TQT_DBusData::String)); TQT_DBusDataMap<TQString> map(valueType);
Definition at line 73 of file tqdbusdatamap.h.
| typedef TQMapConstIterator<T, TQT_DBusData> TQT_DBusDataMap< T >::const_iterator |
Constant iterator. A TQMapConstIterator with value type specified as TQT_DBusData
Definition at line 82 of file tqdbusdatamap.h.
| TQT_DBusDataMap< T >::TQT_DBusDataMap | ( | ) | [inline] |
Creates an empty and invalid map.
| TQT_DBusDataMap< T >::TQT_DBusDataMap | ( | TQT_DBusData::Type | simpleValueType | ) | [inline, explicit] |
Creates an empty map with the given simple type for values.
The given type has be one of the non-container types, i.e. any other than TQT_DBusData::Map, TQT_DBusData::List or TQT_DBusData::Struct
For creating a map with elements which are containers themselves, use TQT_DBusDataMap<T>(const TQT_DBusData&);
| simpleValueType | the type of the values in the new map |
| TQT_DBusDataMap< T >::TQT_DBusDataMap | ( | const TQT_DBusData & | containerValueType | ) | [inline, explicit] |
Creates an empty map with the given container type for values.
For creating a map with simple values you can also use TQT_DBusDataMap<T>(TQT_DBusData::Type);
| containerValueType | the type of the values in the new map |
| TQT_DBusDataMap< T >::TQT_DBusDataMap | ( | const TQT_DBusDataMap< T > & | other | ) | [inline] |
Creates a map from the given other map.
This behaves basically like copying a TQMap through its copy constructor, i.e. no value are actually copied at this time.
| other | the other map object to copy from |
| TQT_DBusDataMap< T >::TQT_DBusDataMap | ( | const TQMap< T, TQT_DBusData > & | other | ) | [inline] |
Creates a map from the given TQMap of TQT_DBusData objects.
If the other map is empty, this will behave like TQT_DBusDataMap<T>(), i.e. create an empty and invalid map object.
Type information for the map object, i.e. value type and, if applicable, container value type, will be derived from the other map's elements.
other map do not all have the same type, the map object will also be empty and invalid| other | the TQMap of TQT_DBusData objects to copy from |
| TQT_DBusDataMap< T >::TQT_DBusDataMap | ( | const TQMap< T, bool > & | other | ) | [inline] |
Creates a list from the given TQMap of boolean values.
Type information for the map object will be set to TQT_DBusData::Bool also when the other map is empty, i.e. this allows to create an empty but valid map object, comparable to using TQT_DBusDataMap<T>(TQT_DBusData::Type) with TQT_DBusData::Bool
| other | the TQMap of boolean values to copy from |
| TQT_DBusDataMap< T >::TQT_DBusDataMap | ( | const TQMap< T, TQ_UINT8 > & | other | ) | [inline] |
Creates a map from the given TQMap of byte (unsigned char) values.
Type information for the map object will be set to TQT_DBusData::Byte also when the other map is empty, i.e. this allows to create an empty but valid map object, comparable to using TQT_DBusDataMap<T>(TQT_DBusData::Type) with TQT_DBusData::Byte
| other | the TQMap of byte (unsigned char) values to copy from |
| TQT_DBusDataMap< T >::TQT_DBusDataMap | ( | const TQMap< T, TQ_INT16 > & | other | ) | [inline] |
Creates a map from the given TQMap of signed 16-bit integer values.
Type information for the map object will be set to TQT_DBusData::Int16 also when the other map is empty, i.e. this allows to create an empty but valid map object, comparable to using TQT_DBusDataMap<T>(TQT_DBusData::Type) with TQT_DBusData::Int16
| other | the TQMap of signed 16-bit integer values to copy from |
| TQT_DBusDataMap< T >::TQT_DBusDataMap | ( | const TQMap< T, TQ_UINT16 > & | other | ) | [inline] |
Creates a map from the given TQMap of unsigned 16-bit integer values.
Type information for the map object will be set to TQT_DBusData::UInt16 also when the other map is empty, i.e. this allows to create an empty but valid map object, comparable to using TQT_DBusDataMap<T>(TQT_DBusData::Type) with TQT_DBusData::UInt16
| other | the TQMap of unsigned 16-bit integer values to copy from |
| TQT_DBusDataMap< T >::TQT_DBusDataMap | ( | const TQMap< T, TQ_INT32 > & | other | ) | [inline] |
Creates a map from the given TQMap of signed 32-bit integer values.
Type information for the map object will be set to TQT_DBusData::Int32 also when the other map is empty, i.e. this allows to create an empty but valid map object, comparable to using TQT_DBusDataMap<T>(TQT_DBusData::Type) with TQT_DBusData::Int32
| other | the TQMap of signed 32-bit integer values to copy from |
| TQT_DBusDataMap< T >::TQT_DBusDataMap | ( | const TQMap< T, TQ_UINT32 > & | other | ) | [inline] |
Creates a map from the given TQMap of unsigned 32-bit integer values.
Type information for the map object will be set to TQT_DBusData::UInt16 also when the other map is empty, i.e. this allows to create an empty but valid map object, comparable to using TQT_DBusDataMap<T>(TQT_DBusData::Type) with TQT_DBusData::UInt32
| other | the TQMap of unsigned 32-bit integer values to copy from |
| TQT_DBusDataMap< T >::TQT_DBusDataMap | ( | const TQMap< T, TQ_INT64 > & | other | ) | [inline] |
Creates a map from the given TQMap of signed 64-bit integer values.
Type information for the map object will be set to TQT_DBusData::Int64 also when the other map is empty, i.e. this allows to create an empty but valid map object, comparable to using TQT_DBusDataMap<T>(TQT_DBusData::Type) with TQT_DBusData::Int64
| other | the TQMap of signed 64-bit integer values to copy from |
| TQT_DBusDataMap< T >::TQT_DBusDataMap | ( | const TQMap< T, TQ_UINT64 > & | other | ) | [inline] |
Creates a map from the given TQMap of unsigned 64-bit integer values.
Type information for the map object will be set to TQT_DBusData::UInt64 also when the other map is empty, i.e. this allows to create an empty but valid map object, comparable to using TQT_DBusDataMap<T>(TQT_DBusData::Type) with TQT_DBusData::UInt64
| other | the TQMap of unsigned 64-bit integer values to copy from |
| TQT_DBusDataMap< T >::TQT_DBusDataMap | ( | const TQMap< T, double > & | other | ) | [inline] |
Creates a map from the given TQMap of double values.
Type information for the map object will be set to TQT_DBusData::Double also when the other map is empty, i.e. this allows to create an empty but valid map object, comparable to using TQT_DBusDataMap<T>(TQT_DBusData::Type) with TQT_DBusData::Double
| other | the TQMap of double values to copy from |
| TQT_DBusDataMap< T >::TQT_DBusDataMap | ( | const TQMap< T, TQString > & | other | ) | [inline] |
Creates a map from the given TQMap of TQString values.
Type information for the map object will be set to TQT_DBusData::String also when the other map is empty, i.e. this allows to create an empty but valid map object, comparable to using TQT_DBusDataMap<T>(TQT_DBusData::Type) with TQT_DBusData::String
| other | the TQMap of TQString values to copy from |
| TQT_DBusDataMap< T >::TQT_DBusDataMap | ( | const TQMap< T, TQT_DBusObjectPath > & | other | ) | [inline] |
Creates a map from the given TQMap of object path values.
Type information for the map object will be set to TQT_DBusData::ObjectPath also when the other map is empty, i.e. this allows to create an empty but valid map object, comparable to using TQT_DBusDataMap<T>(TQT_DBusData::Type) with TQT_DBusData::ObjectPath
| other | the TQMap of object path values to copy from |
| TQT_DBusDataMap< T >::TQT_DBusDataMap | ( | const TQMap< T, TQT_DBusUnixFd > & | other | ) | [inline] |
Creates a map from the given TQMap of TQT_DBusUnixFd values.
Type information for the map object will be set to TQT_DBusData::UnixFd also when the other map is empty, i.e. this allows to create an empty but valid map object, comparable to using TQT_DBusDataMap<T>(TQT_DBusData::Type) with TQT_DBusData::UnixFd
| other | the TQMap of TQT_DBusUnixFd values to copy from |
| TQT_DBusDataMap< T >::TQT_DBusDataMap | ( | const TQMap< T, TQT_DBusVariant > & | other | ) | [inline] |
Creates a map from the given TQMap of TQT_DBusVariant values.
Type information for the map object will be set to TQT_DBusData::Variant also when the other map is empty, i.e. this allows to create an empty but valid map object, comparable to using TQT_DBusDataMap<T>(TQT_DBusData::Type) with TQT_DBusData::Variant
| other | the TQMap of variant values to copy from |
| const_iterator TQT_DBusDataMap< T >::begin | ( | ) | const [inline] |
Returns an iterator to the first item according to the key sort order.
Definition at line 702 of file tqdbusdatamap.h.
00703 { 00704 return TQMap<T, TQT_DBusData>::begin(); 00705 }
| void TQT_DBusDataMap< T >::clear | ( | ) | [inline] |
Clears the map.
Value type and, if applicable, container value type will stay untouched.
Definition at line 695 of file tqdbusdatamap.h.
00695 { TQMap<T, TQT_DBusData>::clear(); }
| TQT_DBusData TQT_DBusDataMap< T >::containerValueType | ( | ) | const [inline] |
Returns a container prototype for the map's value type.
Lists which have containers as their elements, i.e. hasContainerValueType() returns true this will actually specify the details for the use container, i.e. the returned data object can be queried for type and possible further subtypes.
Definition at line 622 of file tqdbusdatamap.h.
00622 { return m_containerValueType; }
| uint TQT_DBusDataMap< T >::count | ( | ) | const [inline] |
Returns the number of key/value pairs of this map object.
Definition at line 649 of file tqdbusdatamap.h.
00649 { return TQMap<T, TQT_DBusData>::count(); }
| const_iterator TQT_DBusDataMap< T >::end | ( | ) | const [inline] |
Returns an iterator to an invalid position.
Definition at line 712 of file tqdbusdatamap.h.
00713 { 00714 return TQMap<T, TQT_DBusData>::end(); 00715 }
| bool TQT_DBusDataMap< T >::hasContainerValueType | ( | ) | const [inline] |
Checks whether the value type is a data container itself.
If the value of the map are containers as well, this will return true In this case containerValueType() will return a prototype for such a container.
true if the value type is either TQT_DBusData::Map, TQT_DBusData::List or TQT_DBusData::Struct, otherwise false Definition at line 601 of file tqdbusdatamap.h.
References TQT_DBusData::List, TQT_DBusData::Map, and TQT_DBusData::Struct.
00602 { 00603 return m_valueType == TQT_DBusData::List || m_valueType == TQT_DBusData::Struct 00604 || m_valueType == TQT_DBusData::Map; 00605 }
| bool TQT_DBusDataMap< T >::insert | ( | const T & | key, | |
| const TQT_DBusData & | data | |||
| ) | [inline] |
Inserts a given value for a given key.
Basically works like the respective TQMap method, but checks if type of the new value matches the value type of the list. Maps that are invalid will accept any new type and will then be typed accordingly.
If data is invalid itself, it will not be inserted at any time.
| key | the key were to insert into the map | |
| data | the data item to insert into the map |
true on successfull insert, otherwise false Definition at line 735 of file tqdbusdatamap.h.
References TQT_DBusData::buildDBusSignature(), TQT_DBusData::Invalid, TQT_DBusData::type(), and TQT_DBusData::typeName().
00736 { 00737 if (data.type() == TQT_DBusData::Invalid) return false; 00738 00739 if (m_valueType == TQT_DBusData::Invalid) 00740 { 00741 m_valueType = data.type(); 00742 00743 // TODO: create empty copy of container 00744 if (hasContainerValueType()) m_containerValueType = data; 00745 00746 TQMap<T, TQT_DBusData>::insert(key, data); 00747 } 00748 else if (data.type() != m_valueType) 00749 { 00750 tqWarning("TQT_DBusDataMap: trying to add data of type %s to map of type %s", 00751 data.typeName(), TQT_DBusData::typeName(m_valueType)); 00752 } 00753 else if (hasContainerValueType()) 00754 { 00755 TQCString ourSignature = m_containerValueType.buildDBusSignature(); 00756 TQCString dataSignature = data.buildDBusSignature(); 00757 00758 if (ourSignature != dataSignature) 00759 { 00760 tqWarning("TQT_DBusDataMap: trying to add data with signature %s " 00761 "to map with value signature %s", 00762 dataSignature.data(), ourSignature.data()); 00763 } 00764 else 00765 TQMap<T, TQT_DBusData>::insert(key, data); 00766 } 00767 else 00768 TQMap<T, TQT_DBusData>::insert(key, data); 00769 00770 return true; 00771 }
| bool TQT_DBusDataMap< T >::isEmpty | ( | ) | const [inline] |
Checks whether this map object has any key/value pairs.
true if there are no key/values in this map, otherwise false Definition at line 640 of file tqdbusdatamap.h.
| bool TQT_DBusDataMap< T >::isValid | ( | ) | const [inline] |
Checks whether this map object has a valid value type.
This is equal to checking valueType() for not being TQT_DBusData::Invalid
true if the map object is valid, otherwise false Definition at line 631 of file tqdbusdatamap.h.
References TQT_DBusData::Invalid.
00631 { return valueType() != TQT_DBusData::Invalid; }
| TQT_DBusData::Type TQT_DBusDataMap< T >::keyType | ( | ) | const [inline] |
Returns the key type of the map object.
Definition at line 575 of file tqdbusdatamap.h.
00575 { return m_keyType; }
| const TQT_DBusData::Type TQT_DBusDataMap< TQT_DBusUnixFd >::m_keyType | ( | ) | [inline] |
Definition at line 173 of file tqdbusdata.cpp.
| const TQT_DBusData::Type TQT_DBusDataMap< TQT_DBusObjectPath >::m_keyType | ( | ) | [inline] |
Definition at line 170 of file tqdbusdata.cpp.
| const TQT_DBusData::Type TQT_DBusDataMap< TQString >::m_keyType | ( | ) | [inline] |
Definition at line 167 of file tqdbusdata.cpp.
| const TQT_DBusData::Type TQT_DBusDataMap< TQ_UINT64 >::m_keyType | ( | ) | [inline] |
Definition at line 164 of file tqdbusdata.cpp.
| const TQT_DBusData::Type TQT_DBusDataMap< TQ_INT64 >::m_keyType | ( | ) | [inline] |
Definition at line 161 of file tqdbusdata.cpp.
| const TQT_DBusData::Type TQT_DBusDataMap< TQ_UINT32 >::m_keyType | ( | ) | [inline] |
Definition at line 158 of file tqdbusdata.cpp.
| const TQT_DBusData::Type TQT_DBusDataMap< TQ_INT32 >::m_keyType | ( | ) | [inline] |
Definition at line 155 of file tqdbusdata.cpp.
| const TQT_DBusData::Type TQT_DBusDataMap< TQ_UINT16 >::m_keyType | ( | ) | [inline] |
Definition at line 152 of file tqdbusdata.cpp.
| const TQT_DBusData::Type TQT_DBusDataMap< TQ_INT16 >::m_keyType | ( | ) | [inline] |
Definition at line 149 of file tqdbusdata.cpp.
| const TQT_DBusData::Type TQT_DBusDataMap< TQ_UINT8 >::m_keyType | ( | ) | [inline] |
Definition at line 146 of file tqdbusdata.cpp.
| TQT_DBusDataMap<T>& TQT_DBusDataMap< T >::operator= | ( | const TQMap< T, TQT_DBusData > & | other | ) | [inline] |
Copies from the given other map.
This behaves basically like copying a TQMap through its assignment operator, i.e. no value are actually copied at this time.
other map have to be of the same type. If they aren't this maps's content will cleared and the value type will be set to TQT_DBusData::Invalid| other | the other map object to copy from |
Definition at line 522 of file tqdbusdatamap.h.
References TQT_DBusData::Invalid, TQT_DBusData::operator=(), and TQT_DBusData::TQT_DBusData().
00523 { 00524 TQMap<T, TQT_DBusData>::operator=(other); 00525 00526 m_valueType = TQT_DBusData::Invalid; 00527 m_containerValueType = TQT_DBusData(); 00528 00529 const_iterator it = begin(); 00530 if (it == end()) return *this; 00531 00532 m_valueType = (*it).type(); 00533 00534 TQCString containerSignature; 00535 if (hasContainerValueType()) 00536 { 00537 m_containerValueType = it.data(); 00538 containerSignature = m_containerValueType.buildDBusSignature(); 00539 } 00540 00541 for (++it; it != end(); ++it) 00542 { 00543 if ((*it).type() != m_valueType) 00544 { 00545 m_valueType = TQT_DBusData::Invalid; 00546 m_containerValueType = TQT_DBusData(); 00547 00548 clear(); 00549 return *this; 00550 } 00551 else if (hasContainerValueType()) 00552 { 00553 if (it.data()->buildSignature() != containerSignature) 00554 { 00555 m_valueType = TQT_DBusData::Invalid; 00556 m_containerValueType = TQT_DBusData(); 00557 00558 clear(); 00559 return *this; 00560 } 00561 } 00562 } 00563 00564 return *this; 00565 }
| TQT_DBusDataMap<T>& TQT_DBusDataMap< T >::operator= | ( | const TQT_DBusDataMap< T > & | other | ) | [inline] |
Copies from the given other map.
This behaves basically like copying a TQMap through its assignment operator, i.e. no value are actually copied at this time.
| other | the other map object to copy from |
Definition at line 498 of file tqdbusdatamap.h.
References TQT_DBusDataMap< T >::m_containerValueType, TQT_DBusDataMap< T >::m_valueType, and TQT_DBusData::operator=().
00499 { 00500 TQMap<T, TQT_DBusData>::operator=(other); 00501 00502 m_valueType = other.m_valueType; 00503 m_containerValueType = other.m_containerValueType; 00504 00505 return *this; 00506 }
| bool TQT_DBusDataMap< T >::operator== | ( | const TQT_DBusDataMap< T > & | other | ) | const [inline] |
Checks whether the given other map is equal to this one.
Two maps are considered equal when they have the same value type (and same container value type if the have one) and the key/value pairs are equal as well.
| other | the other map object to compare with |
true if the maps are equal, otherwise false Definition at line 664 of file tqdbusdatamap.h.
References TQT_DBusDataMap< T >::begin(), TQT_DBusData::buildDBusSignature(), TQT_DBusDataMap< T >::count(), TQT_DBusDataMap< T >::end(), TQT_DBusDataMap< T >::hasContainerValueType(), TQT_DBusDataMap< T >::m_containerValueType, and TQT_DBusDataMap< T >::m_valueType.
00665 { 00666 if (m_valueType != other.m_valueType) return false; 00667 00668 if (count() != other.count()) return false; 00669 00670 if (hasContainerValueType() != other.hasContainerValueType()) return false; 00671 00672 if (hasContainerValueType()) 00673 { 00674 if (m_containerValueType.buildDBusSignature() != 00675 other.m_containerValueType.buildDBusSignature()) return false; 00676 } 00677 00678 const_iterator it = begin(); 00679 const_iterator otherIt = other.begin(); 00680 for (; it != end() && otherIt != other.end(); ++it, ++otherIt) 00681 { 00682 if (it.key() != otherIt.key()) return false; 00683 00684 if (!(it.data() == otherIt.data())) return false; 00685 } 00686 00687 return true; 00688 }
| TQMap<T, bool> TQT_DBusDataMap< T >::toBoolMap | ( | bool * | ok = 0 |
) | const [inline] |
Tries to get the map object's pairs as a TQMap of bool.
This is a convenience overload for the case when the map is of value type TQT_DBusData::Bool.
| ok | optional 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 value type TQT_DBusData::Bool) |
Definition at line 796 of file tqdbusdatamap.h.
References TQT_DBusData::Bool.
00797 { 00798 if (m_valueType != TQT_DBusData::Bool) 00799 { 00800 if (ok != 0) *ok = false; 00801 return TQMap<T, bool>(); 00802 } 00803 00804 TQMap<T, bool> result; 00805 00806 const_iterator it = begin(); 00807 const_iterator endIt = end(); 00808 for (; it != endIt; ++it) 00809 { 00810 result.insert(it.key(), (*it).toBool()); 00811 } 00812 00813 if (ok != 0) *ok = true; 00814 00815 return result; 00816 }
| TQMap<T, TQ_UINT8> TQT_DBusDataMap< T >::toByteMap | ( | bool * | ok = 0 |
) | const [inline] |
Tries to get the map object's pairs as a TQMap of TQ_UINT8.
This is a convenience overload for the case when the map is of value type TQT_DBusData::Byte.
| ok | optional 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 value type TQT_DBusData::Byte) |
Definition at line 834 of file tqdbusdatamap.h.
References TQT_DBusData::Byte.
00835 { 00836 if (m_valueType != TQT_DBusData::Byte) 00837 { 00838 if (ok != 0) *ok = false; 00839 return TQMap<T, TQ_UINT8>(); 00840 } 00841 00842 TQMap<T, TQ_UINT8> result; 00843 00844 const_iterator it = begin(); 00845 const_iterator endIt = end(); 00846 for (; it != endIt; ++it) 00847 { 00848 result.insert(it.key(), (*it).toByte()); 00849 } 00850 00851 if (ok != 0) *ok = true; 00852 00853 return result; 00854 }
| TQMap<T, double> TQT_DBusDataMap< T >::toDoubleMap | ( | bool * | ok = 0 |
) | const [inline] |
Tries to get the map object's pairs as a TQMap of double.
This is a convenience overload for the case when the map is of value type TQT_DBusData::Double.
| ok | optional 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 value type TQT_DBusData::Double) |
Definition at line 1106 of file tqdbusdatamap.h.
References TQT_DBusData::Double.
01107 { 01108 if (m_valueType != TQT_DBusData::Double) 01109 { 01110 if (ok != 0) *ok = false; 01111 return TQMap<T, double>(); 01112 } 01113 01114 TQMap<T, double> result; 01115 01116 const_iterator it = begin(); 01117 const_iterator endIt = end(); 01118 for (; it != endIt; ++it) 01119 { 01120 result.insert(it.key(), (*it).toDouble()); 01121 } 01122 01123 if (ok != 0) *ok = true; 01124 01125 return result; 01126 }
| TQMap<T, TQ_INT16> TQT_DBusDataMap< T >::toInt16Map | ( | bool * | ok = 0 |
) | const [inline] |
Tries to get the map object's pairs as a TQMap of TQ_INT16.
This is a convenience overload for the case when the map is of value type TQT_DBusData::Int16.
| ok | optional 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 value type TQT_DBusData::Int16) |
Definition at line 873 of file tqdbusdatamap.h.
References TQT_DBusData::Int16.
00874 { 00875 if (m_valueType != TQT_DBusData::Int16) 00876 { 00877 if (ok != 0) *ok = false; 00878 return TQMap<T, TQ_INT16>(); 00879 } 00880 00881 TQMap<T, TQ_INT16> result; 00882 00883 const_iterator it = begin(); 00884 const_iterator endIt = end(); 00885 for (; it != endIt; ++it) 00886 { 00887 result.insert(it.key(), (*it).toInt16()); 00888 } 00889 00890 if (ok != 0) *ok = true; 00891 00892 return result; 00893 }
| TQMap<T, TQ_INT32> TQT_DBusDataMap< T >::toInt32Map | ( | bool * | ok = 0 |
) | const [inline] |
Tries to get the map object's pairs as a TQMap of TQ_INT32.
This is a convenience overload for the case when the map is of value type TQT_DBusData::Int32.
| ok | optional 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 value type TQT_DBusData::Int32) |
Definition at line 951 of file tqdbusdatamap.h.
References TQT_DBusData::Int32.
00952 { 00953 if (m_valueType != TQT_DBusData::Int32) 00954 { 00955 if (ok != 0) *ok = false; 00956 return TQMap<T, TQ_INT32>(); 00957 } 00958 00959 TQMap<T, TQ_INT32> result; 00960 00961 const_iterator it = begin(); 00962 const_iterator endIt = end(); 00963 for (; it != endIt; ++it) 00964 { 00965 result.insert(it.key(), (*it).toInt32()); 00966 } 00967 00968 if (ok != 0) *ok = true; 00969 00970 return result; 00971 }
| TQMap<T, TQ_INT64> TQT_DBusDataMap< T >::toInt64Map | ( | bool * | ok = 0 |
) | const [inline] |
Tries to get the map object's pairs as a TQMap of TQ_INT64.
This is a convenience overload for the case when the map is of value type TQT_DBusData::Int64.
| ok | optional 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 value type TQT_DBusData::Int64) |
Definition at line 1029 of file tqdbusdatamap.h.
References TQT_DBusData::Int64.
01030 { 01031 if (m_valueType != TQT_DBusData::Int64) 01032 { 01033 if (ok != 0) *ok = false; 01034 return TQMap<T, TQ_INT64>(); 01035 } 01036 01037 TQMap<T, TQ_INT64> result; 01038 01039 const_iterator it = begin(); 01040 const_iterator endIt = end(); 01041 for (; it != endIt; ++it) 01042 { 01043 result.insert(it.key(), (*it).toInt64()); 01044 } 01045 01046 if (ok != 0) *ok = true; 01047 01048 return result; 01049 }
| TQMap<T, TQT_DBusObjectPath> TQT_DBusDataMap< T >::toObjectPathMap | ( | bool * | ok = 0 |
) | const [inline] |
Tries to get the map object's pairs as a TQMap of object paths.
| ok | optional 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 value type TQT_DBusData::ObjectPath) |
Definition at line 1179 of file tqdbusdatamap.h.
References TQT_DBusData::ObjectPath.
01180 { 01181 if (m_valueType != TQT_DBusData::ObjectPath) 01182 { 01183 if (ok != 0) *ok = false; 01184 return TQMap<T, TQT_DBusObjectPath>(); 01185 } 01186 01187 TQMap<T, TQT_DBusObjectPath> result; 01188 01189 const_iterator it = begin(); 01190 const_iterator endIt = end(); 01191 for (; it != endIt; ++it) 01192 { 01193 result.insert(it.key(), (*it).toObjectPath()); 01194 } 01195 01196 if (ok != 0) *ok = true; 01197 01198 return result; 01199 }
| TQMap<T, TQString> TQT_DBusDataMap< T >::toStringMap | ( | bool * | ok = 0 |
) | const [inline] |
Tries to get the map object's pairs as a TQMap of TQString.
This is a convenience overload for the case when the map is of value type TQT_DBusData::String, see also toTQStringList().
| ok | optional 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 value type TQT_DBusData::String) |
Definition at line 1144 of file tqdbusdatamap.h.
References TQT_DBusData::String.
01145 { 01146 if (m_valueType != TQT_DBusData::String) 01147 { 01148 if (ok != 0) *ok = false; 01149 return TQMap<T, TQString>(); 01150 } 01151 01152 TQMap<T, TQString> result; 01153 01154 const_iterator it = begin(); 01155 const_iterator endIt = end(); 01156 for (; it != endIt; ++it) 01157 { 01158 result.insert(it.key(), (*it).toString()); 01159 } 01160 01161 if (ok != 0) *ok = true; 01162 01163 return result; 01164 }
| TQMap<T, TQT_DBusData> TQT_DBusDataMap< T >::toTQMap | ( | ) | const [inline] |
Converts the map object into a TQMap with TQT_DBusData elements.
Definition at line 778 of file tqdbusdatamap.h.
| TQMap<T, TQ_UINT16> TQT_DBusDataMap< T >::toUInt16Map | ( | bool * | ok = 0 |
) | const [inline] |
Tries to get the map object's pairs as a TQMap of TQ_UINT16.
This is a convenience overload for the case when the map is of value type TQT_DBusData::UInt16.
| ok | optional 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 value type TQT_DBusData::UInt16) |
Definition at line 912 of file tqdbusdatamap.h.
References TQT_DBusData::UInt16.
00913 { 00914 if (m_valueType != TQT_DBusData::UInt16) 00915 { 00916 if (ok != 0) *ok = false; 00917 return TQMap<T, TQ_UINT16>(); 00918 } 00919 00920 TQMap<T, TQ_UINT16> result; 00921 00922 const_iterator it = begin(); 00923 const_iterator endIt = end(); 00924 for (; it != endIt; ++it) 00925 { 00926 result.insert(it.key(), (*it).toUInt16()); 00927 } 00928 00929 if (ok != 0) *ok = true; 00930 00931 return result; 00932 }
| TQMap<T, TQ_UINT32> TQT_DBusDataMap< T >::toUInt32Map | ( | bool * | ok = 0 |
) | const [inline] |
Tries to get the map object's pairs as a TQMap of TQ_UINT32.
This is a convenience overload for the case when the map is of value type TQT_DBusData::UInt32.
| ok | optional 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 value type TQT_DBusData::UInt32) |
Definition at line 990 of file tqdbusdatamap.h.
References TQT_DBusData::UInt32.
00991 { 00992 if (m_valueType != TQT_DBusData::UInt32) 00993 { 00994 if (ok != 0) *ok = false; 00995 return TQMap<T, TQ_UINT32>(); 00996 } 00997 00998 TQMap<T, TQ_UINT32> result; 00999 01000 const_iterator it = begin(); 01001 const_iterator endIt = end(); 01002 for (; it != endIt; ++it) 01003 { 01004 result.insert(it.key(), (*it).toUInt32()); 01005 } 01006 01007 if (ok != 0) *ok = true; 01008 01009 return result; 01010 }
| TQMap<T, TQ_UINT64> TQT_DBusDataMap< T >::toUInt64Map | ( | bool * | ok = 0 |
) | const [inline] |
Tries to get the map object's pairs as a TQMap of TQ_UINT64.
This is a convenience overload for the case when the map is of value type TQT_DBusData::UInt64.
| ok | optional 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 value type TQT_DBusData::UInt64) |
Definition at line 1068 of file tqdbusdatamap.h.
References TQT_DBusData::UInt64.
01069 { 01070 if (m_valueType != TQT_DBusData::UInt64) 01071 { 01072 if (ok != 0) *ok = false; 01073 return TQMap<T, TQ_UINT64>(); 01074 } 01075 01076 TQMap<T, TQ_UINT64> result; 01077 01078 const_iterator it = begin(); 01079 const_iterator endIt = end(); 01080 for (; it != endIt; ++it) 01081 { 01082 result.insert(it.key(), (*it).toUInt64()); 01083 } 01084 01085 if (ok != 0) *ok = true; 01086 01087 return result; 01088 }
| TQMap<T, TQT_DBusObjectPath> TQT_DBusDataMap< T >::toUnixFdMap | ( | bool * | ok = 0 |
) | const [inline] |
Tries to get the map object's pairs as a TQMap of TQT_DBusUnixFd.
| ok | optional 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 value type TQT_DBusData::UnixFd) |
Definition at line 1214 of file tqdbusdatamap.h.
References TQT_DBusData::UnixFd.
01215 { 01216 if (m_valueType != TQT_DBusData::UnixFd) 01217 { 01218 if (ok != 0) *ok = false; 01219 return TQMap<T, TQT_DBusUnixFd>(); 01220 } 01221 01222 TQMap<T, TQT_DBusUnixFd> result; 01223 01224 const_iterator it = begin(); 01225 const_iterator endIt = end(); 01226 for (; it != endIt; ++it) 01227 { 01228 result.insert(it.key(), (*it).toUnixFd()); 01229 } 01230 01231 if (ok != 0) *ok = true; 01232 01233 return result; 01234 }
| TQMap<T, TQT_DBusVariant> TQT_DBusDataMap< T >::toVariantMap | ( | bool * | ok = 0 |
) | const [inline] |
Tries to get the map object's pairs as a TQMap of TQT_DBusVariant.
This is a convenience overload for the case when the map is of value type TQT_DBusData::Variant.
| ok | optional 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 value type TQT_DBusData::Variant) |
Definition at line 1252 of file tqdbusdatamap.h.
References TQT_DBusData::Variant.
01253 { 01254 if (m_valueType != TQT_DBusData::Variant) 01255 { 01256 if (ok != 0) *ok = false; 01257 return TQMap<T, TQT_DBusVariant>(); 01258 } 01259 01260 TQMap<T, TQT_DBusVariant> result; 01261 01262 const_iterator it = begin(); 01263 const_iterator endIt = end(); 01264 for (; it != endIt; ++it) 01265 { 01266 result.insert(it.key(), (*it).toVariant()); 01267 } 01268 01269 if (ok != 0) *ok = true; 01270 01271 return result; 01272 }
| TQT_DBusData::Type TQT_DBusDataMap< T >::valueType | ( | ) | const [inline] |
Returns the value type of the map object.
Definition at line 586 of file tqdbusdatamap.h.
00586 { return m_valueType; }
friend class TQT_DBusData [friend] |
Definition at line 75 of file tqdbusdatamap.h.
TQT_DBusData TQT_DBusDataMap< T >::m_containerValueType [private] |
Definition at line 1276 of file tqdbusdatamap.h.
const TQT_DBusData::Type TQT_DBusDataMap< T >::m_keyType [static, private] |
Definition at line 1278 of file tqdbusdatamap.h.
TQT_DBusData::Type TQT_DBusDataMap< T >::m_valueType [private] |
Definition at line 1275 of file tqdbusdatamap.h.
1.6.3