forked from haptork/easyLambda
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ezl.hpp
54 lines (42 loc) · 1.41 KB
/
ezl.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/*!
* @file
* Single include interface for using ezl
*
* This file is a part of easyLambda(ezl) project for parallel data
* processing with modern C++ and MPI.
*
* @copyright Utkarsh Bhardwaj <haptork@gmail.com> 2015-2016
* Distributed under the Boost Software License, Version 1.0.
* (See accompanying LICENSE.md or copy at * http://boost.org/LICENSE_1_0.txt)
* */
#ifndef EZL_EZL_H
#define EZL_EZL_H
#include <memory>
#include <tuple>
#include <ezl/builder/DataFlowExpr.hpp>
#include <ezl/builder/LoadBuilder.hpp>
#include <ezl/builder/LoadExpr.hpp>
#include <ezl/builder/LoadUnitBuilder.hpp>
#include <ezl/builder/LoadUnitExpr.hpp>
#include <ezl/helper/meta/slct.hpp>
#include <ezl/helper/meta/slctTuple.hpp>
namespace ezl {
template <class T> class Source;
template <int... I>
using val = ezl::detail::meta::slct<I...>;
template <int... I>
using key = ezl::detail::meta::slct<I...>;
template <class I> inline auto flow(std::shared_ptr<I> pr) {
detail::LoadUnitBuilder<I> obj;
return obj.prev(pr);
}
template <class I> auto flow(detail::LoadUnitBuilder<I> pr) { return pr; }
template <class... Is> inline auto flow() {
using I = typename detail::meta::SlctTupleRefType<std::tuple<Is...>>::type;
return flow(std::shared_ptr<detail::Source<I>>{nullptr});
}
template <class F> inline auto rise(F&& sourceFunc) {
return detail::LoadBuilder<F>{std::forward<F>(sourceFunc)};
}
} // namespace ezl
#endif // ! EZL_EZL_H