| 12345678910111213141516171819202122232425262728293031323334353637 |
- #ifndef NUMBERPROCESSOR_H
- #define NUMBERPROCESSOR_H
- #include <QtCore>
- #include "snccore.h"
- class NumberProcessor : public QThread
- {
- Q_OBJECT
- public:
- NumberProcessor(QList<QString> *bufferSegment,QList<QStringList> *bufferNumbers,
- QSemaphore *free,QSemaphore *used,QMutex *mutex,NumberProcessType processType);
- ~NumberProcessor();
- void setBlackSegments(QStringList blackSegments);
- void setBlackNumbers(QList<QStringList> blackNumbers);
- void abort();
- signals:
- void childTaskFinished(QString segment,QStringList numbers);
- void threadDestroy();
- protected:
- void run();
- private:
- void sort();
- void removeDuplicate();
- void removeBlackList();
- void removeNotPhoneNumber();
- private:
- QList<QStringList> blackNumbers;
- QStringList blackSegments;
- NumberProcessType processType;
- bool stop;
- QList<QString> *bufferSegments;
- QList<QStringList> *bufferNumbers;
- QSemaphore *free;
- QSemaphore *used;
- QMutex *mutex;
- };
- #endif // NUMBERPROCESSOR_H
|