Download h source code

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#ifndef GOLDBACHTESTER_H
#define GOLDBACHTESTER_H

#include <QCoreApplication>
#include <QFileInfo>
#include <QMap>

class GoldbachModel;
class QFileInfo;

class GoldbachTester : public QCoreApplication
{
    Q_OBJECT
    Q_DISABLE_COPY(GoldbachTester)

  protected:
    QMap<GoldbachModel*, QFileInfo> models;
    int finishedModelCount = 0;

  public:
    explicit GoldbachTester(int &argc, char **argv);
    int run();
    int testDirectory(const QString& dirPath);
    static int printHelp();
    int testFile(const QFileInfo& fileInfo);
    int testContents(long long number, const QFileInfo& fileInfo);
    bool compareContents(GoldbachModel* goldbachModel, const QFileInfo& fileInfo);
    static QVector<QString> loadLines(const QFileInfo& fileInfo);

  protected slots:
    void modelFinished(long long sumCount);
};

#endif // GOLDBACHTESTER_H