Public Member Functions

# HDevicesSetupData Class Reference
[Device Model]

This class is used to specify information that can be used to setup multiple HDevice instances. More...

`#include <HDevicesSetupData>`

List of all members.

## Public Member Functions
| HDevicesSetupData ()
| ~HDevicesSetupData ()
bool | contains (const HResourceType &deviceType) const
QSet< HResourceType > | deviceTypes () const
HDeviceSetup * | get (const HResourceType &type) const
bool | isEmpty () const
qint32 | size () const
bool | insert (HDeviceSetup *newItem)
bool | remove (const HResourceType &type)
bool | setDevice (const HResourceType &type, HDevice *device)
HDeviceSetup * | take (const HResourceType &type)

## Detailed Description

Remarks:
  this class is not thread-safe.

See also:
  HDeviceSetup, HDevice

## Constructor & Destructor Documentation

HDevicesSetupData | ( |  | ) |

Creates a new, empty instance.

See also:
  isEmpty()

~HDevicesSetupData | ( |  | ) |

Destroys the instance.

## Member Function Documentation

bool contains | ( | const HResourceType & | deviceType | ) | const

Indicates if the instance contains an item with the specified device type.

Parameters:

  | deviceType | specifies the device type of the searched item.

Returns:
  true when the instance contains an item with the specified device type.

See also:
  get()

QSet< HResourceType > deviceTypes | ( |  | ) | const

Returns the device types of the contained items.

Returns:
  the device types of the contained items.

HDeviceSetup * get | ( | const HResourceType & | type | ) | const

Retrieves an item.

Parameters:

  | type | specifies the device type of the item.

Returns:
  the item with the specified device type. A null pointer is returned in case no item with the specified device type was found.

Remarks:
  the ownership of the object is not transferred.

See also:
  take(), contains()

bool isEmpty | ( |  | ) | const

Indicates if the object is empty.

Returns:
  true in case the instance has no items.

qint32 size | ( |  | ) | const

Returns the number of contained items.

Returns:
  the number of contained items.

bool insert | ( | HDeviceSetup * | newItem | ) |

Inserts a new item.

Parameters:

  | newItem | specifies the item to be added.

Returns:
  true in case the item was added. The `newItem` will not be added if the instance already contains an item that has the same HDeviceSetup::deviceType() as the `newItem` or the `newItem` is null.

Remarks:
  - The `newItem` has to be heap-allocated and
  - the instance takes the ownership of the `newItem`, even if it is not added. If the item is not added the item is deleted.

bool remove | ( | const HResourceType & | type | ) |

Removes an existing item.

Parameters:

  | type | specifies the device type of the item to be removed.

Returns:
  true in case the item was found and removed.

bool setDevice | ( | const HResourceType & | type,
|  | HDevice * | device |
| ) |  |  |

Associates an HDevice pointer with an item.

Parameters:

  | type | specifies the device type of the item.
  | device | specifies the device to be associated. This instance takes the ownership of the HDevice.

Returns:
  true when an item with the specified service ID was found and the provided HDevice pointer was associated with it. Note also that the pointer can be null.

Remarks:
  if an item with the specified device type exists and it already has an HDevice pointer associated with it, the existing HDevice is deleted.

HDeviceSetup * take | ( | const HResourceType & | type | ) |

Retrieves an item and removes it from the instance.

Parameters:

  | type | specifies the device type of the item.

Returns:
  the item with the specified device type. A null pointer is returned in case no item with the specified device type was found.

Remarks:
  the ownership of the object is transferred to the caller.

See also:
  get()