• Main Page
  • Related Pages
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

propertyprivate.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (C) 2008 Nokia Corporation.
00003  *
00004  * Contact: Marius Vollmer <marius.vollmer@nokia.com>
00005  *
00006  * This library is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU Lesser General Public License
00008  * version 2.1 as published by the Free Software Foundation.
00009  *
00010  * This library is distributed in the hope that it will be useful, but
00011  * WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
00013  * Lesser General Public License for more details.
00014  *
00015  * You should have received a copy of the GNU Lesser General Public
00016  * License along with this library; if not, write to the Free Software
00017  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
00018  * 02110-1301 USA
00019  *
00020  */
00021 
00022 #ifndef PROPERTYPRIVATE_H
00023 #define PROPERTYPRIVATE_H
00024 
00025 #include <QObject>
00026 #include <QString>
00027 #include <QVariant>
00028 #include <QPair>
00029 
00030 namespace ContextProvider {
00031 
00032 class ServiceBackend;
00033 class Property;
00034 
00035 class PropertyPrivate : public QObject
00036 {
00037     Q_OBJECT
00038 
00039 public:
00040     explicit PropertyPrivate(ServiceBackend* serviceBackend, const QString &key, QObject *parent = 0);
00041 
00042     void setValue(const QVariant& v);
00043     void updateOverheardValue(const QVariantList&, const quint64&);
00044     void setSubscribed();
00045     void setUnsubscribed();
00046 
00047 Q_SIGNALS:
00048     void valueChanged(const QVariantList& values, const quint64& timestamp);
00049     void firstSubscriberAppeared(const QString& key);
00050     void lastSubscriberDisappeared(const QString& key);
00051 
00052 private:
00053     static quint64 currentTimestamp();
00054     void emitValue();
00055 
00056     int refCount; 
00057     ServiceBackend* serviceBackend; 
00058     QString key; 
00059     QVariant value; 
00060     quint64 timestamp; 
00061 
00062     bool subscribed; 
00063     QVariant emittedValue; 
00064     quint64 emittedTimestamp; 
00065     bool overheard; 
00066 
00068     static QHash<QPair<ServiceBackend*, QString>, PropertyPrivate*> propertyPrivateMap;
00069 
00070     friend class Property;
00071     friend class PropertyAdaptor;
00072 };
00073 
00074 } // end namespace
00075 
00076 #endif

Generated on Sun Jun 1 2014 17:31:06 for libcontextprovider by  doxygen 1.7.1