Arduino Libraries
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
accumulator.hpp
Go to the documentation of this file.
1 // Author: Mario S. Könz <mskoenz@gmx.net>
2 // Date: 20.07.2013 11:27:21 EDT
3 // File: accumulator.hpp
4 
5 /* This program is free software. It comes without any warranty, to
6  * the extent permitted by applicable law. You can redistribute it
7  * and/or modify it under the terms of the Do What The Fuck You Want
8  * To Public License, Version 2, as published by Sam Hocevar. See
9  * http://www.wtfpl.net/ or COPYING for more details. */
10 
11 #ifndef __ACCUMULATOR_HEADER
12 #define __ACCUMULATOR_HEADER
13 
14 #include "accumulator/tags.hpp"
21 
22 
23 namespace ustd {
24  namespace detail {
25  template<typename item, typename next_item>
26  struct add_dependecies_rec {
29  , typename add_dependecies_rec<typename next_item::type
30  , typename next_item::next>::type
31  >::type
32  >::type
33  type;
34  };
35  template<typename item>
36  struct add_dependecies_rec<item, util::list_end> {
37  typedef
40  >::type
41  type;
42  };
43  template<typename list>
44  struct add_dependecies {
45  typedef typename add_dependecies_rec<typename list::type, typename list::next>::type type;
46  };
47  }//end namespace detail
48 
49  template<typename T, typename list>
50  struct accumulator_deriver: accumulator_deriver<T, typename list::next>::type {
51  typedef
52  module<T
53  , typename list::type
54  , typename accumulator_deriver<T
55  , typename list::next
56  >::type
57  >
59  };
60 
61  template<typename T>
62  struct accumulator_deriver<T, util::list_end> {
64  };
65 
66  template< typename T = double
67  , typename T0 = tag::error
68  , typename T1 = void
69  , typename T2 = void
70  , typename T3 = void
71  , typename T4 = void
72  , typename T5 = void
73  , typename T6 = void
74  , typename T7 = void
75  , typename T8 = void
76  , typename T9 = void
77  >
79  , typename util::invert_list<
80  typename util::unique_list<
81  typename detail::add_dependecies<
82  typename util::make_list<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>::type
83  >::type
84  >::type
85  >::type
86  >::type {
87  };
88 }//end namespace ustd
89 #endif //__ACCUMULATOR_HEADER
Definition: tags.hpp:27
Definition: module.hpp:33
Definition: accumulator.hpp:78
Definition: meta_list.hpp:17
Definition: meta_list.hpp:99
Definition: module.hpp:26
accumulator_base< T > type
Definition: accumulator.hpp:63
module< T, typename list::type, typename accumulator_deriver< T, typename list::next >::type > type
Definition: accumulator.hpp:58
Definition: accumulator.hpp:50