summaryrefslogtreecommitdiffstats
path: root/async/src/async.cpp
diff options
context:
space:
mode:
authorDan Vrátil <dvratil@redhat.com>2014-12-11 15:55:18 +0100
committerDan Vrátil <dvratil@redhat.com>2014-12-11 15:55:18 +0100
commitc30e9145049c52feb2de719307ebbfee0650f01b (patch)
tree6896823401fb174c0f396ec30eae6257d32f8a41 /async/src/async.cpp
parent1aee1bda9fc81c888ad18fea107c271133dd5442 (diff)
downloadsink-c30e9145049c52feb2de719307ebbfee0650f01b.tar.gz
sink-c30e9145049c52feb2de719307ebbfee0650f01b.zip
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.
Diffstat (limited to 'async/src/async.cpp')
-rw-r--r--async/src/async.cpp19
1 files changed, 15 insertions, 4 deletions
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 @@
28 28
29using namespace Async; 29using namespace Async;
30 30
31JobBase::JobBase(JobBase::JobType jobType, JobBase* prev) 31JobBase::JobBase(Executor *executor)
32 : mPrev(prev) 32 : mExecutor(executor)
33 , mResult(0)
34 , mJobType(jobType)
35{ 33{
36} 34}
37 35
36JobBase::~JobBase()
37{
38}
39
40void JobBase::exec()
41{
42 mExecutor->exec();
43}
44
38 45
39FutureBase::FutureBase() 46FutureBase::FutureBase()
40 : mFinished(false) 47 : mFinished(false)
@@ -48,6 +55,10 @@ FutureBase::FutureBase(const Async::FutureBase &other)
48{ 55{
49} 56}
50 57
58FutureBase::~FutureBase()
59{
60}
61
51void FutureBase::setFinished() 62void FutureBase::setFinished()
52{ 63{
53 mFinished = true; 64 mFinished = true;