Public Member Functions

# HServicesSetupData Class Reference
[Device Model]

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

`#include <HServicesSetupData>`

List of all members.

## Public Member Functions
| HServicesSetupData ()
| ~HServicesSetupData ()
HServiceSetup * | get (const HServiceId &id) const
bool | contains (const HServiceId &id) const
bool | isEmpty () const
qint32 | size () const
QSet< HServiceId > | serviceIds () const
bool | insert (HServiceSetup *newItem)
bool | remove (const HServiceId &id)
bool | setService (const HServiceId &id, HService *service)
HServiceSetup * | take (const HServiceId &id)

## Detailed Description

Remarks:
  this class is not thread-safe.

## Constructor & Destructor Documentation

HServicesSetupData | ( |  | ) |

Creates a new, empty instance.

See also:
  isEmpty()

~HServicesSetupData | ( |  | ) |

Destroys the instance.

## Member Function Documentation

HServiceSetup * get | ( | const HServiceId & | id | ) | const

Retrieves a service setup object.

Parameters:

  | id | specifies the service ID of the item.

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

Remarks:
  the ownership of the object is not transferred.

See also:
  take(), contains()

bool contains | ( | const HServiceId & | id | ) | const

Indicates if the instance contains a service setup item that has the specified service ID.

Parameters:

  | id | specifies the service ID of the item.

Returns:
  true when the instance contains an item with the specified service ID.

See also:
  get()

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.

QSet< HServiceId > serviceIds | ( |  | ) | const

Returns the service IDs of the contained items.

Returns:
  the service IDs of the contained items.

bool insert | ( | HServiceSetup * | 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 HServiceId & | id | ) |

Removes an existing item.

Parameters:

  | id | specifies the service ID of the item to be removed.

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

bool setService | ( | const HServiceId & | id,
|  | HService * | service |
| ) |  |  |

Associates an HService pointer with an item.

Parameters:

  | id | specifies the service ID of the item.
  | service | specifies a heap-allocated pointer to an HService to be associated with the item. Note that the item takes the ownership of the HService.

Returns:
  true when an item with the specified service ID was found and the provided HService pointer was associated with it.

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

HServiceSetup * take | ( | const HServiceId & | id | ) |

Retrieves a service setup object and removes it from the instance.

Parameters:

  | id | specifies the service ID of the item.

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

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

See also:
  get()