ug4
function_traits.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2010-2015: G-CSC, Goethe University Frankfurt
3  * Authors: Sebastian Reiter, Andreas Vogel
4  *
5  * This file is part of UG4.
6  *
7  * UG4 is free software: you can redistribute it and/or modify it under the
8  * terms of the GNU Lesser General Public License version 3 (as published by the
9  * Free Software Foundation) with the following additional attribution
10  * requirements (according to LGPL/GPL v3 §7):
11  *
12  * (1) The following notice must be displayed in the Appropriate Legal Notices
13  * of covered and combined works: "Based on UG4 (www.ug4.org/license)".
14  *
15  * (2) The following notice must be displayed at a prominent place in the
16  * terminal output of covered works: "Based on UG4 (www.ug4.org/license)".
17  *
18  * (3) The following bibliography is recommended for citation and must be
19  * preserved in all covered files:
20  * "Reiter, S., Vogel, A., Heppner, I., Rupp, M., and Wittum, G. A massively
21  * parallel geometric multigrid solver on hierarchically distributed grids.
22  * Computing and visualization in science 16, 4 (2013), 151-164"
23  * "Vogel, A., Reiter, S., Rupp, M., Nägel, A., and Wittum, G. UG4 -- a novel
24  * flexible software system for simulating pde based models on high performance
25  * computers. Computing and visualization in science 16, 4 (2013), 165-179"
26  *
27  * This program is distributed in the hope that it will be useful,
28  * but WITHOUT ANY WARRANTY; without even the implied warranty of
29  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
30  * GNU Lesser General Public License for more details.
31  */
32 
33 #ifndef __H__UG_BRIDGE__FUNCTION_TRAITS__
34 #define __H__UG_BRIDGE__FUNCTION_TRAITS__
35 
37 #include <type_traits>
38 
46 const int UG_REGISTRY_MAX_NUM_ARGS = 12;
47 
48 namespace ug
49 {
50 namespace bridge
51 {
52 
55 
56 class CustomReturn {};
57 
58 template <typename TFunc>
59 struct func_traits {};
60 
62 // global function traits
64 
65 template <typename TRet>
66 struct func_traits <TRet (*) ()>
67 {
68  static const bool custom_return = std::is_same<TRet, CustomReturn>::value;
69  typedef TRet return_type;
71  static TRet apply(TRet (*fp)(), TypeValueList<params_type>& args)
72  {
73  return fp();
74  };
75 };
76 
77 
78 template <typename TRet, typename P1>
79 struct func_traits <TRet (*) (P1)>
80 {
81  static const bool custom_return = std::is_same<TRet, CustomReturn>::value;
82  typedef TRet return_type;
84  static TRet apply(TRet (*fp)(P1), TypeValueList<params_type>& args)
85  {
86  return fp(args.hd);
87  };
88 };
89 
90 
91 template <typename TRet, typename T1, typename T2>
92 struct func_traits <TRet (*) (T1, T2)>
93 {
94  static const bool custom_return = std::is_same<TRet, CustomReturn>::value;
95  typedef TRet return_type;
97  static TRet apply(TRet (*fp)(T1, T2), TypeValueList<params_type>& args)
98  {
99  return fp(args.hd, args.tl.hd);
100  };
101 };
102 
103 template <typename TRet, typename T1, typename T2, typename T3>
104 struct func_traits <TRet (*) (T1, T2, T3)>
105 {
106  static const bool custom_return = std::is_same<TRet, CustomReturn>::value;
107  typedef TRet return_type;
109  static TRet apply(TRet (*fp)(T1, T2, T3), TypeValueList<params_type>& args)
110  {
111  return fp(args.hd, args.tl.hd, args.tl.tl.hd);
112  };
113 };
114 
115 template <typename TRet, typename T1, typename T2, typename T3,
116  typename T4>
117 struct func_traits <TRet (*) (T1, T2, T3, T4)>
118 {
119  static const bool custom_return = std::is_same<TRet, CustomReturn>::value;
120  typedef TRet return_type;
122  static TRet apply(TRet (*fp)(T1, T2, T3, T4), TypeValueList<params_type>& args)
123  {
124  return fp(args.hd, args.tl.hd, args.tl.tl.hd, args.tl.tl.tl.hd);
125  };
126 };
127 
128 template <typename TRet, typename T1, typename T2, typename T3,
129  typename T4, typename T5>
130 struct func_traits <TRet (*) (T1, T2, T3, T4, T5)>
131 {
132  static const bool custom_return = std::is_same<TRet, CustomReturn>::value;
133  typedef TRet return_type;
135  static TRet apply(TRet (*fp)(T1, T2, T3, T4, T5), TypeValueList<params_type>& args)
136  {
137  return fp(args.hd, args.tl.hd, args.tl.tl.hd, args.tl.tl.tl.hd,
138  args.tl.tl.tl.tl.hd);
139  };
140 };
141 
142 template <typename TRet, typename T1, typename T2, typename T3,
143  typename T4, typename T5, typename T6>
144 struct func_traits <TRet (*) (T1, T2, T3, T4, T5, T6)>
145 {
146  static const bool custom_return = std::is_same<TRet, CustomReturn>::value;
147  typedef TRet return_type;
149  static TRet apply(TRet (*fp)(T1, T2, T3, T4, T5, T6), TypeValueList<params_type>& args)
150  {
151  return fp(args.hd, args.tl.hd, args.tl.tl.hd, args.tl.tl.tl.hd,
152  args.tl.tl.tl.tl.hd, args.tl.tl.tl.tl.tl.hd);
153  };
154 };
155 
156 template <typename TRet, typename T1, typename T2, typename T3,
157  typename T4, typename T5, typename T6, typename T7>
158 struct func_traits <TRet (*) (T1, T2, T3, T4, T5, T6, T7)>
159 {
160  static const bool custom_return = std::is_same<TRet, CustomReturn>::value;
161  typedef TRet return_type;
163  static TRet apply(TRet (*fp)(T1, T2, T3, T4, T5, T6, T7), TypeValueList<params_type>& args)
164  {
165  return fp(args.hd, args.tl.hd, args.tl.tl.hd, args.tl.tl.tl.hd,
166  args.tl.tl.tl.tl.hd, args.tl.tl.tl.tl.tl.hd, args.tl.tl.tl.tl.tl.tl.hd);
167  };
168 };
169 
170 template <typename TRet, typename T1, typename T2, typename T3,
171  typename T4, typename T5, typename T6, typename T7, typename T8>
172 struct func_traits <TRet (*) (T1, T2, T3, T4, T5, T6, T7, T8)>
173 {
174  static const bool custom_return = std::is_same<TRet, CustomReturn>::value;
175  typedef TRet return_type;
177  static TRet apply(TRet (*fp)(T1, T2, T3, T4, T5, T6, T7, T8), TypeValueList<params_type>& args)
178  {
179  return fp(args.hd, args.tl.hd, args.tl.tl.hd, args.tl.tl.tl.hd,
180  args.tl.tl.tl.tl.hd, args.tl.tl.tl.tl.tl.hd, args.tl.tl.tl.tl.tl.tl.hd,
181  args.tl.tl.tl.tl.tl.tl.tl.hd);
182  };
183 };
184 
185 template <typename TRet, typename T1, typename T2, typename T3,
186  typename T4, typename T5, typename T6, typename T7, typename T8, typename T9>
187 struct func_traits <TRet (*) (T1, T2, T3, T4, T5, T6, T7, T8, T9)>
188 {
189  static const bool custom_return = std::is_same<TRet, CustomReturn>::value;
190  typedef TRet return_type;
192  static TRet apply(TRet (*fp)(T1, T2, T3, T4, T5, T6, T7, T8, T9), TypeValueList<params_type>& args)
193  {
194  return fp(args.hd, args.tl.hd, args.tl.tl.hd, args.tl.tl.tl.hd,
195  args.tl.tl.tl.tl.hd, args.tl.tl.tl.tl.tl.hd, args.tl.tl.tl.tl.tl.tl.hd,
196  args.tl.tl.tl.tl.tl.tl.tl.hd, args.tl.tl.tl.tl.tl.tl.tl.tl.hd);
197  };
198 };
199 
200 template <typename TRet, typename T1, typename T2, typename T3,
201  typename T4, typename T5, typename T6, typename T7, typename T8, typename T9,
202  typename T10>
203 struct func_traits <TRet (*) (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10)>
204 {
205  static const bool custom_return = std::is_same<TRet, CustomReturn>::value;
206  typedef TRet return_type;
208  static TRet apply(TRet (*fp)(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10), TypeValueList<params_type>& args)
209  {
210  return fp(args.hd, args.tl.hd, args.tl.tl.hd, args.tl.tl.tl.hd,
211  args.tl.tl.tl.tl.hd, args.tl.tl.tl.tl.tl.hd, args.tl.tl.tl.tl.tl.tl.hd,
212  args.tl.tl.tl.tl.tl.tl.tl.hd, args.tl.tl.tl.tl.tl.tl.tl.tl.hd,
213  args.tl.tl.tl.tl.tl.tl.tl.tl.tl.hd);
214  };
215 };
216 
217 template <typename TRet, typename T1, typename T2, typename T3,
218  typename T4, typename T5, typename T6, typename T7, typename T8, typename T9,
219  typename T10, typename T11>
220 struct func_traits <TRet (*) (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11)>
221 {
222  static const bool custom_return = std::is_same<TRet, CustomReturn>::value;
223  typedef TRet return_type;
225  static TRet apply(TRet (*fp)(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11), TypeValueList<params_type>& args)
226  {
227  return fp(args.hd, args.tl.hd, args.tl.tl.hd, args.tl.tl.tl.hd,
228  args.tl.tl.tl.tl.hd, args.tl.tl.tl.tl.tl.hd, args.tl.tl.tl.tl.tl.tl.hd,
229  args.tl.tl.tl.tl.tl.tl.tl.hd, args.tl.tl.tl.tl.tl.tl.tl.tl.hd,
230  args.tl.tl.tl.tl.tl.tl.tl.tl.tl.hd, args.tl.tl.tl.tl.tl.tl.tl.tl.tl.tl.hd);
231  };
232 };
233 
234 template <typename TRet, typename T1, typename T2, typename T3,
235  typename T4, typename T5, typename T6, typename T7, typename T8, typename T9,
236  typename T10, typename T11, typename T12>
237 struct func_traits <TRet (*) (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12)>
238 {
239  static const bool custom_return = std::is_same<TRet, CustomReturn>::value;
240  typedef TRet return_type;
242  static TRet apply(TRet (*fp)(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12), TypeValueList<params_type>& args)
243  {
244  return fp(args.hd, args.tl.hd, args.tl.tl.hd, args.tl.tl.tl.hd,
245  args.tl.tl.tl.tl.hd, args.tl.tl.tl.tl.tl.hd, args.tl.tl.tl.tl.tl.tl.hd,
246  args.tl.tl.tl.tl.tl.tl.tl.hd, args.tl.tl.tl.tl.tl.tl.tl.tl.hd,
247  args.tl.tl.tl.tl.tl.tl.tl.tl.tl.hd, args.tl.tl.tl.tl.tl.tl.tl.tl.tl.tl.hd,
248  args.tl.tl.tl.tl.tl.tl.tl.tl.tl.tl.tl.hd);
249  };
250 };
251 
253 // non-const method traits
255 
256 #define FUNC_TRAITS_GENERAL_NON_CONST_MEMBER \
257  static const bool custom_return = std::is_same<TRet, CustomReturn>::value; \
258  static const bool const_method = false;\
259  typedef TClass class_type;\
260  typedef TRet return_type
261 
262 
263 template <typename TClass, typename TRet>
264 struct func_traits <TRet (TClass::*) ()>
265 {
268  static TRet apply(TRet (TClass::*fp)(), TClass* obj, TypeValueList<params_type>& args)
269  {
270  return (obj->*fp)();
271  };
272 };
273 
274 
275 template <typename TClass, typename TRet, typename P1>
276 struct func_traits <TRet (TClass::*) (P1)>
277 {
280  static TRet apply(TRet (TClass::*fp)(P1), TClass* obj, TypeValueList<params_type>& args)
281  {
282  return (obj->*fp)(args.hd);
283  };
284 };
285 
286 
287 template <typename TClass, typename TRet, typename T1, typename T2>
288 struct func_traits <TRet (TClass::*) (T1, T2)>
289 {
292  static TRet apply(TRet (TClass::*fp)(T1, T2), TClass* obj, TypeValueList<params_type>& args)
293  {
294  return (obj->*fp)(args.hd, args.tl.hd);
295  };
296 };
297 
298 template <typename TClass, typename TRet, typename T1, typename T2, typename T3>
299 struct func_traits <TRet (TClass::*) (T1, T2, T3)>
300 {
303  static TRet apply(TRet (TClass::*fp)(T1, T2, T3), TClass* obj, TypeValueList<params_type>& args)
304  {
305  return (obj->*fp)(args.hd, args.tl.hd, args.tl.tl.hd);
306  };
307 };
308 
309 template <typename TClass, typename TRet, typename T1, typename T2, typename T3,
310  typename T4>
311 struct func_traits <TRet (TClass::*) (T1, T2, T3, T4)>
312 {
315  static TRet apply(TRet (TClass::*fp)(T1, T2, T3, T4), TClass* obj, TypeValueList<params_type>& args)
316  {
317  return (obj->*fp)(args.hd, args.tl.hd, args.tl.tl.hd, args.tl.tl.tl.hd);
318  };
319 };
320 
321 template <typename TClass, typename TRet, typename T1, typename T2, typename T3,
322  typename T4, typename T5>
323 struct func_traits <TRet (TClass::*) (T1, T2, T3, T4, T5)>
324 {
327  static TRet apply(TRet (TClass::*fp)(T1, T2, T3, T4, T5), TClass* obj, TypeValueList<params_type>& args)
328  {
329  return (obj->*fp)(args.hd, args.tl.hd, args.tl.tl.hd, args.tl.tl.tl.hd, args.tl.tl.tl.tl.hd);
330  };
331 };
332 
333 template <typename TClass, typename TRet, typename T1, typename T2, typename T3,
334  typename T4, typename T5, typename T6>
335 struct func_traits <TRet (TClass::*) (T1, T2, T3, T4, T5, T6)>
336 {
339  static TRet apply(TRet (TClass::*fp)(T1, T2, T3, T4, T5, T6), TClass* obj, TypeValueList<params_type>& args)
340  {
341  return (obj->*fp)(args.hd, args.tl.hd, args.tl.tl.hd, args.tl.tl.tl.hd, args.tl.tl.tl.tl.hd,
342  args.tl.tl.tl.tl.tl.hd);
343  };
344 };
345 
346 template <typename TClass, typename TRet, typename T1, typename T2, typename T3,
347  typename T4, typename T5, typename T6, typename T7>
348 struct func_traits <TRet (TClass::*) (T1, T2, T3, T4, T5, T6, T7)>
349 {
352  static TRet apply(TRet (TClass::*fp)(T1, T2, T3, T4, T5, T6, T7), TClass* obj, TypeValueList<params_type>& args)
353  {
354  return (obj->*fp)(args.hd, args.tl.hd, args.tl.tl.hd, args.tl.tl.tl.hd, args.tl.tl.tl.tl.hd,
355  args.tl.tl.tl.tl.tl.hd, args.tl.tl.tl.tl.tl.tl.hd);
356  };
357 };
358 
359 template <typename TClass, typename TRet, typename T1, typename T2, typename T3,
360  typename T4, typename T5, typename T6, typename T7, typename T8>
361 struct func_traits <TRet (TClass::*) (T1, T2, T3, T4, T5, T6, T7, T8)>
362 {
365  static TRet apply(TRet (TClass::*fp)(T1, T2, T3, T4, T5, T6, T7, T8), TClass* obj, TypeValueList<params_type>& args)
366  {
367  return (obj->*fp)(args.hd, args.tl.hd, args.tl.tl.hd, args.tl.tl.tl.hd, args.tl.tl.tl.tl.hd,
368  args.tl.tl.tl.tl.tl.hd, args.tl.tl.tl.tl.tl.tl.hd, args.tl.tl.tl.tl.tl.tl.tl.hd);
369  };
370 };
371 
372 template <typename TClass, typename TRet, typename T1, typename T2, typename T3,
373  typename T4, typename T5, typename T6, typename T7, typename T8, typename T9>
374 struct func_traits <TRet (TClass::*) (T1, T2, T3, T4, T5, T6, T7, T8, T9)>
375 {
378  static TRet apply(TRet (TClass::*fp)(T1, T2, T3, T4, T5, T6, T7, T8, T9), TClass* obj, TypeValueList<params_type>& args)
379  {
380  return (obj->*fp)(args.hd, args.tl.hd, args.tl.tl.hd, args.tl.tl.tl.hd, args.tl.tl.tl.tl.hd,
381  args.tl.tl.tl.tl.tl.hd, args.tl.tl.tl.tl.tl.tl.hd, args.tl.tl.tl.tl.tl.tl.tl.hd,
382  args.tl.tl.tl.tl.tl.tl.tl.tl.hd);
383  };
384 };
385 
387 // const method traits
389 
390 #define FUNC_TRAITS_GENERAL_CONST_MEMBER \
391  static const bool custom_return = std::is_same<TRet, CustomReturn>::value; \
392  static const bool const_method = true;\
393  typedef TClass class_type;\
394  typedef TRet return_type
395 
396 
397 template <typename TClass, typename TRet>
398 struct func_traits <TRet (TClass::*) () const>
399 {
402  static TRet apply(TRet (TClass::*fp)() const, const TClass* obj, TypeValueList<params_type>& args)
403  {
404  return (obj->*fp)();
405  };
406 };
407 
408 
409 template <typename TClass, typename TRet, typename P1>
410 struct func_traits <TRet (TClass::*) (P1) const>
411 {
414  static TRet apply(TRet (TClass::*fp)(P1) const, const TClass* obj, TypeValueList<params_type>& args)
415  {
416  return (obj->*fp)(args.hd);
417  };
418 };
419 
420 
421 template <typename TClass, typename TRet, typename T1, typename T2>
422 struct func_traits <TRet (TClass::*) (T1, T2) const>
423 {
426  static TRet apply(TRet (TClass::*fp)(T1, T2) const, const TClass* obj, TypeValueList<params_type>& args)
427  {
428  return (obj->*fp)(args.hd, args.tl.hd);
429  };
430 };
431 
432 template <typename TClass, typename TRet, typename T1, typename T2, typename T3>
433 struct func_traits <TRet (TClass::*) (T1, T2, T3) const>
434 {
437  static TRet apply(TRet (TClass::*fp)(T1, T2, T3) const, const TClass* obj, TypeValueList<params_type>& args)
438  {
439  return (obj->*fp)(args.hd, args.tl.hd, args.tl.tl.hd);
440  };
441 };
442 
443 template <typename TClass, typename TRet, typename T1, typename T2, typename T3,
444  typename T4>
445 struct func_traits <TRet (TClass::*) (T1, T2, T3, T4) const>
446 {
449  static TRet apply(TRet (TClass::*fp)(T1, T2, T3, T4) const, const TClass* obj, TypeValueList<params_type>& args)
450  {
451  return (obj->*fp)(args.hd, args.tl.hd, args.tl.tl.hd, args.tl.tl.tl.hd);
452  };
453 };
454 
455 template <typename TClass, typename TRet, typename T1, typename T2, typename T3,
456  typename T4, typename T5>
457 struct func_traits <TRet (TClass::*) (T1, T2, T3, T4, T5) const>
458 {
461  static TRet apply(TRet (TClass::*fp)(T1, T2, T3, T4, T5) const, const TClass* obj, TypeValueList<params_type>& args)
462  {
463  return (obj->*fp)(args.hd, args.tl.hd, args.tl.tl.hd, args.tl.tl.tl.hd, args.tl.tl.tl.tl.hd);
464  };
465 };
466 
467 template <typename TClass, typename TRet, typename T1, typename T2, typename T3,
468  typename T4, typename T5, typename T6>
469 struct func_traits <TRet (TClass::*) (T1, T2, T3, T4, T5, T6) const>
470 {
473  static TRet apply(TRet (TClass::*fp)(T1, T2, T3, T4, T5, T6) const, const TClass* obj, TypeValueList<params_type>& args)
474  {
475  return (obj->*fp)(args.hd, args.tl.hd, args.tl.tl.hd, args.tl.tl.tl.hd, args.tl.tl.tl.tl.hd,
476  args.tl.tl.tl.tl.tl.hd);
477  };
478 };
479 
480 template <typename TClass, typename TRet, typename T1, typename T2, typename T3,
481  typename T4, typename T5, typename T6, typename T7>
482 struct func_traits <TRet (TClass::*) (T1, T2, T3, T4, T5, T6, T7) const>
483 {
486  static TRet apply(TRet (TClass::*fp)(T1, T2, T3, T4, T5, T6, T7) const, const TClass* obj, TypeValueList<params_type>& args)
487  {
488  return (obj->*fp)(args.hd, args.tl.hd, args.tl.tl.hd, args.tl.tl.tl.hd, args.tl.tl.tl.tl.hd,
489  args.tl.tl.tl.tl.tl.hd, args.tl.tl.tl.tl.tl.tl.hd);
490  };
491 };
492 
493 template <typename TClass, typename TRet, typename T1, typename T2, typename T3,
494  typename T4, typename T5, typename T6, typename T7, typename T8>
495 struct func_traits <TRet (TClass::*) (T1, T2, T3, T4, T5, T6, T7, T8) const>
496 {
499  static TRet apply(TRet (TClass::*fp)(T1, T2, T3, T4, T5, T6, T7, T8) const, const TClass* obj, TypeValueList<params_type>& args)
500  {
501  return (obj->*fp)(args.hd, args.tl.hd, args.tl.tl.hd, args.tl.tl.tl.hd, args.tl.tl.tl.tl.hd,
502  args.tl.tl.tl.tl.tl.hd, args.tl.tl.tl.tl.tl.tl.hd, args.tl.tl.tl.tl.tl.tl.tl.hd);
503  };
504 };
505 
506 template <typename TClass, typename TRet, typename T1, typename T2, typename T3,
507  typename T4, typename T5, typename T6, typename T7, typename T8, typename T9>
508 struct func_traits <TRet (TClass::*) (T1, T2, T3, T4, T5, T6, T7, T8, T9) const>
509 {
512  static TRet apply(TRet (TClass::*fp)(T1, T2, T3, T4, T5, T6, T7, T8, T9) const, const TClass* obj, TypeValueList<params_type>& args)
513  {
514  return (obj->*fp)(args.hd, args.tl.hd, args.tl.tl.hd, args.tl.tl.tl.hd, args.tl.tl.tl.tl.hd,
515  args.tl.tl.tl.tl.tl.hd, args.tl.tl.tl.tl.tl.tl.hd, args.tl.tl.tl.tl.tl.tl.tl.hd,
516  args.tl.tl.tl.tl.tl.tl.tl.tl.hd);
517  };
518 };
519 
521 // constructor function traits
523 
524 template <typename T, typename TTypelist>
526 
527 template <typename T>
529 {
532  {
533  (void)args;
534  return new T();
535  };
536 };
537 
538 template <typename T, typename T1>
539 struct constructor_traits <T, TypeList<T1> >
540 {
543  {
544  return new T(args.hd);
545  };
546 };
547 
548 template <typename T, typename T1, typename T2>
549 struct constructor_traits <T, TypeList<T1, T2> >
550 {
553  {
554  return new T(args.hd, args.tl.hd);
555  };
556 };
557 
558 template <typename T, typename T1, typename T2, typename T3>
559 struct constructor_traits <T, TypeList<T1, T2, T3> >
560 {
563  {
564  return new T(args.hd, args.tl.hd, args.tl.tl.hd);
565  };
566 };
567 
568 template <typename T, typename T1, typename T2, typename T3, typename T4>
569 struct constructor_traits <T, TypeList<T1, T2, T3, T4> >
570 {
573  {
574  return new T(args.hd, args.tl.hd, args.tl.tl.hd, args.tl.tl.tl.hd);
575  };
576 };
577 
578 template <typename T, typename T1, typename T2, typename T3, typename T4, typename T5>
579 struct constructor_traits <T, TypeList<T1, T2, T3, T4, T5> >
580 {
583  {
584  return new T(args.hd, args.tl.hd, args.tl.tl.hd, args.tl.tl.tl.hd, args.tl.tl.tl.tl.hd);
585  };
586 };
587 
588 template <typename T, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6>
589 struct constructor_traits <T, TypeList<T1, T2, T3, T4, T5, T6> >
590 {
593  {
594  return new T(args.hd, args.tl.hd, args.tl.tl.hd, args.tl.tl.tl.hd, args.tl.tl.tl.tl.hd,
595  args.tl.tl.tl.tl.tl.hd);
596  };
597 };
598 
599 template <typename T, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7>
600 struct constructor_traits <T, TypeList<T1, T2, T3, T4, T5, T6, T7> >
601 {
604  {
605  return new T(args.hd, args.tl.hd, args.tl.tl.hd, args.tl.tl.tl.hd, args.tl.tl.tl.tl.hd,
606  args.tl.tl.tl.tl.tl.hd, args.tl.tl.tl.tl.tl.tl.hd);
607  };
608 };
609 
610 template <typename T, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8>
611 struct constructor_traits <T, TypeList<T1, T2, T3, T4, T5, T6, T7, T8> >
612 {
615  {
616  return new T(args.hd, args.tl.hd, args.tl.tl.hd, args.tl.tl.tl.hd, args.tl.tl.tl.tl.hd,
617  args.tl.tl.tl.tl.tl.hd, args.tl.tl.tl.tl.tl.tl.hd, args.tl.tl.tl.tl.tl.tl.tl.hd);
618  };
619 };
620 
621 // end group registry
623 
624 } // end namespace bridge
625 } // end namespace ug
626 
627 #endif /* __H__UG_BRIDGE__FUNCTION_TRAITS__ */
Definition: function_traits.h:56
const int UG_REGISTRY_MAX_NUM_ARGS
Definition: function_traits.h:46
the ug namespace
Definition: metaprogramming_util.h:96
Definition: metaprogramming_util.h:117
TypeValueList< tail > tl
Definition: metaprogramming_util.h:122
head hd
Definition: metaprogramming_util.h:121
TypeList< T1, T2, T3, T4, T5, T6, T7, T8 > params_type
Definition: function_traits.h:613
static T * apply(TypeValueList< params_type > &args)
Definition: function_traits.h:614
TypeList< T1, T2, T3, T4, T5, T6, T7 > params_type
Definition: function_traits.h:602
static T * apply(TypeValueList< params_type > &args)
Definition: function_traits.h:603
TypeList< T1, T2, T3, T4, T5, T6 > params_type
Definition: function_traits.h:591
static T * apply(TypeValueList< params_type > &args)
Definition: function_traits.h:592
TypeList< T1, T2, T3, T4, T5 > params_type
Definition: function_traits.h:581
static T * apply(TypeValueList< params_type > &args)
Definition: function_traits.h:582
static T * apply(TypeValueList< params_type > &args)
Definition: function_traits.h:572
TypeList< T1, T2, T3, T4 > params_type
Definition: function_traits.h:571
static T * apply(TypeValueList< params_type > &args)
Definition: function_traits.h:562
TypeList< T1, T2, T3 > params_type
Definition: function_traits.h:561
TypeList< T1, T2 > params_type
Definition: function_traits.h:551
static T * apply(TypeValueList< params_type > &args)
Definition: function_traits.h:552
static T * apply(TypeValueList< params_type > &args)
Definition: function_traits.h:542
TypeList< T1 > params_type
Definition: function_traits.h:541
static T * apply(TypeValueList< params_type > &args)
Definition: function_traits.h:531
TypeList params_type
Definition: function_traits.h:530
Definition: function_traits.h:525
TRet return_type
Definition: function_traits.h:69
TypeList params_type
Definition: function_traits.h:70
static TRet apply(TRet(*fp)(), TypeValueList< params_type > &args)
Definition: function_traits.h:71
TRet return_type
Definition: function_traits.h:82
TypeList< P1 > params_type
Definition: function_traits.h:83
static TRet apply(TRet(*fp)(P1), TypeValueList< params_type > &args)
Definition: function_traits.h:84
static TRet apply(TRet(*fp)(T1, T2, T3, T4, T5, T6, T7, T8), TypeValueList< params_type > &args)
Definition: function_traits.h:177
TypeList< T1, T2, T3, T4, T5, T6, T7, T8 > params_type
Definition: function_traits.h:176
static TRet apply(TRet(*fp)(T1, T2, T3, T4, T5, T6, T7), TypeValueList< params_type > &args)
Definition: function_traits.h:163
TypeList< T1, T2, T3, T4, T5, T6, T7 > params_type
Definition: function_traits.h:162
static TRet apply(TRet(*fp)(T1, T2, T3, T4, T5, T6), TypeValueList< params_type > &args)
Definition: function_traits.h:149
TypeList< T1, T2, T3, T4, T5, T6 > params_type
Definition: function_traits.h:148
TRet return_type
Definition: function_traits.h:147
TRet return_type
Definition: function_traits.h:133
static TRet apply(TRet(*fp)(T1, T2, T3, T4, T5), TypeValueList< params_type > &args)
Definition: function_traits.h:135
TypeList< T1, T2, T3, T4, T5 > params_type
Definition: function_traits.h:134
TypeList< T1, T2, T3, T4, T5, T6, T7, T8, T9, T10 > params_type
Definition: function_traits.h:207
static TRet apply(TRet(*fp)(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10), TypeValueList< params_type > &args)
Definition: function_traits.h:208
TypeList< T1, T2, T3, T4, T5, T6, T7, T8, T9 > params_type
Definition: function_traits.h:191
static TRet apply(TRet(*fp)(T1, T2, T3, T4, T5, T6, T7, T8, T9), TypeValueList< params_type > &args)
Definition: function_traits.h:192
TypeList< T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11 > params_type
Definition: function_traits.h:224
static TRet apply(TRet(*fp)(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11), TypeValueList< params_type > &args)
Definition: function_traits.h:225
static TRet apply(TRet(*fp)(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12), TypeValueList< params_type > &args)
Definition: function_traits.h:242
TypeList< T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12 > params_type
Definition: function_traits.h:241
TRet return_type
Definition: function_traits.h:120
static TRet apply(TRet(*fp)(T1, T2, T3, T4), TypeValueList< params_type > &args)
Definition: function_traits.h:122
TypeList< T1, T2, T3, T4 > params_type
Definition: function_traits.h:121
static TRet apply(TRet(*fp)(T1, T2, T3), TypeValueList< params_type > &args)
Definition: function_traits.h:109
TypeList< T1, T2, T3 > params_type
Definition: function_traits.h:108
TRet return_type
Definition: function_traits.h:107
TypeList< T1, T2 > params_type
Definition: function_traits.h:96
TRet return_type
Definition: function_traits.h:95
static TRet apply(TRet(*fp)(T1, T2), TypeValueList< params_type > &args)
Definition: function_traits.h:97
TypeList params_type
Definition: function_traits.h:401
static TRet apply(TRet(TClass::*fp)() const, const TClass *obj, TypeValueList< params_type > &args)
Definition: function_traits.h:402
FUNC_TRAITS_GENERAL_CONST_MEMBER
Definition: function_traits.h:400
static TRet apply(TRet(TClass::*fp)(), TClass *obj, TypeValueList< params_type > &args)
Definition: function_traits.h:268
TypeList params_type
Definition: function_traits.h:267
FUNC_TRAITS_GENERAL_NON_CONST_MEMBER
Definition: function_traits.h:266
TypeList< P1 > params_type
Definition: function_traits.h:413
FUNC_TRAITS_GENERAL_CONST_MEMBER
Definition: function_traits.h:412
static TRet apply(TRet(TClass::*fp)(P1) const, const TClass *obj, TypeValueList< params_type > &args)
Definition: function_traits.h:414
static TRet apply(TRet(TClass::*fp)(P1), TClass *obj, TypeValueList< params_type > &args)
Definition: function_traits.h:280
TypeList< P1 > params_type
Definition: function_traits.h:279
FUNC_TRAITS_GENERAL_NON_CONST_MEMBER
Definition: function_traits.h:278
TypeList< T1, T2, T3, T4, T5, T6, T7, T8, T9 > params_type
Definition: function_traits.h:511
static TRet apply(TRet(TClass::*fp)(T1, T2, T3, T4, T5, T6, T7, T8, T9) const, const TClass *obj, TypeValueList< params_type > &args)
Definition: function_traits.h:512
static TRet apply(TRet(TClass::*fp)(T1, T2, T3, T4, T5, T6, T7, T8), TClass *obj, TypeValueList< params_type > &args)
Definition: function_traits.h:365
TypeList< T1, T2, T3, T4, T5, T6, T7, T8 > params_type
Definition: function_traits.h:364
static TRet apply(TRet(TClass::*fp)(T1, T2, T3, T4, T5, T6, T7, T8) const, const TClass *obj, TypeValueList< params_type > &args)
Definition: function_traits.h:499
TypeList< T1, T2, T3, T4, T5, T6, T7, T8 > params_type
Definition: function_traits.h:498
TypeList< T1, T2, T3, T4, T5, T6, T7, T8, T9 > params_type
Definition: function_traits.h:377
static TRet apply(TRet(TClass::*fp)(T1, T2, T3, T4, T5, T6, T7, T8, T9), TClass *obj, TypeValueList< params_type > &args)
Definition: function_traits.h:378
static TRet apply(TRet(TClass::*fp)(T1, T2, T3, T4, T5, T6, T7), TClass *obj, TypeValueList< params_type > &args)
Definition: function_traits.h:352
TypeList< T1, T2, T3, T4, T5, T6, T7 > params_type
Definition: function_traits.h:351
TypeList< T1, T2, T3, T4, T5, T6 > params_type
Definition: function_traits.h:472
static TRet apply(TRet(TClass::*fp)(T1, T2, T3, T4, T5, T6) const, const TClass *obj, TypeValueList< params_type > &args)
Definition: function_traits.h:473
static TRet apply(TRet(TClass::*fp)(T1, T2, T3, T4, T5, T6, T7) const, const TClass *obj, TypeValueList< params_type > &args)
Definition: function_traits.h:486
TypeList< T1, T2, T3, T4, T5, T6, T7 > params_type
Definition: function_traits.h:485
TypeList< T1, T2, T3, T4, T5, T6 > params_type
Definition: function_traits.h:338
static TRet apply(TRet(TClass::*fp)(T1, T2, T3, T4, T5, T6), TClass *obj, TypeValueList< params_type > &args)
Definition: function_traits.h:339
FUNC_TRAITS_GENERAL_NON_CONST_MEMBER
Definition: function_traits.h:337
static TRet apply(TRet(TClass::*fp)(T1, T2, T3, T4, T5) const, const TClass *obj, TypeValueList< params_type > &args)
Definition: function_traits.h:461
TypeList< T1, T2, T3, T4, T5 > params_type
Definition: function_traits.h:460
TypeList< T1, T2, T3, T4, T5 > params_type
Definition: function_traits.h:326
static TRet apply(TRet(TClass::*fp)(T1, T2, T3, T4, T5), TClass *obj, TypeValueList< params_type > &args)
Definition: function_traits.h:327
FUNC_TRAITS_GENERAL_NON_CONST_MEMBER
Definition: function_traits.h:325
TypeList< T1, T2, T3, T4 > params_type
Definition: function_traits.h:448
static TRet apply(TRet(TClass::*fp)(T1, T2, T3, T4) const, const TClass *obj, TypeValueList< params_type > &args)
Definition: function_traits.h:449
FUNC_TRAITS_GENERAL_NON_CONST_MEMBER
Definition: function_traits.h:313
TypeList< T1, T2, T3, T4 > params_type
Definition: function_traits.h:314
static TRet apply(TRet(TClass::*fp)(T1, T2, T3, T4), TClass *obj, TypeValueList< params_type > &args)
Definition: function_traits.h:315
TypeList< T1, T2, T3 > params_type
Definition: function_traits.h:436
static TRet apply(TRet(TClass::*fp)(T1, T2, T3) const, const TClass *obj, TypeValueList< params_type > &args)
Definition: function_traits.h:437
FUNC_TRAITS_GENERAL_CONST_MEMBER
Definition: function_traits.h:435
FUNC_TRAITS_GENERAL_NON_CONST_MEMBER
Definition: function_traits.h:301
TypeList< T1, T2, T3 > params_type
Definition: function_traits.h:302
static TRet apply(TRet(TClass::*fp)(T1, T2, T3), TClass *obj, TypeValueList< params_type > &args)
Definition: function_traits.h:303
TypeList< T1, T2 > params_type
Definition: function_traits.h:425
FUNC_TRAITS_GENERAL_CONST_MEMBER
Definition: function_traits.h:424
static TRet apply(TRet(TClass::*fp)(T1, T2) const, const TClass *obj, TypeValueList< params_type > &args)
Definition: function_traits.h:426
TypeList< T1, T2 > params_type
Definition: function_traits.h:291
FUNC_TRAITS_GENERAL_NON_CONST_MEMBER
Definition: function_traits.h:290
static TRet apply(TRet(TClass::*fp)(T1, T2), TClass *obj, TypeValueList< params_type > &args)
Definition: function_traits.h:292
Definition: function_traits.h:59