DBus-1-TQt 1.0
Loading...
Searching...
No Matches
TQT_DBusDataMap< T > Class Template Reference

#include <tqdbusdatamap.h>

+ Inheritance diagram for TQT_DBusDataMap< T >:
+ Collaboration diagram for TQT_DBusDataMap< T >:

Public Types

typedef TQMapConstIterator< T, TQT_DBusDataconst_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 (const TQMap< T, TQT_DBusDataMap< TQ_UINT8 > > &other)
 
 TQT_DBusDataMap (const TQMap< T, TQT_DBusDataMap< TQ_INT16 > > &other)
 
 TQT_DBusDataMap (const TQMap< T, TQT_DBusDataMap< TQ_UINT16 > > &other)
 
 TQT_DBusDataMap (const TQMap< T, TQT_DBusDataMap< TQ_INT32 > > &other)
 
 TQT_DBusDataMap (const TQMap< T, TQT_DBusDataMap< TQ_UINT32 > > &other)
 
 TQT_DBusDataMap (const TQMap< T, TQT_DBusDataMap< TQ_INT64 > > &other)
 
 TQT_DBusDataMap (const TQMap< T, TQT_DBusDataMap< TQ_UINT64 > > &other)
 
 TQT_DBusDataMap (const TQMap< T, TQT_DBusDataMap< TQString > > &other)
 
 TQT_DBusDataMap (const TQMap< T, TQT_DBusDataMap< TQT_DBusObjectPath > > &other)
 
 TQT_DBusDataMap (const TQMap< T, TQT_DBusDataMap< TQT_DBusUnixFd > > &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_DBusDatatoTQMap () 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_DBusObjectPathtoObjectPathMap (bool *ok=0) const
 
TQMap< T, TQT_DBusObjectPathtoUnixFdMap (bool *ok=0) const
 
TQMap< T, TQT_DBusVarianttoVariantMap (bool *ok=0) const
 

Private Member Functions

const TQT_DBusData::Type m_keyType
 
const TQT_DBusData::Type m_keyType
 
const TQT_DBusData::Type m_keyType
 
const TQT_DBusData::Type m_keyType
 
const TQT_DBusData::Type m_keyType
 
const TQT_DBusData::Type m_keyType
 
const TQT_DBusData::Type m_keyType
 
const TQT_DBusData::Type m_keyType
 
const TQT_DBusData::Type m_keyType
 
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
 

Detailed Description

template<typename T>
class TQT_DBusDataMap< T >

Class to transport maps of D-Bus data types.

Note
while the D-Bus data type is actually called dict this bindings use the term map since TQT_DBusDataMap is essentially a TQMap

There are basically two ways to create TQT_DBusDataMap objects:

  • non-empty from content
  • empty by specifying the desired element type

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);
// or even shorter, using implicit conversion
Class for accurately representing D-Bus data types.
Definition tqdbusdata.h:59
static TQT_DBusData fromInt16KeyMap(const TQT_DBusDataMap< TQ_INT16 > &map)
Creates a data object for the given map.
Class to transport maps of D-Bus data types.

Example for creating an empty map

// empty map for a simple type, mapping from TQString to double
// empty map for value type string lists
static TQT_DBusData fromList(const TQT_DBusDataList &list)
Creates a data object for the given list.
Class to transport lists of D-Bus data types.
TQT_DBusData::Type valueType() const
Returns the value type of the map object.
See also
TQT_DBusDataList

Definition at line 73 of file tqdbusdatamap.h.

Member Typedef Documentation

◆ const_iterator

template<typename T >
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.

Constructor & Destructor Documentation

◆ TQT_DBusDataMap() [1/28]

template<typename T >
TQT_DBusDataMap< T >::TQT_DBusDataMap ( )
inline

Creates an empty and invalid map.

See also
TQT_DBusData::Invalid

Definition at line 82 of file tqdbusdatamap.h.

90 : TQMap<T, TQT_DBusData>(), m_valueType(TQT_DBusData::Invalid) {}
TQT_DBusData::Type m_valueType

◆ TQT_DBusDataMap() [2/28]

template<typename T >
TQT_DBusDataMap< T >::TQT_DBusDataMap ( TQT_DBusData::Type  simpleValueType)
inlineexplicit

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&);

Parameters
simpleValueTypethe type of the values in the new map

Definition at line 82 of file tqdbusdatamap.h.

104 : TQMap<T, TQT_DBusData>(), m_valueType(simpleValueType) {}

◆ TQT_DBusDataMap() [3/28]

template<typename T >
TQT_DBusDataMap< T >::TQT_DBusDataMap ( const TQT_DBusData containerValueType)
inlineexplicit

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);

Parameters
containerValueTypethe type of the values in the new map
See also
hasContainerValueType()

Definition at line 82 of file tqdbusdatamap.h.

117 : TQMap<T, TQT_DBusData>(), m_valueType(containerValueType.type())
118 {
120 }
Type type() const
Returns the Type of the data object.
TQT_DBusData containerValueType() const
Returns a container prototype for the map's value type.
TQT_DBusData m_containerValueType
bool hasContainerValueType() const
Checks whether the value type is a data container itself.

◆ TQT_DBusDataMap() [4/28]

template<typename T >
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.

Parameters
otherthe other map object to copy from

Definition at line 82 of file tqdbusdatamap.h.

131 : TQMap<T, TQT_DBusData>(other), m_valueType(other.m_valueType),

◆ TQT_DBusDataMap() [5/28]

template<typename T >
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.

Warning
if the values of the other map do not all have the same type, the map object will also be empty and invalid
Parameters
otherthe TQMap of TQT_DBusData objects to copy from
See also
toTQMap()

Definition at line 82 of file tqdbusdatamap.h.

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;
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 {
171
172 clear();
173 return;
174 }
175 else if (hasContainerValueType())
176 {
177 if (it.data().buildDBusSignature() != containerSignature)
178 {
181
182 clear();
183 return;
184 }
185 }
186 }
187 }
TQCString buildDBusSignature() const
Creates the data objects D-Bus signature.
TQMapConstIterator< T, TQT_DBusData > const_iterator
const_iterator begin() const
Returns an iterator to the first item according to the key sort order.
const_iterator end() const
Returns an iterator to an invalid position.
void clear()
Clears the map.
friend class TQT_DBusData

◆ TQT_DBusDataMap() [6/28]

template<typename T >
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

Parameters
otherthe TQMap of boolean values to copy from
See also
toBoolMap()

Definition at line 82 of file tqdbusdatamap.h.

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 }
static TQT_DBusData fromBool(bool value)
Creates a data object for the given boolean value.
bool insert(const T &key, const TQT_DBusData &data)
Inserts a given value for a given key.

◆ TQT_DBusDataMap() [7/28]

template<typename T >
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

Parameters
otherthe TQMap of byte (unsigned char) values to copy from
See also
toByteMap()

Definition at line 82 of file tqdbusdatamap.h.

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 }
static TQT_DBusData fromByte(TQ_UINT8 value)
Creates a data object for the given byte (unsigned char) value.

◆ TQT_DBusDataMap() [8/28]

template<typename T >
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

Parameters
otherthe TQMap of signed 16-bit integer values to copy from
See also
toInt16Map()

Definition at line 82 of file tqdbusdatamap.h.

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 }
static TQT_DBusData fromInt16(TQ_INT16 value)
Creates a data object for the given signed 16-bit integer value.

◆ TQT_DBusDataMap() [9/28]

template<typename T >
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

Parameters
otherthe TQMap of unsigned 16-bit integer values to copy from
See also
toUInt16Map()

Definition at line 82 of file tqdbusdatamap.h.

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 }
static TQT_DBusData fromUInt16(TQ_UINT16 value)
Creates a data object for the given unsigned 16-bit integer value.

◆ TQT_DBusDataMap() [10/28]

template<typename T >
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

Parameters
otherthe TQMap of signed 32-bit integer values to copy from
See also
toInt32Map()

Definition at line 82 of file tqdbusdatamap.h.

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 }
static TQT_DBusData fromInt32(TQ_INT32 value)
Creates a data object for the given signed 32-bit integer value.

◆ TQT_DBusDataMap() [11/28]

template<typename T >
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

Parameters
otherthe TQMap of unsigned 32-bit integer values to copy from
See also
toUInt32Map()

Definition at line 82 of file tqdbusdatamap.h.

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 }
static TQT_DBusData fromUInt32(TQ_UINT32 value)
Creates a data object for the given unsigned 32-bit integer value.

◆ TQT_DBusDataMap() [12/28]

template<typename T >
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

Parameters
otherthe TQMap of signed 64-bit integer values to copy from
See also
toInt64Map()

Definition at line 82 of file tqdbusdatamap.h.

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 }
static TQT_DBusData fromInt64(TQ_INT64 value)
Creates a data object for the given signed 64-bit integer value.

◆ TQT_DBusDataMap() [13/28]

template<typename T >
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

Parameters
otherthe TQMap of unsigned 64-bit integer values to copy from
See also
toUInt64Map()

Definition at line 82 of file tqdbusdatamap.h.

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 }
static TQT_DBusData fromUInt64(TQ_UINT64 value)
Creates a data object for the given unsigned 64-bit integer value.

◆ TQT_DBusDataMap() [14/28]

template<typename T >
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

Parameters
otherthe TQMap of double values to copy from
See also
toDoubleMap()

Definition at line 82 of file tqdbusdatamap.h.

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 }
static TQT_DBusData fromDouble(double value)
Creates a data object for the given double value.

◆ TQT_DBusDataMap() [15/28]

template<typename T >
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

Parameters
otherthe TQMap of TQString values to copy from
See also
toStringMap()

Definition at line 82 of file tqdbusdatamap.h.

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 }
static TQT_DBusData fromString(const TQString &value)
Creates a data object for the given string value.

◆ TQT_DBusDataMap() [16/28]

template<typename T >
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

Parameters
otherthe TQMap of object path values to copy from
See also
toObjectPathMap()

Definition at line 82 of file tqdbusdatamap.h.

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 }
static TQT_DBusData fromObjectPath(const TQT_DBusObjectPath &value)
Creates a data object for the given object path value.

◆ TQT_DBusDataMap() [17/28]

template<typename T >
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

Parameters
otherthe TQMap of TQT_DBusUnixFd values to copy from
See also
toUnixFdMap()

Definition at line 82 of file tqdbusdatamap.h.

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 }
static TQT_DBusData fromUnixFd(const TQT_DBusUnixFd &value)
Creates a data object for the given unix file handle value.

◆ TQT_DBusDataMap() [18/28]

template<typename T >
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

Parameters
otherthe TQMap of variant values to copy from
See also
toVariantMap()

Definition at line 82 of file tqdbusdatamap.h.

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 }
static TQT_DBusData fromVariant(const TQT_DBusVariant &value)
Creates a data object for the given variant value.

◆ TQT_DBusDataMap() [19/28]

template<typename T >
TQT_DBusDataMap< T >::TQT_DBusDataMap ( const TQMap< T, TQT_DBusDataMap< TQ_UINT8 > > &  other)
inline

Creates a map from the given TQMap of TQT_DBusDataMap<TQ_UINT8> values.

Parameters
otherthe TQMap of TQT_DBusDataMap<TQ_UINT8> values to copy from

Definition at line 82 of file tqdbusdatamap.h.

494 : TQMap<T, TQT_DBusData>(), m_valueType(TQT_DBusData::Map)
495 {
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)
499 {
500 insert(it.key(), TQT_DBusData::fromByteKeyMap(it.data()));
501 }
502 }
static TQT_DBusData fromByteKeyMap(const TQT_DBusDataMap< TQ_UINT8 > &map)
Creates a data object for the given map.

◆ TQT_DBusDataMap() [20/28]

template<typename T >
TQT_DBusDataMap< T >::TQT_DBusDataMap ( const TQMap< T, TQT_DBusDataMap< TQ_INT16 > > &  other)
inline

Creates a map from the given TQMap of TQT_DBusDataMap<TQ_INT16> values.

Parameters
otherthe TQMap of TQT_DBusDataMap<TQ_INT16> values to copy from

Definition at line 82 of file tqdbusdatamap.h.

510 : TQMap<T, TQT_DBusData>(), m_valueType(TQT_DBusData::Map)
511 {
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)
515 {
516 insert(it.key(), TQT_DBusData::fromInt16KeyMap(it.data()));
517 }
518 }

◆ TQT_DBusDataMap() [21/28]

template<typename T >
TQT_DBusDataMap< T >::TQT_DBusDataMap ( const TQMap< T, TQT_DBusDataMap< TQ_UINT16 > > &  other)
inline

Creates a map from the given TQMap of TQT_DBusDataMap<TQ_UINT16> values.

Parameters
otherthe TQMap of TQT_DBusDataMap<TQ_UINT16> values to copy from

Definition at line 82 of file tqdbusdatamap.h.

526 : TQMap<T, TQT_DBusData>(), m_valueType(TQT_DBusData::Map)
527 {
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)
531 {
532 insert(it.key(), TQT_DBusData::fromUInt16KeyMap(it.data()));
533 }
534 }
static TQT_DBusData fromUInt16KeyMap(const TQT_DBusDataMap< TQ_UINT16 > &map)
Creates a data object for the given map.

◆ TQT_DBusDataMap() [22/28]

template<typename T >
TQT_DBusDataMap< T >::TQT_DBusDataMap ( const TQMap< T, TQT_DBusDataMap< TQ_INT32 > > &  other)
inline

Creates a map from the given TQMap of TQT_DBusDataMap<TQ_INT32> values.

Parameters
otherthe TQMap of TQT_DBusDataMap<TQ_INT32> values to copy from

Definition at line 82 of file tqdbusdatamap.h.

542 : TQMap<T, TQT_DBusData>(), m_valueType(TQT_DBusData::Map)
543 {
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)
547 {
548 insert(it.key(), TQT_DBusData::fromInt32KeyMap(it.data()));
549 }
550 }
static TQT_DBusData fromInt32KeyMap(const TQT_DBusDataMap< TQ_INT32 > &map)
Creates a data object for the given map.

◆ TQT_DBusDataMap() [23/28]

template<typename T >
TQT_DBusDataMap< T >::TQT_DBusDataMap ( const TQMap< T, TQT_DBusDataMap< TQ_UINT32 > > &  other)
inline

Creates a map from the given TQMap of TQT_DBusDataMap<TQ_UINT32> values.

Parameters
otherthe TQMap of TQT_DBusDataMap<TQ_UINT32> values to copy from

Definition at line 82 of file tqdbusdatamap.h.

558 : TQMap<T, TQT_DBusData>(), m_valueType(TQT_DBusData::Map)
559 {
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)
563 {
564 insert(it.key(), TQT_DBusData::fromUInt32KeyMap(it.data()));
565 }
566 }
static TQT_DBusData fromUInt32KeyMap(const TQT_DBusDataMap< TQ_UINT32 > &map)
Creates a data object for the given map.

◆ TQT_DBusDataMap() [24/28]

template<typename T >
TQT_DBusDataMap< T >::TQT_DBusDataMap ( const TQMap< T, TQT_DBusDataMap< TQ_INT64 > > &  other)
inline

Creates a map from the given TQMap of TQT_DBusDataMap<TQ_INT64> values.

Parameters
otherthe TQMap of TQT_DBusDataMap<TQ_INT64> values to copy from

Definition at line 82 of file tqdbusdatamap.h.

574 : TQMap<T, TQT_DBusData>(), m_valueType(TQT_DBusData::Map)
575 {
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)
579 {
580 insert(it.key(), TQT_DBusData::fromInt64KeyMap(it.data()));
581 }
582 }
static TQT_DBusData fromInt64KeyMap(const TQT_DBusDataMap< TQ_INT64 > &map)
Creates a data object for the given map.

◆ TQT_DBusDataMap() [25/28]

template<typename T >
TQT_DBusDataMap< T >::TQT_DBusDataMap ( const TQMap< T, TQT_DBusDataMap< TQ_UINT64 > > &  other)
inline

Creates a map from the given TQMap of TQT_DBusDataMap<TQ_UINT64> values.

Parameters
otherthe TQMap of TQT_DBusDataMap<TQ_UINT64> values to copy from

Definition at line 82 of file tqdbusdatamap.h.

590 : TQMap<T, TQT_DBusData>(), m_valueType(TQT_DBusData::Map)
591 {
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)
595 {
596 insert(it.key(), TQT_DBusData::fromUInt64KeyMap(it.data()));
597 }
598 }
static TQT_DBusData fromUInt64KeyMap(const TQT_DBusDataMap< TQ_UINT64 > &map)
Creates a data object for the given map.

◆ TQT_DBusDataMap() [26/28]

template<typename T >
TQT_DBusDataMap< T >::TQT_DBusDataMap ( const TQMap< T, TQT_DBusDataMap< TQString > > &  other)
inline

Creates a map from the given TQMap of TQT_DBusDataMap<TQString> values.

Parameters
otherthe TQMap of TQT_DBusDataMap<TQString> values to copy from

Definition at line 82 of file tqdbusdatamap.h.

606 : TQMap<T, TQT_DBusData>(), m_valueType(TQT_DBusData::Map)
607 {
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)
611 {
612 insert(it.key(), TQT_DBusData::fromStringKeyMap(it.data()));
613 }
614 }
static TQT_DBusData fromStringKeyMap(const TQT_DBusDataMap< TQString > &map)
Creates a data object for the given map.

◆ TQT_DBusDataMap() [27/28]

template<typename T >
TQT_DBusDataMap< T >::TQT_DBusDataMap ( const TQMap< T, TQT_DBusDataMap< TQT_DBusObjectPath > > &  other)
inline

Creates a map from the given TQMap of TQT_DBusDataMap<TQT_DBusObjectPath> values.

Parameters
otherthe TQMap of TQT_DBusDataMap<TQT_DBusObjectPath> values to copy from

Definition at line 82 of file tqdbusdatamap.h.

622 : TQMap<T, TQT_DBusData>(), m_valueType(TQT_DBusData::Map)
623 {
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)
627 {
628 insert(it.key(), TQT_DBusData::fromObjectPathKeyMap(it.data()));
629 }
630 }
static TQT_DBusData fromObjectPathKeyMap(const TQT_DBusDataMap< TQT_DBusObjectPath > &map)
Creates a data object for the given map.

◆ TQT_DBusDataMap() [28/28]

template<typename T >
TQT_DBusDataMap< T >::TQT_DBusDataMap ( const TQMap< T, TQT_DBusDataMap< TQT_DBusUnixFd > > &  other)
inline

Creates a map from the given TQMap of TQT_DBusDataMap<TQT_DBusUnixFd > values.

Parameters
otherthe TQMap of TQT_DBusDataMap<TQT_DBusUnixFd > values to copy from

Definition at line 82 of file tqdbusdatamap.h.

638 : TQMap<T, TQT_DBusData>(), m_valueType(TQT_DBusData::Map)
639 {
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)
643 {
644 insert(it.key(), TQT_DBusData::fromUnixFdKeyMap(it.data()));
645 }
646 }
static TQT_DBusData fromUnixFdKeyMap(const TQT_DBusDataMap< TQT_DBusUnixFd > &map)
Creates a data object for the given map.

Member Function Documentation

◆ begin()

template<typename T >
const_iterator TQT_DBusDataMap< T >::begin ( ) const
inline

Returns an iterator to the first item according to the key sort order.

See also
TQMap::begin()

Definition at line 862 of file tqdbusdatamap.h.

863 {
864 return TQMap<T, TQT_DBusData>::begin();
865 }
+ Here is the caller graph for this function:

◆ clear()

template<typename T >
void TQT_DBusDataMap< T >::clear ( )
inline

Clears the map.

Value type and, if applicable, container value type will stay untouched.

Definition at line 855 of file tqdbusdatamap.h.

855{ TQMap<T, TQT_DBusData>::clear(); }

◆ containerValueType()

template<typename T >
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.

Returns
a data object detailing the value type or an invalid data object if the map does not have a container as its element type
See also
TQT_DBusDataMap<T>(const TQT_DBusData&);
valueType()
TQT_DBusData::Invalid

Definition at line 782 of file tqdbusdatamap.h.

782{ return m_containerValueType; }
+ Here is the caller graph for this function:

◆ count()

template<typename T >
uint TQT_DBusDataMap< T >::count ( ) const
inline

Returns the number of key/value pairs of this map object.

Returns
the number of key/value pairs
See also
isEmpty()

Definition at line 809 of file tqdbusdatamap.h.

809{ return TQMap<T, TQT_DBusData>::count(); }
+ Here is the caller graph for this function:

◆ end()

template<typename T >
const_iterator TQT_DBusDataMap< T >::end ( ) const
inline

Returns an iterator to an invalid position.

See also
TQMap::end()

Definition at line 872 of file tqdbusdatamap.h.

873 {
874 return TQMap<T, TQT_DBusData>::end();
875 }
+ Here is the caller graph for this function:

◆ hasContainerValueType()

template<typename T >
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.

Returns
true if the value type is either TQT_DBusData::Map, TQT_DBusData::List or TQT_DBusData::Struct, otherwise false
See also
TQT_DBusDataMap<T>(const TQT_DBusData&)

Definition at line 761 of file tqdbusdatamap.h.

References TQT_DBusData::List, TQT_DBusData::Map, and TQT_DBusData::Struct.

+ Here is the caller graph for this function:

◆ insert()

template<typename T >
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.

Note
the more common use case is to work with a TQMap and then use the respective constructor to create the TQT_DBusDataMap object
Parameters
keythe key were to insert into the map
datathe data item to insert into the map
Returns
true on successfull insert, otherwise false

Definition at line 895 of file tqdbusdatamap.h.

896 {
897 if (data.type() == TQT_DBusData::Invalid) return false;
898
900 {
901 m_valueType = data.type();
902
903 // TODO: create empty copy of container
905
906 TQMap<T, TQT_DBusData>::insert(key, data);
907 }
908 else if (data.type() != m_valueType)
909 {
910 tqWarning("TQT_DBusDataMap: trying to add data of type %s to map of type %s",
912 }
913 else if (hasContainerValueType())
914 {
915 TQCString ourSignature = m_containerValueType.buildDBusSignature();
916 TQCString dataSignature = data.buildDBusSignature();
917
918 if (ourSignature != dataSignature)
919 {
920 tqWarning("TQT_DBusDataMap: trying to add data with signature %s "
921 "to map with value signature %s",
922 dataSignature.data(), ourSignature.data());
923 }
924 else
925 TQMap<T, TQT_DBusData>::insert(key, data);
926 }
927 else
928 TQMap<T, TQT_DBusData>::insert(key, data);
929
930 return true;
931 }
const char * typeName() const
Returns the string representation of the object's Type.
Definition tqdbusdata.h:385

References TQT_DBusData::buildDBusSignature(), TQT_DBusData::Invalid, TQT_DBusData::type(), and TQT_DBusData::typeName().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isEmpty()

template<typename T >
bool TQT_DBusDataMap< T >::isEmpty ( ) const
inline

Checks whether this map object has any key/value pairs.

Returns
true if there are no key/values in this map, otherwise false
See also
count()

Definition at line 800 of file tqdbusdatamap.h.

800{ return TQMap<T, TQT_DBusData>::empty(); }

◆ isValid()

template<typename T >
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

Returns
true if the map object is valid, otherwise false

Definition at line 791 of file tqdbusdatamap.h.

791{ return valueType() != TQT_DBusData::Invalid; }

References TQT_DBusData::Invalid.

◆ keyType()

template<typename T >
TQT_DBusData::Type TQT_DBusDataMap< T >::keyType ( ) const
inline

Returns the key type of the map object.

Returns
one of the values of the TQT_DBusData::Type enum suitable for map keys. See TQT_DBusData::Map for details
See also
valueType()

Definition at line 735 of file tqdbusdatamap.h.

735{ return m_keyType; }
static const TQT_DBusData::Type m_keyType
+ Here is the caller graph for this function:

◆ m_keyType() [1/10]

const TQT_DBusData::Type TQT_DBusDataMap< TQ_UINT8 >::m_keyType
private

Definition at line 146 of file tqdbusdata.cpp.

◆ m_keyType() [2/10]

const TQT_DBusData::Type TQT_DBusDataMap< TQ_INT16 >::m_keyType
private

Definition at line 149 of file tqdbusdata.cpp.

◆ m_keyType() [3/10]

const TQT_DBusData::Type TQT_DBusDataMap< TQ_UINT16 >::m_keyType
private

Definition at line 152 of file tqdbusdata.cpp.

◆ m_keyType() [4/10]

const TQT_DBusData::Type TQT_DBusDataMap< TQ_INT32 >::m_keyType
private

Definition at line 155 of file tqdbusdata.cpp.

◆ m_keyType() [5/10]

const TQT_DBusData::Type TQT_DBusDataMap< TQ_UINT32 >::m_keyType
private

Definition at line 158 of file tqdbusdata.cpp.

◆ m_keyType() [6/10]

const TQT_DBusData::Type TQT_DBusDataMap< TQ_INT64 >::m_keyType
private

Definition at line 161 of file tqdbusdata.cpp.

◆ m_keyType() [7/10]

const TQT_DBusData::Type TQT_DBusDataMap< TQ_UINT64 >::m_keyType
private

Definition at line 164 of file tqdbusdata.cpp.

◆ m_keyType() [8/10]

const TQT_DBusData::Type TQT_DBusDataMap< TQString >::m_keyType
private

Definition at line 167 of file tqdbusdata.cpp.

◆ m_keyType() [9/10]

Definition at line 170 of file tqdbusdata.cpp.

◆ m_keyType() [10/10]

const TQT_DBusData::Type TQT_DBusDataMap< TQT_DBusUnixFd >::m_keyType
private

Definition at line 173 of file tqdbusdata.cpp.

◆ operator=() [1/2]

template<typename T >
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.

Warning
the value of the given 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
Parameters
otherthe other map object to copy from
Returns
a reference to this map object

Definition at line 682 of file tqdbusdatamap.h.

683 {
684 TQMap<T, TQT_DBusData>::operator=(other);
685
688
689 const_iterator it = begin();
690 if (it == end()) return *this;
691
692 m_valueType = (*it).type();
693
694 TQCString containerSignature;
696 {
697 m_containerValueType = it.data();
698 containerSignature = m_containerValueType.buildDBusSignature();
699 }
700
701 for (++it; it != end(); ++it)
702 {
703 if ((*it).type() != m_valueType)
704 {
707
708 clear();
709 return *this;
710 }
711 else if (hasContainerValueType())
712 {
713 if (it.data()->buildSignature() != containerSignature)
714 {
717
718 clear();
719 return *this;
720 }
721 }
722 }
723
724 return *this;
725 }

References TQT_DBusData::Invalid.

◆ operator=() [2/2]

template<typename T >
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.

Parameters
otherthe other map object to copy from
Returns
a reference to this map object

Definition at line 658 of file tqdbusdatamap.h.

659 {
660 TQMap<T, TQT_DBusData>::operator=(other);
661
662 m_valueType = other.m_valueType;
664
665 return *this;
666 }

References TQT_DBusDataMap< T >::m_containerValueType, and TQT_DBusDataMap< T >::m_valueType.

◆ operator==()

template<typename T >
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.

Parameters
otherthe other map object to compare with
Returns
true if the maps are equal, otherwise false
See also
TQT_DBusData::operator==()

Definition at line 824 of file tqdbusdatamap.h.

825 {
826 if (m_valueType != other.m_valueType) return false;
827
828 if (count() != other.count()) return false;
829
830 if (hasContainerValueType() != other.hasContainerValueType()) return false;
831
833 {
835 other.m_containerValueType.buildDBusSignature()) return false;
836 }
837
838 const_iterator it = begin();
839 const_iterator otherIt = other.begin();
840 for (; it != end() && otherIt != other.end(); ++it, ++otherIt)
841 {
842 if (it.key() != otherIt.key()) return false;
843
844 if (!(it.data() == otherIt.data())) return false;
845 }
846
847 return true;
848 }
uint count() const
Returns the number of key/value pairs of this map object.

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.

+ Here is the call graph for this function:

◆ toBoolMap()

template<typename T >
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.

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 value type TQT_DBusData::Bool)
Returns
a TQMap of bool containing the list object's boolean values or an empty map when converting fails
See also
TQT_DBusData::toBool()

Definition at line 956 of file tqdbusdatamap.h.

957 {
959 {
960 if (ok != 0) *ok = false;
961 return TQMap<T, bool>();
962 }
963
964 TQMap<T, bool> result;
965
966 const_iterator it = begin();
967 const_iterator endIt = end();
968 for (; it != endIt; ++it)
969 {
970 result.insert(it.key(), (*it).toBool());
971 }
972
973 if (ok != 0) *ok = true;
974
975 return result;
976 }

References TQT_DBusData::Bool.

◆ toByteMap()

template<typename T >
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.

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 value type TQT_DBusData::Byte)
Returns
a TQMap of TQ_UINT8 containing the list object's byte values or an empty map when converting fails
See also
TQT_DBusData::toBool()

Definition at line 994 of file tqdbusdatamap.h.

995 {
997 {
998 if (ok != 0) *ok = false;
999 return TQMap<T, TQ_UINT8>();
1000 }
1001
1002 TQMap<T, TQ_UINT8> result;
1003
1004 const_iterator it = begin();
1005 const_iterator endIt = end();
1006 for (; it != endIt; ++it)
1007 {
1008 result.insert(it.key(), (*it).toByte());
1009 }
1010
1011 if (ok != 0) *ok = true;
1012
1013 return result;
1014 }

References TQT_DBusData::Byte.

◆ toDoubleMap()

template<typename T >
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.

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 value type TQT_DBusData::Double)
Returns
a TQMap of double containing the map object's double values or an empty map when converting fails
See also
TQT_DBusData::toDouble()

Definition at line 1266 of file tqdbusdatamap.h.

1267 {
1269 {
1270 if (ok != 0) *ok = false;
1271 return TQMap<T, double>();
1272 }
1273
1274 TQMap<T, double> result;
1275
1276 const_iterator it = begin();
1277 const_iterator endIt = end();
1278 for (; it != endIt; ++it)
1279 {
1280 result.insert(it.key(), (*it).toDouble());
1281 }
1282
1283 if (ok != 0) *ok = true;
1284
1285 return result;
1286 }

References TQT_DBusData::Double.

◆ toInt16Map()

template<typename T >
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.

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 value type TQT_DBusData::Int16)
Returns
a TQMap of TQ_INT16 containing the map object's signed 16-bit integer values or an empty map when converting fails
See also
TQT_DBusData::toInt16()

Definition at line 1033 of file tqdbusdatamap.h.

1034 {
1036 {
1037 if (ok != 0) *ok = false;
1038 return TQMap<T, TQ_INT16>();
1039 }
1040
1041 TQMap<T, TQ_INT16> result;
1042
1043 const_iterator it = begin();
1044 const_iterator endIt = end();
1045 for (; it != endIt; ++it)
1046 {
1047 result.insert(it.key(), (*it).toInt16());
1048 }
1049
1050 if (ok != 0) *ok = true;
1051
1052 return result;
1053 }

References TQT_DBusData::Int16.

◆ toInt32Map()

template<typename T >
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.

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 value type TQT_DBusData::Int32)
Returns
a TQMap of TQ_INT32 containing the map object's signed 32-bit integer values or an empty map when converting fails
See also
TQT_DBusData::toInt32()

Definition at line 1111 of file tqdbusdatamap.h.

1112 {
1114 {
1115 if (ok != 0) *ok = false;
1116 return TQMap<T, TQ_INT32>();
1117 }
1118
1119 TQMap<T, TQ_INT32> result;
1120
1121 const_iterator it = begin();
1122 const_iterator endIt = end();
1123 for (; it != endIt; ++it)
1124 {
1125 result.insert(it.key(), (*it).toInt32());
1126 }
1127
1128 if (ok != 0) *ok = true;
1129
1130 return result;
1131 }

References TQT_DBusData::Int32.

◆ toInt64Map()

template<typename T >
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.

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 value type TQT_DBusData::Int64)
Returns
a TQMap of TQ_INT64 containing the map object's signed 64-bit integer values or an empty map when converting fails
See also
TQT_DBusData::toInt64()

Definition at line 1189 of file tqdbusdatamap.h.

1190 {
1192 {
1193 if (ok != 0) *ok = false;
1194 return TQMap<T, TQ_INT64>();
1195 }
1196
1197 TQMap<T, TQ_INT64> result;
1198
1199 const_iterator it = begin();
1200 const_iterator endIt = end();
1201 for (; it != endIt; ++it)
1202 {
1203 result.insert(it.key(), (*it).toInt64());
1204 }
1205
1206 if (ok != 0) *ok = true;
1207
1208 return result;
1209 }

References TQT_DBusData::Int64.

◆ toObjectPathMap()

template<typename T >
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.

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 value type TQT_DBusData::ObjectPath)
Returns
a TQMap of object paths containing the map object's object path values or an empty map when converting fails
See also
TQT_DBusData::toObjectPath()

Definition at line 1339 of file tqdbusdatamap.h.

1340 {
1342 {
1343 if (ok != 0) *ok = false;
1344 return TQMap<T, TQT_DBusObjectPath>();
1345 }
1346
1347 TQMap<T, TQT_DBusObjectPath> result;
1348
1349 const_iterator it = begin();
1350 const_iterator endIt = end();
1351 for (; it != endIt; ++it)
1352 {
1353 result.insert(it.key(), (*it).toObjectPath());
1354 }
1355
1356 if (ok != 0) *ok = true;
1357
1358 return result;
1359 }

References TQT_DBusData::ObjectPath.

◆ toStringMap()

template<typename T >
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().

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 value type TQT_DBusData::String)
Returns
a TQMap of TQString containing the map object's string values or an empty map when converting fails
See also
TQT_DBusData::toString()

Definition at line 1304 of file tqdbusdatamap.h.

1305 {
1307 {
1308 if (ok != 0) *ok = false;
1309 return TQMap<T, TQString>();
1310 }
1311
1312 TQMap<T, TQString> result;
1313
1314 const_iterator it = begin();
1315 const_iterator endIt = end();
1316 for (; it != endIt; ++it)
1317 {
1318 result.insert(it.key(), (*it).toString());
1319 }
1320
1321 if (ok != 0) *ok = true;
1322
1323 return result;
1324 }

References TQT_DBusData::String.

◆ toTQMap()

template<typename T >
TQMap< T, TQT_DBusData > TQT_DBusDataMap< T >::toTQMap ( ) const
inline

Converts the map object into a TQMap with TQT_DBusData elements.

Returns
the key/value pairs of the map object as a TQMap

Definition at line 938 of file tqdbusdatamap.h.

938{ return *this; }

◆ toUInt16Map()

template<typename T >
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.

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 value type TQT_DBusData::UInt16)
Returns
a TQMap of TQ_UINT16 containing the map object's unsigned 16-bit integer values or an empty map when converting fails
See also
TQT_DBusData::toUInt16()

Definition at line 1072 of file tqdbusdatamap.h.

1073 {
1075 {
1076 if (ok != 0) *ok = false;
1077 return TQMap<T, TQ_UINT16>();
1078 }
1079
1080 TQMap<T, TQ_UINT16> result;
1081
1082 const_iterator it = begin();
1083 const_iterator endIt = end();
1084 for (; it != endIt; ++it)
1085 {
1086 result.insert(it.key(), (*it).toUInt16());
1087 }
1088
1089 if (ok != 0) *ok = true;
1090
1091 return result;
1092 }

References TQT_DBusData::UInt16.

◆ toUInt32Map()

template<typename T >
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.

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 value type TQT_DBusData::UInt32)
Returns
a TQMap of TQ_UINT32 containing the map object's unsigned 32-bit integer values or an empty map when converting fails
See also
TQT_DBusData::toUInt32()

Definition at line 1150 of file tqdbusdatamap.h.

1151 {
1153 {
1154 if (ok != 0) *ok = false;
1155 return TQMap<T, TQ_UINT32>();
1156 }
1157
1158 TQMap<T, TQ_UINT32> result;
1159
1160 const_iterator it = begin();
1161 const_iterator endIt = end();
1162 for (; it != endIt; ++it)
1163 {
1164 result.insert(it.key(), (*it).toUInt32());
1165 }
1166
1167 if (ok != 0) *ok = true;
1168
1169 return result;
1170 }

References TQT_DBusData::UInt32.

◆ toUInt64Map()

template<typename T >
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.

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 value type TQT_DBusData::UInt64)
Returns
a TQMap of TQ_UINT64 containing the map object's unsigned 64-bit integer values or an empty map when converting fails
See also
TQT_DBusData::toUInt64()

Definition at line 1228 of file tqdbusdatamap.h.

1229 {
1231 {
1232 if (ok != 0) *ok = false;
1233 return TQMap<T, TQ_UINT64>();
1234 }
1235
1236 TQMap<T, TQ_UINT64> result;
1237
1238 const_iterator it = begin();
1239 const_iterator endIt = end();
1240 for (; it != endIt; ++it)
1241 {
1242 result.insert(it.key(), (*it).toUInt64());
1243 }
1244
1245 if (ok != 0) *ok = true;
1246
1247 return result;
1248 }

References TQT_DBusData::UInt64.

◆ toUnixFdMap()

template<typename T >
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.

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 value type TQT_DBusData::UnixFd)
Returns
a TQMap of TQT_DBusUnixFd containing the map object's TQT_DBusUnixFd values or an empty map when converting fails
See also
TQT_DBusData::toUnixFd()

Definition at line 1374 of file tqdbusdatamap.h.

1375 {
1377 {
1378 if (ok != 0) *ok = false;
1379 return TQMap<T, TQT_DBusUnixFd>();
1380 }
1381
1382 TQMap<T, TQT_DBusUnixFd> result;
1383
1384 const_iterator it = begin();
1385 const_iterator endIt = end();
1386 for (; it != endIt; ++it)
1387 {
1388 result.insert(it.key(), (*it).toUnixFd());
1389 }
1390
1391 if (ok != 0) *ok = true;
1392
1393 return result;
1394 }

References TQT_DBusData::UnixFd.

◆ toVariantMap()

template<typename T >
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.

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 value type TQT_DBusData::Variant)
Returns
a TQMap of TQT_DBusVariant containing the map object's TQT_DBusVariant values or an empty map when converting fails
See also
TQT_DBusData::toVariant()

Definition at line 1412 of file tqdbusdatamap.h.

1413 {
1415 {
1416 if (ok != 0) *ok = false;
1417 return TQMap<T, TQT_DBusVariant>();
1418 }
1419
1420 TQMap<T, TQT_DBusVariant> result;
1421
1422 const_iterator it = begin();
1423 const_iterator endIt = end();
1424 for (; it != endIt; ++it)
1425 {
1426 result.insert(it.key(), (*it).toVariant());
1427 }
1428
1429 if (ok != 0) *ok = true;
1430
1431 return result;
1432 }

References TQT_DBusData::Variant.

◆ valueType()

template<typename T >
TQT_DBusData::Type TQT_DBusDataMap< T >::valueType ( ) const
inline

Returns the value type of the map object.

Returns
one of the values of the TQT_DBusData::Type enum
See also
hasContainerValueType()
containerValueType()
keyType()

Definition at line 746 of file tqdbusdatamap.h.

746{ return m_valueType; }
+ Here is the caller graph for this function:

Friends And Related Symbol Documentation

◆ TQT_DBusData

template<typename T >
friend class TQT_DBusData
friend

Definition at line 75 of file tqdbusdatamap.h.

Member Data Documentation

◆ m_containerValueType

template<typename T >
TQT_DBusData TQT_DBusDataMap< T >::m_containerValueType
private

Definition at line 1436 of file tqdbusdatamap.h.

◆ m_keyType

template<typename T >
const TQT_DBusData::Type TQT_DBusDataMap< T >::m_keyType
staticprivate

Definition at line 1438 of file tqdbusdatamap.h.

◆ m_valueType

template<typename T >
TQT_DBusData::Type TQT_DBusDataMap< T >::m_valueType
private

Definition at line 1435 of file tqdbusdatamap.h.


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