A platform for high-performance distributed tool and library development written in C++. It can be deployed in two different cluster modes: standalone or distributed. API for v0.5.0, released on June 13, 2018.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
CPPLambdaCreationFunctions.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * *
3  * Copyright 2018 Rice University *
4  * *
5  * Licensed under the Apache License, Version 2.0 (the "License"); *
6  * you may not use this file except in compliance with the License. *
7  * You may obtain a copy of the License at *
8  * *
9  * http://www.apache.org/licenses/LICENSE-2.0 *
10  * *
11  * Unless required by applicable law or agreed to in writing, software *
12  * distributed under the License is distributed on an "AS IS" BASIS, *
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. *
14  * See the License for the specific language governing permissions and *
15  * limitations under the License. *
16  * *
17  *****************************************************************************/
18 
19 #ifndef PDB_CPPLAMBDACREATIONFUNCTIONS_H
20 #define PDB_CPPLAMBDACREATIONFUNCTIONS_H
21 
22 #include "Lambda.h"
23 #include "Ptr.h"
24 #include "AttAccessLambda.h"
25 #include "AndLambda.h"
29 #include "SimpleComputeExecutor.h"
30 #include "CPlusPlusLambda.h"
31 #include "TypeName.h"
32 
33 namespace pdb {
34 
47 template <typename ParamOne, typename F>
50  Handle<Nothing> p2, p3, p4, p5;
52  std::make_shared<CPlusPlusLambda<F,
54  ParamOne>>(arg, pOne, p2, p3, p4, p5));
55 }
56 
65 template <typename ParamOne, typename F>
66 auto makeLambda(Handle<ParamOne>& pOne, F arg) -> LambdaTree<std::enable_if_t<!std::is_reference<decltype(arg(pOne))>::value,
67  decltype(arg(pOne))>> {
68  Handle<Nothing> p2, p3, p4, p5;
69  return LambdaTree<decltype(arg(pOne))>(std::make_shared<CPlusPlusLambda<F,
70  decltype(arg(pOne)),
71  ParamOne>>(arg, pOne, p2, p3, p4, p5));
72 }
73 
84 template <typename ParamOne, typename ParamTwo, typename F>
87 
88  Handle<Nothing> p3, p4, p5;
91  ParamOne,
92  ParamTwo>>(arg, pOne, pTwo, p3, p4, p5));
93 }
94 
105 template <typename ParamOne, typename ParamTwo, typename F>
106 auto makeLambda(Handle<ParamOne>& pOne, Handle<ParamTwo>& pTwo, F arg) -> LambdaTree<std::enable_if_t<!std::is_reference<decltype(arg(pOne, pTwo))>::value,
107  decltype(arg(pOne, pTwo))>> {
108  Handle<Nothing> p3, p4, p5;
109  return LambdaTree<decltype(arg(pOne, pTwo))>(std::make_shared<CPlusPlusLambda<F, decltype(arg(pOne, pTwo)), ParamOne, ParamTwo>>(arg, pOne, pTwo, p3, p4, p5));
110 }
111 
124 template <typename ParamOne, typename ParamTwo, typename ParamThree, typename F>
125 
128  Handle<Nothing> p4, p5;
129 
132  ParamOne,
133  ParamTwo,
134  ParamThree>>(arg, pOne, pTwo, pThree, p4, p5));
135 }
136 
149 template <typename ParamOne, typename ParamTwo, typename ParamThree, typename F>
151  decltype(arg(pOne, pTwo, pThree))>> {
152  Handle<Nothing> p4, p5;
154  decltype(arg(pOne, pTwo, pThree)),
155  ParamOne,
156  ParamTwo,
157  ParamThree>>(arg, pOne, pTwo, pThree, p4, p5));
158 }
159 
174 template <typename ParamOne, typename ParamTwo, typename ParamThree, typename ParamFour, typename F>
177  Handle<Nothing> p5;
180  ParamOne,
181  ParamTwo,
182  ParamThree,
183  ParamFour>>(arg, pOne, pTwo, pThree, pFour, p5));
184 }
185 
200 template <typename ParamOne, typename ParamTwo, typename ParamThree, typename ParamFour, typename F>
201 auto makeLambda(Handle<ParamOne>& pOne, Handle<ParamTwo>& pTwo, Handle<ParamThree>& pThree, Handle<ParamFour>& pFour, F arg) -> LambdaTree<
202 std::enable_if_t<!std::is_reference<decltype(arg(pOne, pTwo, pThree, pFour))>::value, decltype(arg(pOne, pTwo, pThree, pFour))>> {
203 
204  Handle<Nothing> p5;
205  return LambdaTree<decltype(arg(pOne, pTwo, pThree, pFour))>(std::make_shared<CPlusPlusLambda<F,
206  decltype(arg(pOne, pTwo, pThree, pFour)),
207  ParamOne,
208  ParamTwo,
209  ParamThree,
210  ParamFour>>(arg, pOne, pTwo, pThree, pFour, p5));
211 }
212 
229 template <typename ParamOne, typename ParamTwo, typename ParamThree, typename ParamFour, typename ParamFive, typename F>
231  Handle<ParamTwo>& pTwo,
232  Handle<ParamThree>& pThree,
233  Handle<ParamFour>& pFour,
234  Handle<ParamFive>& pFive,
236 
237  return LambdaTree<Ptr<typename std::remove_reference<decltype(arg(pOne,
238  pTwo,
239  pThree,
240  pFour,
241  pFive))>::type>>(std::make_shared<CPlusPlusLambda<F,
243  ParamOne,
244  ParamTwo,
245  ParamThree,
246  ParamFour,
247  ParamFive>>(arg, pOne, pTwo, pThree, pFour, pFive));
248 }
249 
266 template <typename ParamOne, typename ParamTwo, typename ParamThree, typename ParamFour, typename ParamFive, typename F>
267 auto makeLambda(Handle<ParamOne>& pOne,
268  Handle<ParamTwo>& pTwo,
269  Handle<ParamThree>& pThree,
270  Handle<ParamFour>& pFour,
271  Handle<ParamFive>& pFive,
272  F arg) -> LambdaTree<std::enable_if_t<!std::is_reference<decltype(arg(pOne, pTwo, pThree, pFour, pFive))>::value,
273  decltype(arg(pOne, pTwo, pThree, pFour, pFive))>> {
274  return LambdaTree<decltype(arg(pOne, pTwo, pThree, pFour, pFive))>(std::make_shared<CPlusPlusLambda<F,
275  decltype(arg(pOne, pTwo, pThree, pFour, pFive)),
276  ParamOne,
277  ParamTwo,
278  ParamThree,
279  ParamFour,
280  ParamFive>>(arg, pOne, pTwo, pThree, pFour, pFive));
281 }
282 
283 }
284 #endif //PDB_CPPLAMBDACREATIONFUNCTIONS_H
auto makeLambda(Handle< ParamOne > &pOne, F arg) -> LambdaTree< std::enable_if_t< std::is_reference< decltype(arg(pOne))>::value, Ptr< typename std::remove_reference< decltype(arg(pOne))>::type >>>
Definition: Ptr.h:32