Class that represents a UPnP state variable. More...
#include <HStateVariable>
Signals | |
void | valueChanged (const Herqq::Upnp::HStateVariableEvent &event) |
Public Member Functions | |
virtual | ~HStateVariable ()=0 |
HService * | parentService () const |
QVariant | value () const |
const HStateVariableInfo & | info () const |
HWritableStateVariable * | writable () |
HReadableStateVariable * | readable () |
HStateVariable
is a core component of the HUPnP Device Model and it models a UPnP state variable. The UPnP Device Architecture specifies a UPnP state variable as an item or aspect that models state in a service. In a way, a UPnP state variable is an abstraction to a member variable, since it is always contained within a UPnP service.
A state variable can be evented in which case it notifies interested listeners of changes in its value. You can see if a state variable is evented by checking the HStateVariableInfo object using info() and you can connect to the signal valueChanged() to be notified when the value of the state variable changes. Note, only evented state variables emit the valueChanged() signal.
QObject
base class is largely not. However, the signal valueChanged() has thread affinity and any connections to it must be done in the thread where the instance of HStateVariable resides. ~HStateVariable | ( | ) | [pure virtual] |
Destroys the instance.
An HStateVariable
is always destroyed by the containing HService when it is being deleted. You should never destroy an HStateVariable
.
HService * parentService | ( | ) | const |
QVariant value | ( | ) | const |
Returns the value of the state variable.
const HStateVariableInfo & info | ( | ) | const |
Returns information about the state variable that is read from the service description.
HWritableStateVariable * writable | ( | ) |
Attempts to cast the instance to HWritableStateVariable.
This is a helper method for performing a dynamic cast.
HReadableStateVariable * readable | ( | ) |
Attempts to cast the instance to HReadableStateVariable.
This is a helper method for performing a dynamic cast.
void valueChanged | ( | const Herqq::Upnp::HStateVariableEvent & | event | ) | [signal] |
This signal is emitted when the value of the state variable has changed.
event | specifies information about the event that occurred. |