A class that is used at client-side to represent a UPnP device. More...
#include <HDeviceProxy>
Public Member Functions | |
HDeviceProxy () | |
virtual | ~HDeviceProxy () |
HDeviceProxy * | parentProxyDevice () const |
HDeviceProxy * | rootProxyDevice () const |
HServiceProxy * | serviceProxyById (const HServiceId &serviceId) const |
HDeviceProxies | embeddedProxyDevices () const |
HServiceProxies | serviceProxies () const |
HServiceProxies | serviceProxiesByType (const HResourceType &serviceType, HResourceType::VersionMatch versionMatch=HResourceType::InclusiveVersionMatch) const |
Private Member Functions | |
virtual HServicesSetupData * | createServices () |
A proxy device is a pure client-side concept utilized by HControlPoint. This class, or a class derived from this is instantiated by HControlPoint for each discovered UPnP device that is added into the control of an HControlPoint
.
As an HDevice, the HDeviceProxy
relies fully on the HUPnP Device Model and thus it is used similarly to server-side HDevice
classes. Unlike the HDevice
at server-side, however, the HDeviceProxy
at client-side is usually only responsible of providing helper methods for accessing the server side.
As HControlPoint allows the creation and use of custom HDeviceProxy
types, you can use the HDeviceProxy
as a base for more refined proxies that could provide more fine-grained APIs to communicate with a particular device type. For instance, if there is a UPnP device type you would like to use from the client side using a statically typed API, you could create a class derived from the HDeviceProxy
. This class would provide the desired API hiding all the things relating to action invocation and converting state variable notifications to Qt signals.
HDeviceProxy
often means that you should create custom HServiceProxy classes as well. In that case you should override the createServices() method and instantiate the desired HServiceProxy
types there.QObject
base class is largely not.HDeviceProxy | ( | ) |
Creates a new instance.
~HDeviceProxy | ( | ) | [virtual] |
Destroys the instance.
HServicesSetupData * createServices | ( | ) | [private, virtual] |
HDeviceProxy
provides default implementation for this, but if you want to associate specific HServiceProxy types with this HDeviceProxy
type you have to override this method.
Reimplemented from HDevice.
HDeviceProxy * parentProxyDevice | ( | ) | const |
Returns the parent device proxy of this device.
This is a helper method that returns the parent HDevice of this device statically cast to HDeviceProxy.
HDeviceProxy * rootProxyDevice | ( | ) | const |
Returns the root device proxy of this device tree.
This is a helper method that returns the root HDevice of this device tree statically cast to HDeviceProxy.
HServiceProxy * serviceProxyById | ( | const HServiceId & | serviceId | ) | const |
Returns a service proxy that matches the provided service ID.
This is a helper method that returns the a HService matching the specified serviceID statically cast to HServiceProxy.
serviceId | specifies the service to be returned. |
HDeviceProxies embeddedProxyDevices | ( | ) | const |
Returns the embedded device proxies of this device.
This is a helper method that returns the embedded HDevice instances of this device statically cast to HDeviceProxy instances.
HServiceProxies serviceProxies | ( | ) | const |
Returns service proxies of this device.
This is a helper method that returns HService instances of this device statically cast to HServiceProxy instances.
HServiceProxies serviceProxiesByType | ( | const HResourceType & | serviceType, | |
HResourceType::VersionMatch | versionMatch = HResourceType::InclusiveVersionMatch | |||
) | const |
Returns service proxies of this device.
This is a helper method that returns HService instances of this device statically cast to HServiceProxy instances.
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. |