RedPanda-CPP/RedPandaIDE/compiler/ojproblemcasesrunner.h

30 lines
979 B
C
Raw Normal View History

2021-11-01 09:18:23 +08:00
#ifndef OJPROBLEMCASESRUNNER_H
#define OJPROBLEMCASESRUNNER_H
#include "runner.h"
#include <QVector>
2021-11-01 20:44:08 +08:00
#include "../problems/ojproblemset.h"
2021-11-01 09:18:23 +08:00
class OJProblemCasesRunner : public Runner
{
Q_OBJECT
public:
explicit OJProblemCasesRunner(const QString& filename, const QString& arguments, const QString& workDir,
const QVector<POJProblemCase>& problemCases, QObject *parent = nullptr);
explicit OJProblemCasesRunner(const QString& filename, const QString& arguments, const QString& workDir,
POJProblemCase problemCase, QObject *parent = nullptr);
signals:
2021-11-01 20:44:08 +08:00
void caseStarted(const QString& id, int total, int current);
void caseFinished(const QString& id, int total, int current);
2021-11-01 09:18:23 +08:00
private:
void runCase(int index, POJProblemCase problemCase);
private:
QVector<POJProblemCase> mProblemCases;
// QThread interface
protected:
void run() override;
};
#endif // OJPROBLEMCASESRUNNER_H