numberprocessor.h 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. #ifndef NUMBERPROCESSOR_H
  2. #define NUMBERPROCESSOR_H
  3. #include <QtCore>
  4. #include "snccore.h"
  5. class NumberProcessor : public QThread
  6. {
  7. Q_OBJECT
  8. public:
  9. NumberProcessor(QList<QString> *bufferSegment,QList<QStringList> *bufferNumbers,
  10. QSemaphore *free,QSemaphore *used,QMutex *mutex,NumberProcessType processType);
  11. ~NumberProcessor();
  12. void setBlackSegments(QStringList blackSegments);
  13. void setBlackNumbers(QList<QStringList> blackNumbers);
  14. void abort();
  15. signals:
  16. void childTaskFinished(QString segment,QStringList numbers);
  17. void threadDestroy();
  18. protected:
  19. void run();
  20. private:
  21. void sort();
  22. void removeDuplicate();
  23. void removeBlackList();
  24. void removeNotPhoneNumber();
  25. private:
  26. QList<QStringList> blackNumbers;
  27. QStringList blackSegments;
  28. NumberProcessType processType;
  29. bool stop;
  30. QList<QString> *bufferSegments;
  31. QList<QStringList> *bufferNumbers;
  32. QSemaphore *free;
  33. QSemaphore *used;
  34. QMutex *mutex;
  35. };
  36. #endif // NUMBERPROCESSOR_H