Public Member Functions

# HStateVariablesSetupData Class Reference
[Device Model]

This class is used to specify information that is required to setup the `HStateVariables` of an HService. More...

`#include <HStateVariablesSetupData>`

List of all members.

## Public Member Functions
| HStateVariablesSetupData (DefaultInclusionPolicy defIncPol=Accept)
DefaultInclusionPolicy | defaultInclusionPolicy () const
bool | contains (const QString &name) const
HStateVariableInfo | get (const QString &name) const
bool | isEmpty () const
QSet< QString > | names () const
qint32 | size () const
bool | insert (const HStateVariableInfo &newItem)
bool | remove (const QString &name)
bool | setInclusionRequirement (const QString &name, HInclusionRequirement incReq)

## Detailed Description

Remarks:
  this class is not thread-safe.

## Member Enumeration Documentation

enum DefaultInclusionPolicy

This enumeration specifies the actions the HUPnP device model builder should take when it encounters an unknown state variable definition in a service description file.

Enumerator:

  Accept | The unknown state variable will be accepted.
  Deny | The unknown state variable will be rejected, which will abort the build of a device tree in case such a state variable is encountered.

## Constructor & Destructor Documentation

HStateVariablesSetupData | ( | DefaultInclusionPolicy | defIncPol = `Accept` | ) |

Creates a new, empty instance.

Parameters:

  | defIncPol | specifies the default inclusion policy for state variables that are not contained in this instance.

See also:
  isEmpty(), defaultInclusionPolicy()

## Member Function Documentation

HStateVariablesSetupData::DefaultInclusionPolicy defaultInclusionPolicy | ( |  | ) | const

Returns the default inclusion policy.

The default inclusion policy specifies the action to take when a state variable definition in a service description file does not map to any HStateVariableInfo object contained within this instance.

Returns:
  the default inclusion policy.

bool contains | ( | const QString & | name | ) | const

Indicates if the instance contains an item that has the specified name.

Parameters:

  | name | specifies the name of the item.

Returns:
  true when the instance contains an item that has the specified name.

See also:
  get(), isEmpty()

HStateVariableInfo get | ( | const QString & | name | ) | const

Retrieves an item.

Parameters:

  | name | specifies the name of the item to be retrieved.

Returns:
  the item with the specified name. Note that the returned item is invalid, i.e. HStateVariableInfo::isValid() returns false in case no item with the specified name was found.

See also:
  contains(), isEmpty()

bool isEmpty | ( |  | ) | const

Indicates if the object is empty.

Returns:
  true in case the instance has no items.

QSet< QString > names | ( |  | ) | const

Returns the names of the contained items.

Returns:
  the names of the contained items.

qint32 size | ( |  | ) | const

Returns the number of contained items.

Returns:
  the number of contained items.

bool insert | ( | const HStateVariableInfo & | newItem | ) |

Inserts a new item.

Parameters:

  | newItem | specifies the item to be added.

Returns:
  true in case the item was added. The item will not be added if the instance already contains an item that has the same name as the `newItem`.

See also:
  remove()

bool remove | ( | const QString & | name | ) |

Removes an existing item.

Parameters:

  | name | specifies the name of the item to be removed.

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

See also:
  insert()

bool setInclusionRequirement | ( | const QString & | name,
|  | HInclusionRequirement | incReq |
| ) |  |  |

Sets the inclusion requirement element of an item.

Parameters:

  | name | specifies the name of the item.
  | incReq | specifies the inclusion requirement value.

Returns:
  true when the item was found and the inclusion requirement element was set.