QXRD  0.11.16
qxrdresultserializer.h
Go to the documentation of this file.
1 #ifndef QXRDRESULTSERIALIZER_H
2 #define QXRDRESULTSERIALIZER_H
3 
4 #include "qcepmacros.h"
5 #include "qcepproperty.h"
6 #include "qcepobject.h"
7 #include <QMutex>
8 #include <QMutexLocker>
9 #include <QFuture>
10 #include <QQueue>
11 #include <QFutureWatcher>
12 
14 {
15  Q_OBJECT
16 public:
18  virtual ~QxrdResultSerializerBase();
19 
20 signals:
21  void resultAvailable();
22 
23 protected:
24  mutable QMutex m_Mutex;
25 };
26 
27 template <typename T>
29 {
30 public:
31  explicit QxrdResultSerializer(QcepIntProperty *ctr, QcepObject *parent);
32 
33  void enqueue(QFuture<T> future);
34  T dequeue();
35 
36  int count() const;
37 
38 public slots:
39 
40 private:
41  QQueue< QFuture<T> > m_Results;
42  QFutureWatcher<T> m_Watcher;
44 };
45 
46 #endif // QXRDRESULTSERIALIZER_H
QQueue< QFuture< T > > m_Results
QxrdResultSerializer(QcepIntProperty *ctr, QcepObject *parent)
void enqueue(QFuture< T > future)
QxrdResultSerializerBase(QcepObject *parent)
QFutureWatcher< T > m_Watcher
QcepIntProperty * m_Counter