The private implementation of Property. More...
#include <ContextProvider>
Signals | |
void | valueChanged (const QVariantList &values, const quint64 ×tamp) |
void | firstSubscriberAppeared (const QString &key) |
void | lastSubscriberDisappeared (const QString &key) |
Public Member Functions | |
PropertyPrivate (ServiceBackend *serviceBackend, const QString &key, QObject *parent=0) | |
Constructor. | |
void | setValue (const QVariant &v) |
Set value for the PropertyPrivate. | |
void | updateOverheardValue (const QVariantList &, const quint64 &) |
Called by PropertyAdaptor when it has overheard another provider sending a value on D-Bus. | |
void | setSubscribed () |
Set the PropertyPrivate to subscribed state. | |
void | setUnsubscribed () |
Set the PropertyPrivate to unsubscribed state. | |
Friends | |
class | Property |
class | PropertyAdaptor |
The private implementation of Property.
For each (ServiceBackend*, key) pair there exists only one PropertyPrivate; multiple Property objects may share it.
ContextProvider::PropertyPrivate::PropertyPrivate | ( | ServiceBackend * | serviceBackend, | |
const QString & | key, | |||
QObject * | parent = 0 | |||
) | [explicit] |
Constructor.
Register the PropertyPrivate to its ServiceBackend; this will make the Property object appear on D-Bus.
void ContextProvider::PropertyPrivate::firstSubscriberAppeared | ( | const QString & | key | ) | [signal] |
void ContextProvider::PropertyPrivate::lastSubscriberDisappeared | ( | const QString & | key | ) | [signal] |
void ContextProvider::PropertyPrivate::setSubscribed | ( | ) |
Set the PropertyPrivate to subscribed state.
If it was in the unsubscribed state, the firstSubscriberAppeared signal is emitted. (Property transmits the signal forward.)
void ContextProvider::PropertyPrivate::setUnsubscribed | ( | ) |
Set the PropertyPrivate to unsubscribed state.
If it was in the subscribed state, the lastSubscriberDisappeared signal is emitted. (Property transmits the signal forward.)
void ContextProvider::PropertyPrivate::setValue | ( | const QVariant & | v | ) |
Set value for the PropertyPrivate.
Results in a valueChanged signal emission, if 1) the value was different than the current value of the PropertyPrivate, or 2) The provider has overheard another provider setting a different value having a more recent time stamp than our last emission.
void ContextProvider::PropertyPrivate::updateOverheardValue | ( | const QVariantList & | v, | |
const quint64 & | t | |||
) |
Called by PropertyAdaptor when it has overheard another provider sending a value on D-Bus.
Check if the value is different and more recent than the value we've emitted last. If so, emit our value again. This way we ensure that the client gets the correct time stamp for our value.
void ContextProvider::PropertyPrivate::valueChanged | ( | const QVariantList & | values, | |
const quint64 & | timestamp | |||
) | [signal] |
friend class Property [friend] |
friend class PropertyAdaptor [friend] |