OpenFPM_pdata  4.1.0
Project that contain the implementation of distributed structures
 
Loading...
Searching...
No Matches
t_to_memory_c.hpp
1/*
2 * t_to_memory_c.hpp
3 *
4 * Created on: Aug 27, 2014
5 * Author: Pietro Incardona
6 */
7
8#ifndef T_TO_MEMORY_C_HPP_
9#define T_TO_MEMORY_C_HPP_
10
11#include <boost/mpl/int.hpp>
12#include <memory_ly/memory_c.hpp>
13
32#include <boost/type_traits/remove_reference.hpp>
33#include <boost/type_traits/remove_const.hpp>
34
35// First thing the metafunction has to do, is to remove eventually reference and const attribute
36
37template<typename T>
39{
41 typedef typename boost::remove_const <typename boost::remove_reference< T >::type >::type type;
42};
43
45template<typename T>
47{
50};
51
53template<typename T>
55{
58};
59
60
62template<typename T,size_t N1>
63struct t_to_memory_c_impl<T[N1]>
64{
67
69 typedef boost::mpl::vector<T,boost::mpl::int_<N1>> prim_vmpl;
70};
71
73template<typename T,size_t N1>
75{
78
80 typedef boost::mpl::vector<T,boost::mpl::int_<N1>> prim_vmpl;
81};
82
84template<typename T,size_t N1,size_t N2>
85struct t_to_memory_c_impl<T[N1][N2]>
86{
89 boost::mpl::int_<N2>>>> type;
90
91
93 typedef boost::mpl::vector<T,boost::mpl::int_<N1>,
94 boost::mpl::int_<N2>> prim_vmpl;
95};
96
98template<typename T,size_t N1,size_t N2>
99struct t_to_memory_c_red_impl<T[N1][N2]>
100{
103 boost::mpl::int_<N2>>>,MEMORY_C_REDUCED> type;
104
106 typedef boost::mpl::vector<T,boost::mpl::int_<N1>,
107 boost::mpl::int_<N2>> prim_vmpl;
108};
109
111template<typename T,size_t N1,size_t N2,size_t N3>
112struct t_to_memory_c_impl<T[N1][N2][N3]>
113{
116 boost::mpl::int_<N2>,
117 boost::mpl::int_<N3>>>> type;
118};
119
121template<typename T,size_t N1,size_t N2,size_t N3>
122struct t_to_memory_c_red_impl<T[N1][N2][N3]>
123{
126 boost::mpl::int_<N2>,
127 boost::mpl::int_<N3>>>,MEMORY_C_REDUCED> type;
128};
129
131template<typename T,size_t N1,size_t N2,size_t N3,size_t N4>
132struct t_to_memory_c_impl<T[N1][N2][N3][N4]>
133{
136 boost::mpl::int_<N2>,
137 boost::mpl::int_<N3>,
138 boost::mpl::int_<N4>>>> type;
139};
140
142template<typename T,size_t N1,size_t N2,size_t N3,size_t N4>
143struct t_to_memory_c_red_impl<T[N1][N2][N3][N4]>
144{
147 boost::mpl::int_<N2>,
148 boost::mpl::int_<N3>,
149 boost::mpl::int_<N4>>>,MEMORY_C_REDUCED> type;
150};
151
153template<typename T,size_t N1,size_t N2,size_t N3,size_t N4,size_t N5>
154struct t_to_memory_c_impl<T[N1][N2][N3][N4][N5]>
155{
158 boost::mpl::int_<N2>,
159 boost::mpl::int_<N3>,
160 boost::mpl::int_<N4>,
161 boost::mpl::int_<N5>>>> type;
162};
163
165template<typename T,size_t N1,size_t N2,size_t N3,size_t N4,size_t N5>
166struct t_to_memory_c_red_impl<T[N1][N2][N3][N4][N5]>
167{
170 boost::mpl::int_<N2>,
171 boost::mpl::int_<N3>,
172 boost::mpl::int_<N4>,
173 boost::mpl::int_<N5>>>,MEMORY_C_REDUCED> type;
174};
175
177template<typename T,size_t N1,size_t N2,size_t N3,size_t N4,size_t N5, size_t N6>
178struct t_to_memory_c_impl<T[N1][N2][N3][N4][N5][N6]>
179{
182 boost::mpl::int_<N2>,
183 boost::mpl::int_<N3>,
184 boost::mpl::int_<N4>,
185 boost::mpl::int_<N5>,
186 boost::mpl::int_<N6>>>> type;
187};
188
190template<typename T,size_t N1,size_t N2,size_t N3,size_t N4,size_t N5, size_t N6, size_t N7>
191struct t_to_memory_c_impl<T[N1][N2][N3][N4][N5][N6][N7]>
192{
195 boost::mpl::int_<N2>,
196 boost::mpl::int_<N3>,
197 boost::mpl::int_<N4>,
198 boost::mpl::int_<N5>,
199 boost::mpl::int_<N6>,
200 boost::mpl::int_<N7>>>> type;
201};
202
204template<typename T,size_t N1,size_t N2,size_t N3,size_t N4,size_t N5, size_t N6, size_t N7, size_t N8>
205struct t_to_memory_c_impl<T[N1][N2][N3][N4][N5][N6][N7][N8]>
206{
209 boost::mpl::int_<N2>,
210 boost::mpl::int_<N3>,
211 boost::mpl::int_<N4>,
212 boost::mpl::int_<N5>,
213 boost::mpl::int_<N6>,
214 boost::mpl::int_<N7>,
215 boost::mpl::int_<N8>>>> type;
216};
217
219template<typename T,size_t N1,size_t N2,size_t N3,size_t N4,size_t N5, size_t N6, size_t N7, size_t N8, size_t N9>
220struct t_to_memory_c_impl<T[N1][N2][N3][N4][N5][N6][N7][N8][N9]>
221{
224 boost::mpl::int_<N2>,
225 boost::mpl::int_<N3>,
226 boost::mpl::int_<N4>,
227 boost::mpl::int_<N5>,
228 boost::mpl::int_<N6>,
229 boost::mpl::int_<N7>,
230 boost::mpl::int_<N8>,
231 boost::mpl::int_<N9>>>> type;
232};
233
235template<typename T,size_t N1,size_t N2,size_t N3,size_t N4,size_t N5, size_t N6, size_t N7, size_t N8, size_t N9, size_t N10>
236struct t_to_memory_c_impl<T[N1][N2][N3][N4][N5][N6][N7][N8][N9][N10]>
237{
240 boost::mpl::int_<N2>,
241 boost::mpl::int_<N3>,
242 boost::mpl::int_<N4>,
243 boost::mpl::int_<N5>,
244 boost::mpl::int_<N6>,
245 boost::mpl::int_<N7>,
246 boost::mpl::int_<N8>,
247 boost::mpl::int_<N9>,
248 boost::mpl::int_<N10>>>> type;
249};
250
259template<typename T>
261{
263};
264
273template<typename T>
275{
277};
278
279#endif /* T_TO_MEMORY_C_HPP_ */
t_to_memory_c is a metafunction that given T it convert it into
boost::remove_const< typenameboost::remove_reference< T >::type >::type type
remove all attributes const and reference from the type
memory_c< multi_array< boost::mpl::vector< T, boost::mpl::int_< N1 >, boost::mpl::int_< N2 >, boost::mpl::int_< N3 >, boost::mpl::int_< N4 >, boost::mpl::int_< N5 >, boost::mpl::int_< N6 >, boost::mpl::int_< N7 >, boost::mpl::int_< N8 >, boost::mpl::int_< N9 >, boost::mpl::int_< N10 > > > > type
tranform a type T into a memory_c<multi_array<.......>>
memory_c< multi_array< boost::mpl::vector< T, boost::mpl::int_< N1 >, boost::mpl::int_< N2 >, boost::mpl::int_< N3 >, boost::mpl::int_< N4 >, boost::mpl::int_< N5 >, boost::mpl::int_< N6 >, boost::mpl::int_< N7 >, boost::mpl::int_< N8 >, boost::mpl::int_< N9 > > > > type
tranform a type T into a memory_c<multi_array<.......>>
memory_c< multi_array< boost::mpl::vector< T, boost::mpl::int_< N1 >, boost::mpl::int_< N2 >, boost::mpl::int_< N3 >, boost::mpl::int_< N4 >, boost::mpl::int_< N5 >, boost::mpl::int_< N6 >, boost::mpl::int_< N7 >, boost::mpl::int_< N8 > > > > type
tranform a type T into a memory_c<multi_array<.......>>
memory_c< multi_array< boost::mpl::vector< T, boost::mpl::int_< N1 >, boost::mpl::int_< N2 >, boost::mpl::int_< N3 >, boost::mpl::int_< N4 >, boost::mpl::int_< N5 >, boost::mpl::int_< N6 >, boost::mpl::int_< N7 > > > > type
tranform a type T into a memory_c<multi_array<.......>>
memory_c< multi_array< boost::mpl::vector< T, boost::mpl::int_< N1 >, boost::mpl::int_< N2 >, boost::mpl::int_< N3 >, boost::mpl::int_< N4 >, boost::mpl::int_< N5 >, boost::mpl::int_< N6 > > > > type
tranform a type T into a memory_c<multi_array<.......>>
memory_c< multi_array< boost::mpl::vector< T, boost::mpl::int_< N1 >, boost::mpl::int_< N2 >, boost::mpl::int_< N3 >, boost::mpl::int_< N4 >, boost::mpl::int_< N5 > > > > type
tranform a type T into a memory_c<multi_array<.......>>
memory_c< multi_array< boost::mpl::vector< T, boost::mpl::int_< N1 >, boost::mpl::int_< N2 >, boost::mpl::int_< N3 >, boost::mpl::int_< N4 > > > > type
tranform a type T into a memory_c<multi_array<.......>>
memory_c< multi_array< boost::mpl::vector< T, boost::mpl::int_< N1 >, boost::mpl::int_< N2 >, boost::mpl::int_< N3 > > > > type
tranform a type T into a memory_c<multi_array<.......>>
boost::mpl::vector< T, boost::mpl::int_< N1 >, boost::mpl::int_< N2 > > prim_vmpl
the internal array primitive information represented into a boost mpl vector
memory_c< multi_array< boost::mpl::vector< T, boost::mpl::int_< N1 >, boost::mpl::int_< N2 > > > > type
tranform a type T into a memory_c<multi_array<.......>>
boost::mpl::vector< T, boost::mpl::int_< N1 > > prim_vmpl
the internal array primitive information represented into a boost mpl vector
memory_c< multi_array< boost::mpl::vector< T, boost::mpl::int_< N1 > > > > type
transfrom a type T into memory_c<T>
Partial specialization for scalar N=0.
memory_c< T > type
transform a type T into memory_c<T>
memory_c< multi_array< boost::mpl::vector< T, boost::mpl::int_< N1 >, boost::mpl::int_< N2 >, boost::mpl::int_< N3 >, boost::mpl::int_< N4 >, boost::mpl::int_< N5 > > >, MEMORY_C_REDUCED > type
tranform a type T into a memory_c<multi_array<.......>,MEMORY_C_REDUCED>
memory_c< multi_array< boost::mpl::vector< T, boost::mpl::int_< N1 >, boost::mpl::int_< N2 >, boost::mpl::int_< N3 >, boost::mpl::int_< N4 > > >, MEMORY_C_REDUCED > type
tranform a type T into a memory_c<multi_array<.......>,MEMORY_C_REDUCED>
memory_c< multi_array< boost::mpl::vector< T, boost::mpl::int_< N1 >, boost::mpl::int_< N2 >, boost::mpl::int_< N3 > > >, MEMORY_C_REDUCED > type
tranform a type T into a memory_c<multi_array<.......>>
boost::mpl::vector< T, boost::mpl::int_< N1 >, boost::mpl::int_< N2 > > prim_vmpl
the internal array primitive information represented into a boost mpl vector
memory_c< multi_array< boost::mpl::vector< T, boost::mpl::int_< N1 >, boost::mpl::int_< N2 > > >, MEMORY_C_REDUCED > type
transform a type T into a memory_c<multi_array<.......>,MEMORY_C_REDUCED>
memory_c< multi_array< boost::mpl::vector< T, boost::mpl::int_< N1 > > >, MEMORY_C_REDUCED > type
transform a type T into memory_c<T,MEMORY_C_REDUCED>
boost::mpl::vector< T, boost::mpl::int_< N1 > > prim_vmpl
the internal array primitive information represented into a boost mpl vector
Partial specialization for scalar N=0.
memory_c< T, MEMORY_C_REDUCED > type
transform a type T into memory_c<T,MEMORY_C_REDUCED>
Meta-function t_to_memory_c_red.
Meta-function t_to_memory_c.