From c30e9145049c52feb2de719307ebbfee0650f01b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dan=20Vr=C3=A1til?= Date: Thu, 11 Dec 2014 15:55:18 +0100 Subject: Async: move the actual task exection into Executor implementation As of now, Job is only front interface to a chain of Executor subclasses. Each Executor subclass specializes for given type of execution (then, each, reduce, ...), and the chain is then executed recursively, as we did with the original Job implementation. --- async/src/async.cpp | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'async/src/async.cpp') diff --git a/async/src/async.cpp b/async/src/async.cpp index 7e81f24..c4a88fd 100644 --- a/async/src/async.cpp +++ b/async/src/async.cpp @@ -28,13 +28,20 @@ using namespace Async; -JobBase::JobBase(JobBase::JobType jobType, JobBase* prev) - : mPrev(prev) - , mResult(0) - , mJobType(jobType) +JobBase::JobBase(Executor *executor) + : mExecutor(executor) { } +JobBase::~JobBase() +{ +} + +void JobBase::exec() +{ + mExecutor->exec(); +} + FutureBase::FutureBase() : mFinished(false) @@ -48,6 +55,10 @@ FutureBase::FutureBase(const Async::FutureBase &other) { } +FutureBase::~FutureBase() +{ +} + void FutureBase::setFinished() { mFinished = true; -- cgit v1.2.3