15 #include <QtCore/QObject>
17 class Baker :
public QObject {
21 virtual ~Baker() =
default;
25 bool hasErrors()
const {
return !_errorList.isEmpty(); }
26 QStringList getErrors()
const {
return _errorList; }
28 bool hasWarnings()
const {
return !_warningList.isEmpty(); }
29 QStringList getWarnings()
const {
return _warningList; }
31 std::vector<QString> getOutputFiles()
const {
return _outputFiles; }
33 virtual void setIsFinished(
bool isFinished);
34 bool isFinished()
const {
return _isFinished.load(); }
36 virtual void setWasAborted(
bool wasAborted);
38 bool wasAborted()
const {
return _wasAborted.load(); }
41 virtual void bake() = 0;
42 virtual void abort() { _shouldAbort.store(
true); }
49 void handleError(
const QString& error);
50 void handleWarning(
const QString& warning);
52 void handleErrors(
const QStringList& errors);
56 std::vector<QString> _outputFiles;
58 QStringList _errorList;
59 QStringList _warningList;
61 std::atomic<bool> _isFinished {
false };
63 std::atomic<bool> _shouldAbort {
false };
64 std::atomic<bool> _wasAborted {
false };