| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- #ifndef IMPORTPROXY_H
- #define IMPORTPROXY_H
- #include <QtCore>
- #include "numberlistmodel.h"
- #include "snccore.h"
- #include "SNCCore_global.h"
- #include "importconsumer.h"
- #include "importproducer.h"
- #include "numberbuilder.h"
- class SNCCORESHARED_EXPORT ImportProxy : public QThread
- {
- Q_OBJECT
- public:
- explicit ImportProxy(NumberListModel *oldModel);
- ~ImportProxy();
- void setFetchList(QStringList list);
- void setBuildType(NumberBuildType buildType);
- signals:
- void progressMaxUpdated(int max);
- void progressUpdated(int i);
- void numberBuilt(NumberListModel *newModel);
- void threadAborted();
- protected:
- void run();
- private:
- void appendModel();
- void setFetchMaxSize();
- private:
- int counter;
- bool stop;
- int batchSize;
- QMutex mutex;
- QStringList fetchList;
- QStringList segments;
- QList<QStringList> numbers;
- NumberListModel *oldModel;
- NumberListModel *newModel;
- QList<QStringList> *buffer;
- QMutex *mutex2;
- int resAvailable;
- int all_file_size;
- int current_file_size;
- bool readFinished;
- NumberBuildType buildType;
- int step1Progress;
- int step2Progress;
- int threadAlive;
- int threadDead;
- int bufferTakedTimes;
- int bufferAppendedTimes;
- public slots:
- void onChildTaskFinished(QStringList segments,QList<QStringList> numbers);
- void abort();
- void onProduced(int strSize);
- void onProducerFinished();
- void onThreadDestroy();
- void onBufferAppended();
- void onBufferTaked();
-
- };
- #endif // IMPORTPROXY_H
|