OpenFPM_pdata  4.1.0
Project that contain the implementation of distributed structures
 
Loading...
Searching...
No Matches
has_pack_agg.hpp
1/*
2 * has_pack_agg.hpp
3 *
4 * Created on: Feb 10, 2016
5 * Author: yaroslav
6 */
7
8#ifndef SRC_PACKER_UNPACKER_HAS_PACK_AGG_HPP_
9#define SRC_PACKER_UNPACKER_HAS_PACK_AGG_HPP_
10
11#include "prp_all_zero.hpp"
12#include "Vector/vect_isel.hpp"
13#include "Vector/util.hpp"
14
23#include <boost/fusion/mpl.hpp>
24
26
28template<class T, size_t N , typename result_p ,class vprp>
30{
31 typedef typename boost::mpl::at<vprp,typename boost::mpl::int_<N-1>>::type vprp_N;
32 typedef typename boost::mpl::at<typename T::type,vprp_N>::type stype;
33
34 typedef boost::mpl::int_<(is_vector<stype>::value ||
37
38 typedef typename boost::mpl::bool_< crh_cond::value | result_p::value> result_n;
39 typedef typename is_complex_agg_impl<T,N-1,result_n,vprp>::result result;
40};
41
43template<class T, typename result_p, class vprp>
44struct is_complex_agg_impl<T,0,result_p,vprp>
45{
46 typedef boost::mpl::bool_<result_p::value> result;
47// typedef std::vector<result_p::value> fail;
48};
49
51
53template<class T, size_t N , typename result_p ,class vprp>
55{
56 typedef typename boost::mpl::at<vprp,typename boost::mpl::int_<N-1>>::type vprp_N;
57 typedef typename boost::mpl::at<typename T::type,vprp_N>::type stype;
58 typedef typename boost::mpl::bool_<has_pack<stype>::value | result_p::value> result_n;
59 typedef typename has_pack_agg_impl<T,N-1,result_n,vprp>::result result;
60};
61
63template<class T, typename result_p, class vprp>
64struct has_pack_agg_impl<T,0,result_p,vprp>
65{
66 typedef boost::mpl::bool_<result_p::value> result;
67// typedef std::vector<result_p::value> fail;
68};
69
70template<typename T, int np>
72{
73 enum
74 {
75 value = np
76 };
77};
78
80template<typename T>
81struct number_prop<T,0>
82{
83 enum
84 {
85 value = T::max_prop
86 };
87};
88
90template<class T, int ... prp>
92{
93 typedef typename prp_all_zero<T,sizeof...(prp) == 0,prp...>::type vprp;
94
96 typedef typename has_pack_agg_impl<T,number_prop<T,sizeof ... (prp)>::value, boost::mpl::bool_<false> , vprp>::result result;
97};
98
100template<class T, int ... prp>
102{
103 typedef typename prp_all_zero<T,sizeof...(prp) == 0,prp...>::type vprp;
104
106 typedef typename is_complex_agg_impl<T,number_prop<T,sizeof ... (prp)>::value, boost::mpl::bool_<false> , vprp>::result result;
107};
108
110template<class T, unsigned int sel = openfpm::vect_isel<T>::value == OPENFPM_NATIVE>
112{
113 enum
114 {
116 };
117};
118
120template<class T>
121struct has_pack_gen<T, false>
122{
123 enum
124 {
126 };
127};
128
129
130#endif /* SRC_PACKER_UNPACKER_HAS_PACK_AGG_HPP_ */
Generate the array specializing ArrayHolder.
return if true the aggregate type T has a property that has a complex packing(serialization) method
has_pack_agg_impl< T, number_prop< T, sizeof...(prp)>::value, boost::mpl::bool_< false >, vprp >::result result
typedef typename to_boost_vmpl<prp...>::type vprp;
It return true if the object T require complex serialization.
has_Pack check if a type has defined a method called Pack
Definition common.hpp:240
These set of classes generate an array definition at compile-time.
return if true the aggregate type T has a property that has a complex packing(serialization) method
is_complex_agg_impl< T, number_prop< T, sizeof...(prp)>::value, boost::mpl::bool_< false >, vprp >::result result
typedef typename to_boost_vmpl<prp...>::type vprp;
Check this is a gpu or cpu type cell-list.
Definition util.hpp:74
Structure to convert a variadic template into boost::mpl::vector.