diff --git a/src/execution_p.h b/src/execution_p.h index 8b8d7c9..6682bed 100644 --- a/src/execution_p.h +++ b/src/execution_p.h @@ -1,116 +1,118 @@ /* * Copyright 2014 - 2015 Daniel Vrátil * Copyright 2016 Daniel Vrátil * Copyright 2016 Christian Mollekopf * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Library General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library. If not, see . */ #ifndef KASYNC_EXECUTION_P_H_ #define KASYNC_EXECUTION_P_H_ +#include "kasync_export.h" + #include "debug.h" #include #include #include #include #include namespace KAsync { class FutureBase; template class Future; class Tracer; //@cond PRIVATE namespace Private { class ExecutorBase; using ExecutorBasePtr = QSharedPointer; struct Execution; using ExecutionPtr = QSharedPointer; class ExecutionContext; enum ExecutionFlag { Always, ErrorCase, GoodCase }; -struct Execution { +struct KASYNC_EXPORT Execution { explicit Execution(const ExecutorBasePtr &executor) : executor(executor) {} virtual ~Execution() { if (resultBase) { resultBase->releaseExecution(); delete resultBase; } prevExecution.reset(); } void setFinished() { tracer.reset(); } template KAsync::Future* result() const { return static_cast*>(resultBase); } void releaseFuture() { resultBase = nullptr; } ExecutorBasePtr executor; ExecutionPtr prevExecution; std::unique_ptr tracer; FutureBase *resultBase = nullptr; }; class ExecutionContext { public: using Ptr = QSharedPointer; QVector> guards; bool guardIsBroken() const { for (const auto &g : guards) { if (!g) { return true; } } return false; } }; } // namespace Private //@endcond } // namespace KAsync #endif