This class is used to specify one or more device configurations to an HDeviceHost instance and to configure the functionality of the HDeviceHost that affect every hosted HServerDevice. More...
#include <HDeviceHostConfiguration>
The initialization of an HDeviceHost requires a valid host configuration. A valid host configuration contains at least one device configuration and a device model creator, as otherwise the host would have nothing to do and no means to create UPnP device and service objects.
The initialization of an HDeviceHost follows roughly these steps:
Besides specifying the device configurations, you can configure an HDeviceHost in following ways:
HDeviceHostConfiguration | ( | const HDeviceConfiguration & | arg ) |
~HDeviceHostConfiguration | ( | ) | [virtual] |
Destroys the instance.
void doClone | ( | HClonable * | target ) | const [protected, virtual] |
Clones the contents of this to the target
object.
Every derived class has to override this method. Further, the implementation should be something along these lines:
void MyClonable::doClone(HClonable* target) const { MyClonable* myClonable = dynamic_cast<MyClonable*>(target); if (!myClonable) { return; } BaseClassOfMyClonable::doClone(target); // copy the variables introduced in *this* MyClonable // instance to "myClonable". }
target | specifies the target object to which the contents of this instance are cloned. |
Reimplemented from HClonable.
HDeviceHostConfiguration * newInstance | ( | ) | const [protected, virtual] |
Creates a new instance.
This method is used as part of object cloning. Because of that, it is important that every descendant class overrides this method:
MyClonable* MyClonable::newInstance() const { return new MyClonable(); }
Implements HClonable.
HDeviceHostConfiguration * clone | ( | ) | const [virtual] |
Returns a deep copy of the instance.
Reimplemented from HClonable.
bool add | ( | const HDeviceConfiguration & | deviceConfiguration ) |
Adds a device configuration.
deviceConfiguration | specifies the device configuration to be added. The configuration is added only if it is valid, see HDeviceConfiguration::isValid(). |
void clear | ( | ) |
Removes device configurations.
QList< const HDeviceConfiguration * > deviceConfigurations | ( | ) | const |
Returns the currently stored device configurations.
qint32 individualAdvertisementCount | ( | ) | const |
Indicates how many times the device host sends each individual advertisement / announcement.
The default value is 2.
QList< QHostAddress > networkAddressesToUse | ( | ) | const |
Returns the network addresses a device host should use in its operations.
qint32 subscriptionExpirationTimeout | ( | ) | const |
Returns the timeout the device host uses for subscriptions.
The default value is zero, which means that the device host honors the timeouts requested by control points up to a day. Larger values are set to a day.
HDeviceModelCreator * deviceModelCreator | ( | ) | const |
Returns the device model creator the HDeviceHost should use to create HServerDevice instances.
HDeviceModelInfoProvider * deviceModelInfoProvider | ( | ) | const |
Returns the device model info provider the HDeviceHost should use to validate device model components.
void setDeviceModelCreator | ( | const HDeviceModelCreator & | creator ) |
Sets the device model creator the HDeviceHost should use to create HServerDevice instances.
creator | specifies the device model creator the HDeviceHost should use to create HServerDevice instances. |
void setDeviceModelInfoProvider | ( | const HDeviceModelInfoProvider & | infoProvider ) |
Sets the device model info provider the HDeviceHost should use to validate device model components.
infoProvider | specifies the device model info provider the HDeviceHost should use to validate device model components. |
void setIndividualAdvertisementCount | ( | qint32 | count ) |
Specifies how many times the device host sends each individual advertisement / announcement.
By default, each advertisement is sent twice.
count | specifies how many times the device host sends each individual advertisement / announcement. If the provided value is smaller than 1 the advertisement count is set to 1. |
void setSubscriptionExpirationTimeout | ( | qint32 | timeout ) |
Specifies the timeout the device host uses for subscriptions.
The default value is zero, which means that the device host honors the timeouts requested by control points.
timeout | specifies the desired timeout in seconds.
|
bool setNetworkAddressesToUse | ( | const QList< QHostAddress > & | addresses ) |
Defines the network addresses the device host should use in its operations.
addresses | specifies the network addresses the device host should use in its operations. |
bool isEmpty | ( | ) | const |
Indicates if the instance contains any device configurations.
bool isValid | ( | ) | const |
Indicates if the object is valid, i.e it can be used to initialize an HDeviceHost instance.