24 #ifndef TQDBUSDATAMAP_H
25 #define TQDBUSDATAMAP_H
104 : TQMap<T,
TQT_DBusData>(), m_valueType(simpleValueType) {}
119 if (hasContainerValueType()) m_containerValueType = containerValueType;
131 : TQMap<T,
TQT_DBusData>(other), m_valueType(other.m_valueType),
132 m_containerValueType(other.m_containerValueType) {}
154 if (it == end())
return;
156 m_valueType = (*it).type();
158 TQCString containerSignature;
159 if (hasContainerValueType())
161 m_containerValueType = it.data();
162 containerSignature = m_containerValueType.buildDBusSignature();
165 for (++it; it != end(); ++it)
167 if ((*it).type() != m_valueType)
175 else if (hasContainerValueType())
177 if (it.data().buildDBusSignature() != containerSignature)
204 typename TQMap<T, bool>::const_iterator it = other.begin();
205 typename TQMap<T, bool>::const_iterator endIt = other.end();
206 for (; it != endIt; ++it)
227 typename TQMap<T, TQ_UINT8>::const_iterator it = other.begin();
228 typename TQMap<T, TQ_UINT8>::const_iterator endIt = other.end();
229 for (; it != endIt; ++it)
250 typename TQMap<T, TQ_INT16>::const_iterator it = other.begin();
251 typename TQMap<T, TQ_INT16>::const_iterator endIt = other.end();
252 for (; it != endIt; ++it)
273 typename TQMap<T, TQ_UINT16>::const_iterator it = other.begin();
274 typename TQMap<T, TQ_UINT16>::const_iterator endIt = other.end();
275 for (; it != endIt; ++it)
296 typename TQMap<T, TQ_INT32>::const_iterator it = other.begin();
297 typename TQMap<T, TQ_INT32>::const_iterator endIt = other.end();
298 for (; it != endIt; ++it)
319 typename TQMap<T, TQ_UINT32>::const_iterator it = other.begin();
320 typename TQMap<T, TQ_UINT32>::const_iterator endIt = other.end();
321 for (; it != endIt; ++it)
342 typename TQMap<T, TQ_INT64>::const_iterator it = other.begin();
343 typename TQMap<T, TQ_INT64>::const_iterator endIt = other.end();
344 for (; it != endIt; ++it)
365 typename TQMap<T, TQ_UINT64>::const_iterator it = other.begin();
366 typename TQMap<T, TQ_UINT64>::const_iterator endIt = other.end();
367 for (; it != endIt; ++it)
388 typename TQMap<T, double>::const_iterator it = other.begin();
389 typename TQMap<T, double>::const_iterator endIt = other.end();
390 for (; it != endIt; ++it)
411 typename TQMap<T, TQString>::const_iterator it = other.begin();
412 typename TQMap<T, TQString>::const_iterator endIt = other.end();
413 for (; it != endIt; ++it)
434 typename TQMap<T, TQT_DBusObjectPath>::const_iterator it = other.begin();
435 typename TQMap<T, TQT_DBusObjectPath>::const_iterator endIt = other.end();
436 for (; it != endIt; ++it)
457 typename TQMap<T, TQT_DBusUnixFd>::const_iterator it = other.begin();
458 typename TQMap<T, TQT_DBusUnixFd>::const_iterator endIt = other.end();
459 for (; it != endIt; ++it)
480 typename TQMap<T, TQT_DBusVariant>::const_iterator it = other.begin();
481 typename TQMap<T, TQT_DBusVariant>::const_iterator endIt = other.end();
482 for (; it != endIt; ++it)
496 typename TQMap<T, TQT_DBusDataMap<TQ_UINT8> >
::const_iterator it = other.begin();
497 typename TQMap<T, TQT_DBusDataMap<TQ_UINT8> >
::const_iterator endIt = other.end();
498 for (; it != endIt; ++it)
512 typename TQMap<T, TQT_DBusDataMap<TQ_INT16> >
::const_iterator it = other.begin();
513 typename TQMap<T, TQT_DBusDataMap<TQ_INT16> >
::const_iterator endIt = other.end();
514 for (; it != endIt; ++it)
528 typename TQMap<T, TQT_DBusDataMap<TQ_UINT16> >
::const_iterator it = other.begin();
529 typename TQMap<T, TQT_DBusDataMap<TQ_UINT16> >
::const_iterator endIt = other.end();
530 for (; it != endIt; ++it)
544 typename TQMap<T, TQT_DBusDataMap<TQ_INT32> >
::const_iterator it = other.begin();
545 typename TQMap<T, TQT_DBusDataMap<TQ_INT32> >
::const_iterator endIt = other.end();
546 for (; it != endIt; ++it)
560 typename TQMap<T, TQT_DBusDataMap<TQ_UINT32> >
::const_iterator it = other.begin();
561 typename TQMap<T, TQT_DBusDataMap<TQ_UINT32> >
::const_iterator endIt = other.end();
562 for (; it != endIt; ++it)
576 typename TQMap<T, TQT_DBusDataMap<TQ_INT64> >
::const_iterator it = other.begin();
577 typename TQMap<T, TQT_DBusDataMap<TQ_INT64> >
::const_iterator endIt = other.end();
578 for (; it != endIt; ++it)
592 typename TQMap<T, TQT_DBusDataMap<TQ_UINT64> >
::const_iterator it = other.begin();
593 typename TQMap<T, TQT_DBusDataMap<TQ_UINT64> >
::const_iterator endIt = other.end();
594 for (; it != endIt; ++it)
608 typename TQMap<T, TQT_DBusDataMap<TQString> >
::const_iterator it = other.begin();
609 typename TQMap<T, TQT_DBusDataMap<TQString> >
::const_iterator endIt = other.end();
610 for (; it != endIt; ++it)
624 typename TQMap<T, TQT_DBusDataMap<TQT_DBusObjectPath> >
::const_iterator it = other.begin();
625 typename TQMap<T, TQT_DBusDataMap<TQT_DBusObjectPath> >
::const_iterator endIt = other.end();
626 for (; it != endIt; ++it)
640 typename TQMap<T, TQT_DBusDataMap<TQT_DBusUnixFd > >
::const_iterator it = other.begin();
641 typename TQMap<T, TQT_DBusDataMap<TQT_DBusUnixFd > >
::const_iterator endIt = other.end();
642 for (; it != endIt; ++it)
660 TQMap<T, TQT_DBusData>::operator=(other);
684 TQMap<T, TQT_DBusData>::operator=(other);
690 if (it == end())
return *
this;
692 m_valueType = (*it).type();
694 TQCString containerSignature;
695 if (hasContainerValueType())
697 m_containerValueType = it.data();
698 containerSignature = m_containerValueType.buildDBusSignature();
701 for (++it; it != end(); ++it)
703 if ((*it).type() != m_valueType)
711 else if (hasContainerValueType())
713 if (it.data()->buildSignature() != containerSignature)
800 bool isEmpty()
const {
return TQMap<T, TQT_DBusData>::empty(); }
809 uint
count()
const {
return TQMap<T, TQT_DBusData>::count(); }
826 if (m_valueType != other.
m_valueType)
return false;
828 if (count() != other.
count())
return false;
832 if (hasContainerValueType())
834 if (m_containerValueType.buildDBusSignature() !=
840 for (; it != end() && otherIt != other.
end(); ++it, ++otherIt)
842 if (it.key() != otherIt.key())
return false;
844 if (!(it.data() == otherIt.data()))
return false;
855 void clear() { TQMap<T, TQT_DBusData>::clear(); }
864 return TQMap<T, TQT_DBusData>::begin();
874 return TQMap<T, TQT_DBusData>::end();
901 m_valueType = data.
type();
904 if (hasContainerValueType()) m_containerValueType = data;
906 TQMap<T, TQT_DBusData>::insert(key, data);
908 else if (data.
type() != m_valueType)
910 tqWarning(
"TQT_DBusDataMap: trying to add data of type %s to map of type %s",
913 else if (hasContainerValueType())
915 TQCString ourSignature = m_containerValueType.buildDBusSignature();
918 if (ourSignature != dataSignature)
920 tqWarning(
"TQT_DBusDataMap: trying to add data with signature %s "
921 "to map with value signature %s",
922 dataSignature.data(), ourSignature.data());
925 TQMap<T, TQT_DBusData>::insert(key, data);
928 TQMap<T, TQT_DBusData>::insert(key, data);
938 TQMap<T, TQT_DBusData>
toTQMap()
const {
return *
this; }
960 if (ok != 0) *ok =
false;
961 return TQMap<T, bool>();
964 TQMap<T, bool> result;
968 for (; it != endIt; ++it)
970 result.insert(it.key(), (*it).toBool());
973 if (ok != 0) *ok =
true;
998 if (ok != 0) *ok =
false;
999 return TQMap<T, TQ_UINT8>();
1002 TQMap<T, TQ_UINT8> result;
1006 for (; it != endIt; ++it)
1008 result.insert(it.key(), (*it).toByte());
1011 if (ok != 0) *ok =
true;
1037 if (ok != 0) *ok =
false;
1038 return TQMap<T, TQ_INT16>();
1041 TQMap<T, TQ_INT16> result;
1045 for (; it != endIt; ++it)
1047 result.insert(it.key(), (*it).toInt16());
1050 if (ok != 0) *ok =
true;
1076 if (ok != 0) *ok =
false;
1077 return TQMap<T, TQ_UINT16>();
1080 TQMap<T, TQ_UINT16> result;
1084 for (; it != endIt; ++it)
1086 result.insert(it.key(), (*it).toUInt16());
1089 if (ok != 0) *ok =
true;
1115 if (ok != 0) *ok =
false;
1116 return TQMap<T, TQ_INT32>();
1119 TQMap<T, TQ_INT32> result;
1123 for (; it != endIt; ++it)
1125 result.insert(it.key(), (*it).toInt32());
1128 if (ok != 0) *ok =
true;
1154 if (ok != 0) *ok =
false;
1155 return TQMap<T, TQ_UINT32>();
1158 TQMap<T, TQ_UINT32> result;
1162 for (; it != endIt; ++it)
1164 result.insert(it.key(), (*it).toUInt32());
1167 if (ok != 0) *ok =
true;
1193 if (ok != 0) *ok =
false;
1194 return TQMap<T, TQ_INT64>();
1197 TQMap<T, TQ_INT64> result;
1201 for (; it != endIt; ++it)
1203 result.insert(it.key(), (*it).toInt64());
1206 if (ok != 0) *ok =
true;
1232 if (ok != 0) *ok =
false;
1233 return TQMap<T, TQ_UINT64>();
1236 TQMap<T, TQ_UINT64> result;
1240 for (; it != endIt; ++it)
1242 result.insert(it.key(), (*it).toUInt64());
1245 if (ok != 0) *ok =
true;
1270 if (ok != 0) *ok =
false;
1271 return TQMap<T, double>();
1274 TQMap<T, double> result;
1278 for (; it != endIt; ++it)
1280 result.insert(it.key(), (*it).toDouble());
1283 if (ok != 0) *ok =
true;
1308 if (ok != 0) *ok =
false;
1309 return TQMap<T, TQString>();
1312 TQMap<T, TQString> result;
1316 for (; it != endIt; ++it)
1318 result.insert(it.key(), (*it).toString());
1321 if (ok != 0) *ok =
true;
1343 if (ok != 0) *ok =
false;
1344 return TQMap<T, TQT_DBusObjectPath>();
1347 TQMap<T, TQT_DBusObjectPath> result;
1351 for (; it != endIt; ++it)
1353 result.insert(it.key(), (*it).toObjectPath());
1356 if (ok != 0) *ok =
true;
1378 if (ok != 0) *ok =
false;
1379 return TQMap<T, TQT_DBusUnixFd>();
1382 TQMap<T, TQT_DBusUnixFd> result;
1386 for (; it != endIt; ++it)
1388 result.insert(it.key(), (*it).toUnixFd());
1391 if (ok != 0) *ok =
true;
1416 if (ok != 0) *ok =
false;
1417 return TQMap<T, TQT_DBusVariant>();
1420 TQMap<T, TQT_DBusVariant> result;
1424 for (; it != endIt; ++it)
1426 result.insert(it.key(), (*it).toVariant());
1429 if (ok != 0) *ok =
true;