DBus-1-TQt  1.0
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
tqdbusdatamap.h
Go to the documentation of this file.
1 /* qdbusdatamap.h DBUS data mapping transport type
2  *
3  * Copyright (C) 2007 Kevin Krammer <kevin.krammer@gmx.at>
4  *
5  * Licensed under the Academic Free License version 2.1
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
20  * USA.
21  *
22  */
23 
24 #ifndef TQDBUSDATAMAP_H
25 #define TQDBUSDATAMAP_H
26 
27 #include "tqdbusmacros.h"
28 #include <tqmap.h>
29 
30 class TQT_DBusData;
31 class TQT_DBusObjectPath;
32 class TQT_DBusUnixFd;
33 class TQT_DBusVariant;
34 
72 template <typename T>
73 class TQDBUS_EXPORT TQT_DBusDataMap : private TQMap<T, TQT_DBusData>
74 {
75  friend class TQT_DBusData;
76 
77 public:
82  typedef TQMapConstIterator<T, TQT_DBusData> const_iterator;
83 
90  : TQMap<T, TQT_DBusData>(), m_valueType(TQT_DBusData::Invalid) {}
91 
103  explicit TQT_DBusDataMap<T>(TQT_DBusData::Type simpleValueType)
104  : TQMap<T, TQT_DBusData>(), m_valueType(simpleValueType) {}
105 
116  explicit TQT_DBusDataMap<T>(const TQT_DBusData& containerValueType)
117  : TQMap<T, TQT_DBusData>(), m_valueType(containerValueType.type())
118  {
119  if (hasContainerValueType()) m_containerValueType = containerValueType;
120  }
121 
131  : TQMap<T, TQT_DBusData>(other), m_valueType(other.m_valueType),
132  m_containerValueType(other.m_containerValueType) {}
133 
150  TQT_DBusDataMap<T>(const TQMap<T, TQT_DBusData>& other)
151  : TQMap<T, TQT_DBusData>(other), m_valueType(TQT_DBusData::Invalid)
152  {
153  const_iterator it = begin();
154  if (it == end()) return;
155 
156  m_valueType = (*it).type();
157 
158  TQCString containerSignature;
159  if (hasContainerValueType())
160  {
161  m_containerValueType = it.data();
162  containerSignature = m_containerValueType.buildDBusSignature();
163  }
164 
165  for (++it; it != end(); ++it)
166  {
167  if ((*it).type() != m_valueType)
168  {
169  m_valueType = TQT_DBusData::Invalid;
170  m_containerValueType = TQT_DBusData();
171 
172  clear();
173  return;
174  }
175  else if (hasContainerValueType())
176  {
177  if (it.data().buildDBusSignature() != containerSignature)
178  {
179  m_valueType = TQT_DBusData::Invalid;
180  m_containerValueType = TQT_DBusData();
181 
182  clear();
183  return;
184  }
185  }
186  }
187  }
188 
201  TQT_DBusDataMap<T>(const TQMap<T, bool>& other)
202  : TQMap<T, TQT_DBusData>(), m_valueType(TQT_DBusData::Bool)
203  {
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)
207  {
208  insert(it.key(), TQT_DBusData::fromBool(it.data()));
209  }
210  }
211 
224  TQT_DBusDataMap<T>(const TQMap<T, TQ_UINT8>& other)
225  : TQMap<T, TQT_DBusData>(), m_valueType(TQT_DBusData::Byte)
226  {
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)
230  {
231  insert(it.key(), TQT_DBusData::fromByte(it.data()));
232  }
233  }
234 
247  TQT_DBusDataMap<T>(const TQMap<T, TQ_INT16>& other)
248  : TQMap<T, TQT_DBusData>(), m_valueType(TQT_DBusData::Int16)
249  {
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)
253  {
254  insert(it.key(), TQT_DBusData::fromInt16(it.data()));
255  }
256  }
257 
270  TQT_DBusDataMap<T>(const TQMap<T, TQ_UINT16>& other)
271  : TQMap<T, TQT_DBusData>(), m_valueType(TQT_DBusData::UInt16)
272  {
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)
276  {
277  insert(it.key(), TQT_DBusData::fromUInt16(it.data()));
278  }
279  }
280 
293  TQT_DBusDataMap<T>(const TQMap<T, TQ_INT32>& other)
294  : TQMap<T, TQT_DBusData>(), m_valueType(TQT_DBusData::Int32)
295  {
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)
299  {
300  insert(it.key(), TQT_DBusData::fromInt32(it.data()));
301  }
302  }
303 
316  TQT_DBusDataMap<T>(const TQMap<T, TQ_UINT32>& other)
317  : TQMap<T, TQT_DBusData>(), m_valueType(TQT_DBusData::UInt32)
318  {
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)
322  {
323  insert(it.key(), TQT_DBusData::fromUInt32(it.data()));
324  }
325  }
326 
339  TQT_DBusDataMap<T>(const TQMap<T, TQ_INT64>& other)
340  : TQMap<T, TQT_DBusData>(), m_valueType(TQT_DBusData::Int64)
341  {
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)
345  {
346  insert(it.key(), TQT_DBusData::fromInt64(it.data()));
347  }
348  }
349 
362  TQT_DBusDataMap<T>(const TQMap<T, TQ_UINT64>& other)
363  : TQMap<T, TQT_DBusData>(), m_valueType(TQT_DBusData::UInt64)
364  {
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)
368  {
369  insert(it.key(), TQT_DBusData::fromUInt64(it.data()));
370  }
371  }
372 
385  TQT_DBusDataMap<T>(const TQMap<T, double>& other)
386  : TQMap<T, TQT_DBusData>(), m_valueType(TQT_DBusData::Double)
387  {
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)
391  {
392  insert(it.key(), TQT_DBusData::fromDouble(it.data()));
393  }
394  }
395 
408  TQT_DBusDataMap<T>(const TQMap<T, TQString>& other)
409  : TQMap<T, TQT_DBusData>(), m_valueType(TQT_DBusData::String)
410  {
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)
414  {
415  insert(it.key(), TQT_DBusData::fromString(it.data()));
416  }
417  }
418 
431  TQT_DBusDataMap<T>(const TQMap<T, TQT_DBusObjectPath>& other)
432  : TQMap<T, TQT_DBusData>(), m_valueType(TQT_DBusData::ObjectPath)
433  {
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)
437  {
438  insert(it.key(), TQT_DBusData::fromObjectPath(it.data()));
439  }
440  }
441 
454  TQT_DBusDataMap<T>(const TQMap<T, TQT_DBusUnixFd>& other)
455  : TQMap<T, TQT_DBusData>(), m_valueType(TQT_DBusData::UnixFd)
456  {
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)
460  {
461  insert(it.key(), TQT_DBusData::fromUnixFd(it.data()));
462  }
463  }
464 
477  TQT_DBusDataMap<T>(const TQMap<T, TQT_DBusVariant>& other)
478  : TQMap<T, TQT_DBusData>(), m_valueType(TQT_DBusData::Variant)
479  {
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)
483  {
484  insert(it.key(), TQT_DBusData::fromVariant(it.data()));
485  }
486  }
487 
499  {
500  TQMap<T, TQT_DBusData>::operator=(other);
501 
502  m_valueType = other.m_valueType;
503  m_containerValueType = other.m_containerValueType;
504 
505  return *this;
506  }
507 
522  TQT_DBusDataMap<T>& operator=(const TQMap<T, TQT_DBusData>& other)
523  {
524  TQMap<T, TQT_DBusData>::operator=(other);
525 
526  m_valueType = TQT_DBusData::Invalid;
527  m_containerValueType = TQT_DBusData();
528 
529  const_iterator it = begin();
530  if (it == end()) return *this;
531 
532  m_valueType = (*it).type();
533 
534  TQCString containerSignature;
535  if (hasContainerValueType())
536  {
537  m_containerValueType = it.data();
538  containerSignature = m_containerValueType.buildDBusSignature();
539  }
540 
541  for (++it; it != end(); ++it)
542  {
543  if ((*it).type() != m_valueType)
544  {
545  m_valueType = TQT_DBusData::Invalid;
546  m_containerValueType = TQT_DBusData();
547 
548  clear();
549  return *this;
550  }
551  else if (hasContainerValueType())
552  {
553  if (it.data()->buildSignature() != containerSignature)
554  {
555  m_valueType = TQT_DBusData::Invalid;
556  m_containerValueType = TQT_DBusData();
557 
558  clear();
559  return *this;
560  }
561  }
562  }
563 
564  return *this;
565  }
566 
575  TQT_DBusData::Type keyType() const { return m_keyType; }
576 
586  TQT_DBusData::Type valueType() const { return m_valueType; }
587 
602  {
603  return m_valueType == TQT_DBusData::List || m_valueType == TQT_DBusData::Struct
604  || m_valueType == TQT_DBusData::Map;
605  }
606 
622  TQT_DBusData containerValueType() const { return m_containerValueType; }
623 
631  inline bool isValid() const { return valueType() != TQT_DBusData::Invalid; }
632 
640  bool isEmpty() const { return TQMap<T, TQT_DBusData>::empty(); }
641 
649  uint count() const { return TQMap<T, TQT_DBusData>::count(); }
650 
664  bool operator==(const TQT_DBusDataMap<T>& other) const
665  {
666  if (m_valueType != other.m_valueType) return false;
667 
668  if (count() != other.count()) return false;
669 
670  if (hasContainerValueType() != other.hasContainerValueType()) return false;
671 
672  if (hasContainerValueType())
673  {
674  if (m_containerValueType.buildDBusSignature() !=
675  other.m_containerValueType.buildDBusSignature()) return false;
676  }
677 
678  const_iterator it = begin();
679  const_iterator otherIt = other.begin();
680  for (; it != end() && otherIt != other.end(); ++it, ++otherIt)
681  {
682  if (it.key() != otherIt.key()) return false;
683 
684  if (!(it.data() == otherIt.data())) return false;
685  }
686 
687  return true;
688  }
689 
695  void clear() { TQMap<T, TQT_DBusData>::clear(); }
696 
702  const_iterator begin() const
703  {
704  return TQMap<T, TQT_DBusData>::begin();
705  }
706 
712  const_iterator end() const
713  {
714  return TQMap<T, TQT_DBusData>::end();
715  }
716 
735  bool insert(const T& key, const TQT_DBusData& data)
736  {
737  if (data.type() == TQT_DBusData::Invalid) return false;
738 
739  if (m_valueType == TQT_DBusData::Invalid)
740  {
741  m_valueType = data.type();
742 
743  // TODO: create empty copy of container
744  if (hasContainerValueType()) m_containerValueType = data;
745 
746  TQMap<T, TQT_DBusData>::insert(key, data);
747  }
748  else if (data.type() != m_valueType)
749  {
750  tqWarning("TQT_DBusDataMap: trying to add data of type %s to map of type %s",
751  data.typeName(), TQT_DBusData::typeName(m_valueType));
752  }
753  else if (hasContainerValueType())
754  {
755  TQCString ourSignature = m_containerValueType.buildDBusSignature();
756  TQCString dataSignature = data.buildDBusSignature();
757 
758  if (ourSignature != dataSignature)
759  {
760  tqWarning("TQT_DBusDataMap: trying to add data with signature %s "
761  "to map with value signature %s",
762  dataSignature.data(), ourSignature.data());
763  }
764  else
765  TQMap<T, TQT_DBusData>::insert(key, data);
766  }
767  else
768  TQMap<T, TQT_DBusData>::insert(key, data);
769 
770  return true;
771  }
772 
778  TQMap<T, TQT_DBusData> toTQMap() const { return *this; }
779 
796  TQMap<T, bool> toBoolMap(bool* ok = 0) const
797  {
798  if (m_valueType != TQT_DBusData::Bool)
799  {
800  if (ok != 0) *ok = false;
801  return TQMap<T, bool>();
802  }
803 
804  TQMap<T, bool> result;
805 
806  const_iterator it = begin();
807  const_iterator endIt = end();
808  for (; it != endIt; ++it)
809  {
810  result.insert(it.key(), (*it).toBool());
811  }
812 
813  if (ok != 0) *ok = true;
814 
815  return result;
816  }
817 
834  TQMap<T, TQ_UINT8> toByteMap(bool* ok = 0) const
835  {
836  if (m_valueType != TQT_DBusData::Byte)
837  {
838  if (ok != 0) *ok = false;
839  return TQMap<T, TQ_UINT8>();
840  }
841 
842  TQMap<T, TQ_UINT8> result;
843 
844  const_iterator it = begin();
845  const_iterator endIt = end();
846  for (; it != endIt; ++it)
847  {
848  result.insert(it.key(), (*it).toByte());
849  }
850 
851  if (ok != 0) *ok = true;
852 
853  return result;
854  }
855 
873  TQMap<T, TQ_INT16> toInt16Map(bool* ok = 0) const
874  {
875  if (m_valueType != TQT_DBusData::Int16)
876  {
877  if (ok != 0) *ok = false;
878  return TQMap<T, TQ_INT16>();
879  }
880 
881  TQMap<T, TQ_INT16> result;
882 
883  const_iterator it = begin();
884  const_iterator endIt = end();
885  for (; it != endIt; ++it)
886  {
887  result.insert(it.key(), (*it).toInt16());
888  }
889 
890  if (ok != 0) *ok = true;
891 
892  return result;
893  }
894 
912  TQMap<T, TQ_UINT16> toUInt16Map(bool* ok = 0) const
913  {
914  if (m_valueType != TQT_DBusData::UInt16)
915  {
916  if (ok != 0) *ok = false;
917  return TQMap<T, TQ_UINT16>();
918  }
919 
920  TQMap<T, TQ_UINT16> result;
921 
922  const_iterator it = begin();
923  const_iterator endIt = end();
924  for (; it != endIt; ++it)
925  {
926  result.insert(it.key(), (*it).toUInt16());
927  }
928 
929  if (ok != 0) *ok = true;
930 
931  return result;
932  }
933 
951  TQMap<T, TQ_INT32> toInt32Map(bool* ok = 0) const
952  {
953  if (m_valueType != TQT_DBusData::Int32)
954  {
955  if (ok != 0) *ok = false;
956  return TQMap<T, TQ_INT32>();
957  }
958 
959  TQMap<T, TQ_INT32> result;
960 
961  const_iterator it = begin();
962  const_iterator endIt = end();
963  for (; it != endIt; ++it)
964  {
965  result.insert(it.key(), (*it).toInt32());
966  }
967 
968  if (ok != 0) *ok = true;
969 
970  return result;
971  }
972 
990  TQMap<T, TQ_UINT32> toUInt32Map(bool* ok = 0) const
991  {
992  if (m_valueType != TQT_DBusData::UInt32)
993  {
994  if (ok != 0) *ok = false;
995  return TQMap<T, TQ_UINT32>();
996  }
997 
998  TQMap<T, TQ_UINT32> result;
999 
1000  const_iterator it = begin();
1001  const_iterator endIt = end();
1002  for (; it != endIt; ++it)
1003  {
1004  result.insert(it.key(), (*it).toUInt32());
1005  }
1006 
1007  if (ok != 0) *ok = true;
1008 
1009  return result;
1010  }
1011 
1029  TQMap<T, TQ_INT64> toInt64Map(bool* ok = 0) const
1030  {
1031  if (m_valueType != TQT_DBusData::Int64)
1032  {
1033  if (ok != 0) *ok = false;
1034  return TQMap<T, TQ_INT64>();
1035  }
1036 
1037  TQMap<T, TQ_INT64> result;
1038 
1039  const_iterator it = begin();
1040  const_iterator endIt = end();
1041  for (; it != endIt; ++it)
1042  {
1043  result.insert(it.key(), (*it).toInt64());
1044  }
1045 
1046  if (ok != 0) *ok = true;
1047 
1048  return result;
1049  }
1050 
1068  TQMap<T, TQ_UINT64> toUInt64Map(bool* ok = 0) const
1069  {
1070  if (m_valueType != TQT_DBusData::UInt64)
1071  {
1072  if (ok != 0) *ok = false;
1073  return TQMap<T, TQ_UINT64>();
1074  }
1075 
1076  TQMap<T, TQ_UINT64> result;
1077 
1078  const_iterator it = begin();
1079  const_iterator endIt = end();
1080  for (; it != endIt; ++it)
1081  {
1082  result.insert(it.key(), (*it).toUInt64());
1083  }
1084 
1085  if (ok != 0) *ok = true;
1086 
1087  return result;
1088  }
1089 
1106  TQMap<T, double> toDoubleMap(bool* ok = 0) const
1107  {
1108  if (m_valueType != TQT_DBusData::Double)
1109  {
1110  if (ok != 0) *ok = false;
1111  return TQMap<T, double>();
1112  }
1113 
1114  TQMap<T, double> result;
1115 
1116  const_iterator it = begin();
1117  const_iterator endIt = end();
1118  for (; it != endIt; ++it)
1119  {
1120  result.insert(it.key(), (*it).toDouble());
1121  }
1122 
1123  if (ok != 0) *ok = true;
1124 
1125  return result;
1126  }
1127 
1144  TQMap<T, TQString> toStringMap(bool* ok = 0) const
1145  {
1146  if (m_valueType != TQT_DBusData::String)
1147  {
1148  if (ok != 0) *ok = false;
1149  return TQMap<T, TQString>();
1150  }
1151 
1152  TQMap<T, TQString> result;
1153 
1154  const_iterator it = begin();
1155  const_iterator endIt = end();
1156  for (; it != endIt; ++it)
1157  {
1158  result.insert(it.key(), (*it).toString());
1159  }
1160 
1161  if (ok != 0) *ok = true;
1162 
1163  return result;
1164  }
1165 
1179  TQMap<T, TQT_DBusObjectPath> toObjectPathMap(bool* ok = 0) const
1180  {
1181  if (m_valueType != TQT_DBusData::ObjectPath)
1182  {
1183  if (ok != 0) *ok = false;
1184  return TQMap<T, TQT_DBusObjectPath>();
1185  }
1186 
1187  TQMap<T, TQT_DBusObjectPath> result;
1188 
1189  const_iterator it = begin();
1190  const_iterator endIt = end();
1191  for (; it != endIt; ++it)
1192  {
1193  result.insert(it.key(), (*it).toObjectPath());
1194  }
1195 
1196  if (ok != 0) *ok = true;
1197 
1198  return result;
1199  }
1200 
1214  TQMap<T, TQT_DBusObjectPath> toUnixFdMap(bool* ok = 0) const
1215  {
1216  if (m_valueType != TQT_DBusData::UnixFd)
1217  {
1218  if (ok != 0) *ok = false;
1219  return TQMap<T, TQT_DBusUnixFd>();
1220  }
1221 
1222  TQMap<T, TQT_DBusUnixFd> result;
1223 
1224  const_iterator it = begin();
1225  const_iterator endIt = end();
1226  for (; it != endIt; ++it)
1227  {
1228  result.insert(it.key(), (*it).toUnixFd());
1229  }
1230 
1231  if (ok != 0) *ok = true;
1232 
1233  return result;
1234  }
1235 
1252  TQMap<T, TQT_DBusVariant> toVariantMap(bool* ok = 0) const
1253  {
1254  if (m_valueType != TQT_DBusData::Variant)
1255  {
1256  if (ok != 0) *ok = false;
1257  return TQMap<T, TQT_DBusVariant>();
1258  }
1259 
1260  TQMap<T, TQT_DBusVariant> result;
1261 
1262  const_iterator it = begin();
1263  const_iterator endIt = end();
1264  for (; it != endIt; ++it)
1265  {
1266  result.insert(it.key(), (*it).toVariant());
1267  }
1268 
1269  if (ok != 0) *ok = true;
1270 
1271  return result;
1272  }
1273 
1274 private:
1277 
1279 };
1280 
1281 #endif
uint count() const
Returns the number of key/value pairs of this map object.
TQMap< T, TQ_INT64 > toInt64Map(bool *ok=0) const
Tries to get the map object's pairs as a TQMap of TQ_INT64.
const char * typeName() const
Returns the string representation of the object's Type.
Definition: tqdbusdata.h:385
TQMap< T, TQT_DBusObjectPath > toObjectPathMap(bool *ok=0) const
Tries to get the map object's pairs as a TQMap of object paths.
static TQT_DBusData fromInt64(TQ_INT64 value)
Creates a data object for the given signed 64-bit integer value.
Definition: tqdbusdata.cpp:493
Data type for representing a D-Bus variant.
Definition: tqdbusvariant.h:56
bool operator==(const TQT_DBusDataMap< T > &other) const
Checks whether the given other map is equal to this one.
bool isEmpty() const
Checks whether this map object has any key/value pairs.
TQT_DBusData::Type valueType() const
Returns the value type of the map object.
TQMap< T, TQ_UINT8 > toByteMap(bool *ok=0) const
Tries to get the map object's pairs as a TQMap of TQ_UINT8.
static TQT_DBusData fromObjectPath(const TQT_DBusObjectPath &value)
Creates a data object for the given object path value.
Definition: tqdbusdata.cpp:585
TQT_DBusData m_containerValueType
Class to transport maps of D-Bus data types.
Definition: tqdbusdata.h:38
static TQT_DBusData fromString(const TQString &value)
Creates a data object for the given string value.
Definition: tqdbusdata.cpp:562
static TQT_DBusData fromByte(TQ_UINT8 value)
Creates a data object for the given byte (unsigned char) value.
Definition: tqdbusdata.cpp:378
TQT_DBusDataMap< T > & operator=(const TQT_DBusDataMap< T > &other)
Copies from the given other map.
TQMap< T, TQT_DBusVariant > toVariantMap(bool *ok=0) const
Tries to get the map object's pairs as a TQMap of TQT_DBusVariant.
Class for representing D-Bus unix file handles.
Definition: tqdbusunixfd.h:51
TQMapConstIterator< T, TQT_DBusData > const_iterator
Definition: tqdbusdatamap.h:82
bool hasContainerValueType() const
Checks whether the value type is a data container itself.
TQMap< T, double > toDoubleMap(bool *ok=0) const
Tries to get the map object's pairs as a TQMap of double.
TQMap< T, TQ_UINT16 > toUInt16Map(bool *ok=0) const
Tries to get the map object's pairs as a TQMap of TQ_UINT16.
bool isValid() const
Checks whether this map object has a valid value type.
TQMap< T, TQ_UINT32 > toUInt32Map(bool *ok=0) const
Tries to get the map object's pairs as a TQMap of TQ_UINT32.
TQT_DBusData::Type keyType() const
Returns the key type of the map object.
TQT_DBusDataMap< T > & operator=(const TQMap< T, TQT_DBusData > &other)
Copies from the given other map.
#define TQDBUS_EXPORT
Definition: tqdbusmacros.h:29
static TQT_DBusData fromUInt64(TQ_UINT64 value)
Creates a data object for the given unsigned 64-bit integer value.
Definition: tqdbusdata.cpp:516
static TQT_DBusData fromInt16(TQ_INT16 value)
Creates a data object for the given signed 16-bit integer value.
Definition: tqdbusdata.cpp:401
TQT_DBusData containerValueType() const
Returns a container prototype for the map's value type.
Type type() const
Returns the Type of the data object.
Definition: tqdbusdata.cpp:317
bool insert(const T &key, const TQT_DBusData &data)
Inserts a given value for a given key.
static TQT_DBusData fromUnixFd(const TQT_DBusUnixFd &value)
Creates a data object for the given unix file handle value.
Definition: tqdbusdata.cpp:611
static const TQT_DBusData::Type m_keyType
TQMap< T, TQT_DBusObjectPath > toUnixFdMap(bool *ok=0) const
Tries to get the map object's pairs as a TQMap of TQT_DBusUnixFd.
Class for accurately representing D-Bus data types.
Definition: tqdbusdata.h:58
static TQT_DBusData fromUInt16(TQ_UINT16 value)
Creates a data object for the given unsigned 16-bit integer value.
Definition: tqdbusdata.cpp:424
static TQT_DBusData fromDouble(double value)
Creates a data object for the given double value.
Definition: tqdbusdata.cpp:539
const_iterator begin() const
Returns an iterator to the first item according to the key sort order.
Class for representing D-Bus object paths.
TQT_DBusData()
Creates an empty, Invalid data object.
Definition: tqdbusdata.cpp:176
TQCString buildDBusSignature() const
Creates the data objects D-Bus signature.
const_iterator end() const
Returns an iterator to an invalid position.
TQMap< T, TQ_INT32 > toInt32Map(bool *ok=0) const
Tries to get the map object's pairs as a TQMap of TQ_INT32.
static TQT_DBusData fromBool(bool value)
Creates a data object for the given boolean value.
Definition: tqdbusdata.cpp:355
TQMap< T, bool > toBoolMap(bool *ok=0) const
Tries to get the map object's pairs as a TQMap of bool.
static TQT_DBusData fromInt32(TQ_INT32 value)
Creates a data object for the given signed 32-bit integer value.
Definition: tqdbusdata.cpp:447
TQT_DBusData::Type m_valueType
TQMap< T, TQ_INT16 > toInt16Map(bool *ok=0) const
Tries to get the map object's pairs as a TQMap of TQ_INT16.
static TQT_DBusData fromUInt32(TQ_UINT32 value)
Creates a data object for the given unsigned 32-bit integer value.
Definition: tqdbusdata.cpp:470
static TQT_DBusData fromVariant(const TQT_DBusVariant &value)
Creates a data object for the given variant value.
Definition: tqdbusdata.cpp:711
Type
Enum for the data types used in D-Bus messages.
Definition: tqdbusdata.h:73
TQMap< T, TQT_DBusData > toTQMap() const
Converts the map object into a TQMap with TQT_DBusData elements.
TQMap< T, TQ_UINT64 > toUInt64Map(bool *ok=0) const
Tries to get the map object's pairs as a TQMap of TQ_UINT64.
TQMap< T, TQString > toStringMap(bool *ok=0) const
Tries to get the map object's pairs as a TQMap of TQString.
void clear()
Clears the map.