summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichele Calgaro <michele.calgaro@yahoo.it>2019-05-18 22:13:52 +0900
committerMichele Calgaro <michele.calgaro@yahoo.it>2019-05-20 23:29:12 +0900
commit97bfc41b1b0c96544c9cee3b95825b5e4e8abdb0 (patch)
tree7c78150c6fc7f878c32c9bfce55a921e67d807ed
parent00b00f996127cbb0e9d677494494b971cbdadb3d (diff)
downloaddbus-1-tqt-97bfc41b1b0c96544c9cee3b95825b5e4e8abdb0.tar.gz
dbus-1-tqt-97bfc41b1b0c96544c9cee3b95825b5e4e8abdb0.zip
Added methods to create a TQT_DBusDataMap<T> object from a TQMap<T, TQT_DBusDataMap<U> > map.
This fixes a compilation problem when objects with a signature like a{oa{...}} are generated. This refers to issue #7. Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
-rw-r--r--src/tqdbusdatamap.h160
1 files changed, 160 insertions, 0 deletions
diff --git a/src/tqdbusdatamap.h b/src/tqdbusdatamap.h
index ecb06d2..df212d0 100644
--- a/src/tqdbusdatamap.h
+++ b/src/tqdbusdatamap.h
@@ -486,6 +486,166 @@ public:
}
/**
+ * @brief Creates a map from the given TQMap of TQT_DBusDataMap<TQ_UINT8> values
+ *
+ * @param other the TQMap of TQT_DBusDataMap<TQ_UINT8> values to copy from
+ */
+ TQT_DBusDataMap<T>(const TQMap<T, TQT_DBusDataMap<TQ_UINT8> >& other)
+ : TQMap<T, TQT_DBusData>(), m_valueType(TQT_DBusData::Map)
+ {
+ typename TQMap<T, TQT_DBusDataMap<TQ_UINT8> >::const_iterator it = other.begin();
+ typename TQMap<T, TQT_DBusDataMap<TQ_UINT8> >::const_iterator endIt = other.end();
+ for (; it != endIt; ++it)
+ {
+ insert(it.key(), TQT_DBusData::fromByteKeyMap(it.data()));
+ }
+ }
+
+ /**
+ * @brief Creates a map from the given TQMap of TQT_DBusDataMap<TQ_INT16> values
+ *
+ * @param other the TQMap of TQT_DBusDataMap<TQ_INT16> values to copy from
+ */
+ TQT_DBusDataMap<T>(const TQMap<T, TQT_DBusDataMap<TQ_INT16> >& other)
+ : TQMap<T, TQT_DBusData>(), m_valueType(TQT_DBusData::Map)
+ {
+ typename TQMap<T, TQT_DBusDataMap<TQ_INT16> >::const_iterator it = other.begin();
+ typename TQMap<T, TQT_DBusDataMap<TQ_INT16> >::const_iterator endIt = other.end();
+ for (; it != endIt; ++it)
+ {
+ insert(it.key(), TQT_DBusData::fromInt16KeyMap(it.data()));
+ }
+ }
+
+ /**
+ * @brief Creates a map from the given TQMap of TQT_DBusDataMap<TQ_UINT16> values
+ *
+ * @param other the TQMap of TQT_DBusDataMap<TQ_UINT16> values to copy from
+ */
+ TQT_DBusDataMap<T>(const TQMap<T, TQT_DBusDataMap<TQ_UINT16> >& other)
+ : TQMap<T, TQT_DBusData>(), m_valueType(TQT_DBusData::Map)
+ {
+ typename TQMap<T, TQT_DBusDataMap<TQ_UINT16> >::const_iterator it = other.begin();
+ typename TQMap<T, TQT_DBusDataMap<TQ_UINT16> >::const_iterator endIt = other.end();
+ for (; it != endIt; ++it)
+ {
+ insert(it.key(), TQT_DBusData::fromUInt16KeyMap(it.data()));
+ }
+ }
+
+ /**
+ * @brief Creates a map from the given TQMap of TQT_DBusDataMap<TQ_INT32> values
+ *
+ * @param other the TQMap of TQT_DBusDataMap<TQ_INT32> values to copy from
+ */
+ TQT_DBusDataMap<T>(const TQMap<T, TQT_DBusDataMap<TQ_INT32> >& other)
+ : TQMap<T, TQT_DBusData>(), m_valueType(TQT_DBusData::Map)
+ {
+ typename TQMap<T, TQT_DBusDataMap<TQ_INT32> >::const_iterator it = other.begin();
+ typename TQMap<T, TQT_DBusDataMap<TQ_INT32> >::const_iterator endIt = other.end();
+ for (; it != endIt; ++it)
+ {
+ insert(it.key(), TQT_DBusData::fromInt32KeyMap(it.data()));
+ }
+ }
+
+ /**
+ * @brief Creates a map from the given TQMap of TQT_DBusDataMap<TQ_UINT32> values
+ *
+ * @param other the TQMap of TQT_DBusDataMap<TQ_UINT32> values to copy from
+ */
+ TQT_DBusDataMap<T>(const TQMap<T, TQT_DBusDataMap<TQ_UINT32> >& other)
+ : TQMap<T, TQT_DBusData>(), m_valueType(TQT_DBusData::Map)
+ {
+ typename TQMap<T, TQT_DBusDataMap<TQ_UINT32> >::const_iterator it = other.begin();
+ typename TQMap<T, TQT_DBusDataMap<TQ_UINT32> >::const_iterator endIt = other.end();
+ for (; it != endIt; ++it)
+ {
+ insert(it.key(), TQT_DBusData::fromUInt32KeyMap(it.data()));
+ }
+ }
+
+ /**
+ * @brief Creates a map from the given TQMap of TQT_DBusDataMap<TQ_INT64> values
+ *
+ * @param other the TQMap of TQT_DBusDataMap<TQ_INT64> values to copy from
+ */
+ TQT_DBusDataMap<T>(const TQMap<T, TQT_DBusDataMap<TQ_INT64> >& other)
+ : TQMap<T, TQT_DBusData>(), m_valueType(TQT_DBusData::Map)
+ {
+ typename TQMap<T, TQT_DBusDataMap<TQ_INT64> >::const_iterator it = other.begin();
+ typename TQMap<T, TQT_DBusDataMap<TQ_INT64> >::const_iterator endIt = other.end();
+ for (; it != endIt; ++it)
+ {
+ insert(it.key(), TQT_DBusData::fromInt64KeyMap(it.data()));
+ }
+ }
+
+ /**
+ * @brief Creates a map from the given TQMap of TQT_DBusDataMap<TQ_UINT64> values
+ *
+ * @param other the TQMap of TQT_DBusDataMap<TQ_UINT64> values to copy from
+ */
+ TQT_DBusDataMap<T>(const TQMap<T, TQT_DBusDataMap<TQ_UINT64> >& other)
+ : TQMap<T, TQT_DBusData>(), m_valueType(TQT_DBusData::Map)
+ {
+ typename TQMap<T, TQT_DBusDataMap<TQ_UINT64> >::const_iterator it = other.begin();
+ typename TQMap<T, TQT_DBusDataMap<TQ_UINT64> >::const_iterator endIt = other.end();
+ for (; it != endIt; ++it)
+ {
+ insert(it.key(), TQT_DBusData::fromUInt64KeyMap(it.data()));
+ }
+ }
+
+ /**
+ * @brief Creates a map from the given TQMap of TQT_DBusDataMap<TQString> values
+ *
+ * @param other the TQMap of TQT_DBusDataMap<TQString> values to copy from
+ */
+ TQT_DBusDataMap<T>(const TQMap<T, TQT_DBusDataMap<TQString> >& other)
+ : TQMap<T, TQT_DBusData>(), m_valueType(TQT_DBusData::Map)
+ {
+ typename TQMap<T, TQT_DBusDataMap<TQString> >::const_iterator it = other.begin();
+ typename TQMap<T, TQT_DBusDataMap<TQString> >::const_iterator endIt = other.end();
+ for (; it != endIt; ++it)
+ {
+ insert(it.key(), TQT_DBusData::fromStringKeyMap(it.data()));
+ }
+ }
+
+ /**
+ * @brief Creates a map from the given TQMap of TQT_DBusDataMap<TQT_DBusObjectPath> values
+ *
+ * @param other the TQMap of TQT_DBusDataMap<TQT_DBusObjectPath> values to copy from
+ */
+ TQT_DBusDataMap<T>(const TQMap<T, TQT_DBusDataMap<TQT_DBusObjectPath> >& other)
+ : TQMap<T, TQT_DBusData>(), m_valueType(TQT_DBusData::Map)
+ {
+ typename TQMap<T, TQT_DBusDataMap<TQT_DBusObjectPath> >::const_iterator it = other.begin();
+ typename TQMap<T, TQT_DBusDataMap<TQT_DBusObjectPath> >::const_iterator endIt = other.end();
+ for (; it != endIt; ++it)
+ {
+ insert(it.key(), TQT_DBusData::fromObjectPathKeyMap(it.data()));
+ }
+ }
+
+ /**
+ * @brief Creates a map from the given TQMap of TQT_DBusDataMap<TQT_DBusUnixFd > values
+ *
+ * @param other the TQMap of TQT_DBusDataMap<TQT_DBusUnixFd > values to copy from
+ */
+ TQT_DBusDataMap<T>(const TQMap<T, TQT_DBusDataMap<TQT_DBusUnixFd > >& other)
+ : TQMap<T, TQT_DBusData>(), m_valueType(TQT_DBusData::Map)
+ {
+ typename TQMap<T, TQT_DBusDataMap<TQT_DBusUnixFd > >::const_iterator it = other.begin();
+ typename TQMap<T, TQT_DBusDataMap<TQT_DBusUnixFd > >::const_iterator endIt = other.end();
+ for (; it != endIt; ++it)
+ {
+ insert(it.key(), TQT_DBusData::fromUnixFdKeyMap(it.data()));
+ }
+ }
+
+ /**
* @brief Copies from the given @p other map
*
* This behaves basically like copying a TQMap through its assignment