diff options
author | Dan Vrátil <dvratil@redhat.com> | 2015-02-08 13:12:50 +0100 |
---|---|---|
committer | Dan Vrátil <dvratil@redhat.com> | 2015-02-09 14:33:45 +0100 |
commit | 800f38923a4b03f3b22639ba169afbe5edb6c9f5 (patch) | |
tree | e8c745dd236a3804b27e62125396b2fecb3cb8a7 /async/src | |
parent | 2c3de5fcfdb5d97ad71577b2f1fd6257743c2c51 (diff) | |
download | sink-800f38923a4b03f3b22639ba169afbe5edb6c9f5.tar.gz sink-800f38923a4b03f3b22639ba169afbe5edb6c9f5.zip |
Async: Move Async::PrevOut to Async::detail::prevOut
Diffstat (limited to 'async/src')
-rw-r--r-- | async/src/async.h | 13 | ||||
-rw-r--r-- | async/src/async_impl.h | 5 |
2 files changed, 9 insertions, 9 deletions
diff --git a/async/src/async.h b/async/src/async.h index 8523df3..95b28d7 100644 --- a/async/src/async.h +++ b/async/src/async.h | |||
@@ -66,11 +66,6 @@ class ExecutorBase; | |||
66 | typedef QSharedPointer<ExecutorBase> ExecutorBasePtr; | 66 | typedef QSharedPointer<ExecutorBase> ExecutorBasePtr; |
67 | 67 | ||
68 | 68 | ||
69 | template<typename ... T> | ||
70 | struct PreviousOut { | ||
71 | using type = typename std::tuple_element<0, std::tuple<T ..., void>>::type; | ||
72 | }; | ||
73 | |||
74 | class ExecutorBase | 69 | class ExecutorBase |
75 | { | 70 | { |
76 | template<typename PrevOut, typename Out, typename ... In> | 71 | template<typename PrevOut, typename Out, typename ... In> |
@@ -113,7 +108,7 @@ protected: | |||
113 | }; | 108 | }; |
114 | 109 | ||
115 | template<typename Out, typename ... In> | 110 | template<typename Out, typename ... In> |
116 | class ThenExecutor: public Executor<typename PreviousOut<In ...>::type, Out, In ...> | 111 | class ThenExecutor: public Executor<typename detail::prevOut<In ...>::type, Out, In ...> |
117 | { | 112 | { |
118 | public: | 113 | public: |
119 | ThenExecutor(ThenTask<Out, In ...> then, ErrorHandler errorHandler, const ExecutorBasePtr &parent); | 114 | ThenExecutor(ThenTask<Out, In ...> then, ErrorHandler errorHandler, const ExecutorBasePtr &parent); |
@@ -139,7 +134,7 @@ public: | |||
139 | }; | 134 | }; |
140 | 135 | ||
141 | template<typename Out, typename ... In> | 136 | template<typename Out, typename ... In> |
142 | class SyncThenExecutor : public Executor<typename PreviousOut<In ...>::type, Out, In ...> | 137 | class SyncThenExecutor : public Executor<typename detail::prevOut<In ...>::type, Out, In ...> |
143 | { | 138 | { |
144 | public: | 139 | public: |
145 | SyncThenExecutor(SyncThenTask<Out, In ...> then, ErrorHandler errorHandler, const ExecutorBasePtr &parent); | 140 | SyncThenExecutor(SyncThenTask<Out, In ...> then, ErrorHandler errorHandler, const ExecutorBasePtr &parent); |
@@ -430,7 +425,7 @@ void Executor<PrevOut, Out, In ...>::exec() | |||
430 | 425 | ||
431 | template<typename Out, typename ... In> | 426 | template<typename Out, typename ... In> |
432 | ThenExecutor<Out, In ...>::ThenExecutor(ThenTask<Out, In ...> then, ErrorHandler error, const ExecutorBasePtr &parent) | 427 | ThenExecutor<Out, In ...>::ThenExecutor(ThenTask<Out, In ...> then, ErrorHandler error, const ExecutorBasePtr &parent) |
433 | : Executor<typename PreviousOut<In ...>::type, Out, In ...>(error, parent) | 428 | : Executor<typename detail::prevOut<In ...>::type, Out, In ...>(error, parent) |
434 | { | 429 | { |
435 | this->mFunc = then; | 430 | this->mFunc = then; |
436 | } | 431 | } |
@@ -492,7 +487,7 @@ ReduceExecutor<Out, In>::ReduceExecutor(ReduceTask<Out, In> reduce, ErrorHandler | |||
492 | 487 | ||
493 | template<typename Out, typename ... In> | 488 | template<typename Out, typename ... In> |
494 | SyncThenExecutor<Out, In ...>::SyncThenExecutor(SyncThenTask<Out, In ...> then, ErrorHandler errorHandler, const ExecutorBasePtr &parent) | 489 | SyncThenExecutor<Out, In ...>::SyncThenExecutor(SyncThenTask<Out, In ...> then, ErrorHandler errorHandler, const ExecutorBasePtr &parent) |
495 | : Executor<typename PreviousOut<In ...>::type, Out, In ...>(errorHandler, parent) | 490 | : Executor<typename detail::prevOut<In ...>::type, Out, In ...>(errorHandler, parent) |
496 | { | 491 | { |
497 | this->mFunc = then; | 492 | this->mFunc = then; |
498 | } | 493 | } |
diff --git a/async/src/async_impl.h b/async/src/async_impl.h index e281bda..58f6ced 100644 --- a/async/src/async_impl.h +++ b/async/src/async_impl.h | |||
@@ -40,6 +40,11 @@ struct isIterable<T, typename std::conditional<false, typename T::iterator, void | |||
40 | enum { value = 1 }; | 40 | enum { value = 1 }; |
41 | }; | 41 | }; |
42 | 42 | ||
43 | template<typename ... T> | ||
44 | struct prevOut { | ||
45 | using type = typename std::tuple_element<0, std::tuple<T ..., void>>::type; | ||
46 | }; | ||
47 | |||
43 | } // namespace Detail | 48 | } // namespace Detail |
44 | 49 | ||
45 | } // namespace Async | 50 | } // namespace Async |