Herqq
|
This is a client-side class that represents a server-side UPnP device. More...
#include <HClientDevice>
Inherited by HDefaultClientDevice.
Public Member Functions | |
virtual | ~HClientDevice ()=0 |
HClientDevice * | parentDevice () const |
HClientDevice * | rootDevice () const |
HClientService * | serviceById (const HServiceId &serviceId) const |
HClientServices | services () const |
HClientServices | servicesByType (const HResourceType &serviceType, HResourceType::VersionMatch versionMatch=HResourceType::Inclusive) const |
HClientDevices | embeddedDevices () const |
HClientDevices | embeddedDevicesByType (const HResourceType &deviceType, HResourceType::VersionMatch versionMatch=HResourceType::Inclusive) const |
const HDeviceInfo & | info () const |
QString | description () const |
QList< QUrl > | locations (LocationUrlType urlType=AbsoluteUrl) const |
Protected Member Functions | |
HClientDevice (const HDeviceInfo &info, HClientDevice *parentDev=0) |
This is a client-side class that represents a server-side UPnP device.
HClientDevice
is a core component of the HUPnP's client-side Device Model and it models a UPnP device, both root and embedded. As detailed in the UPnP Device Architecture specification, a UPnP device is essentially a container for services and possibly for other (embedded) UPnP devices.
The most common uses of HClientDevice
involve reading the various device information elements originally set in the device description file and enumerating the exposed services. By calling info() you get an HDeviceInfo object from which you can read all the informational elements found in the device description. Calling services() gives you a list of HClientService instances the device exposes. Note that it is the services that contain the functionality and runtime status of the device.
Some devices also contain embedded devices, which you can get by calling embeddedDevices().
You can retrieve the device's description file by calling description() or you can manually read it from any of the locations returned by locations(). If the device is an embedded device, it always has a parent device, which you can get by calling parentDevice().
HClientDevice | ( | const HDeviceInfo & | info, |
HClientDevice * | parentDev = 0 |
||
) | [protected] |
Creates a new instance.
info | specifies information of the device. This is often read from a device description document. |
parentDev | specifies the parent device of this device, if any. |
~HClientDevice | ( | ) | [pure virtual] |
Destroys the instance.
HClientDevice * parentDevice | ( | ) | const |
Returns the parent device of this device, if any.
HClientDevice * rootDevice | ( | ) | const |
Returns the root device of the device tree to which this device belongs.
HClientService * serviceById | ( | const HServiceId & | serviceId | ) | const |
Returns the service that has the specified service ID.
serviceId | specifies the service to be returned. |
HClientServices services | ( | ) | const |
Returns the services this device exports.
HClientServices servicesByType | ( | const HResourceType & | serviceType, |
HResourceType::VersionMatch | versionMatch = HResourceType::Inclusive |
||
) | const |
Returns the services of a specific UPnP service type.
serviceType | specifies the UPnP service type of interest. Only services matching the type are returned. |
versionMatch | specifies how the version information in argument serviceType should be used. The default is inclusive match, which essentially means that any service with a service type version that is less than or equal to the version specified in argument serviceType is successfully matched. |
HClientDevices embeddedDevices | ( | ) | const |
Returns the embedded devices of this device.
HClientDevices embeddedDevicesByType | ( | const HResourceType & | deviceType, |
HResourceType::VersionMatch | versionMatch = HResourceType::Inclusive |
||
) | const |
Returns the embedded devices of a specific UPnP device type.
deviceType | specifies the UPnP device type of interest. Only devices matching the type are returned. |
versionMatch | specifies how the version information in argument deviceType should be used. The default is inclusive match, which essentially means that any device with a device type version that is less than or equal to the version specified in argument deviceType is successfully matched. |
const HDeviceInfo & info | ( | ) | const |
Returns information about the device.
QString description | ( | ) | const |
Returns the UPnP device description of this device.
QList< QUrl > locations | ( | LocationUrlType | urlType = AbsoluteUrl | ) | const |
Returns a list of locations where the device is currently available.
urlType | specifies whether the returned location URLs are absolute URLs for retrieving the device description. By default absolute URLs are returned and from these URLs the device description should be retrievable. |