8#ifndef OPENFPM_DATA_SRC_UTIL_AGGREGATE_HPP_
9#define OPENFPM_DATA_SRC_UTIL_AGGREGATE_HPP_
11#include <boost/fusion/container/vector.hpp>
12#include <Packer_Unpacker/has_pack_agg.hpp>
13#include "util/copy_compare/copy_compare_aggregates.hpp"
49 {std::cerr <<
"Error: " <<__FILE__ <<
":" << __LINE__ <<
" Passing a temporal object\n";};
57 typedef typename boost::fusion::result_of::at_c<bfv,T::value>::type copy_type;
60 typedef typename boost::remove_reference<copy_type>::type copy_rtype;
68#define SE3_MAX_PROP(i) i+2
69#define SE3_ADD_PROP(i) size_t[i+1],size_t
70#define SE3_SUB_MAX_PROP -2
91 static const unsigned int max_prop = boost::mpl::size<type>::type::value;
92 static const unsigned int max_prop_real = boost::mpl::size<type>::type::value + SE3_SUB_MAX_PROP;
102template<
typename ... list>
105 typedef boost::fusion::vector<list... , SE3_ADD_PROP(
sizeof...(list))>
type;
106 typedef boost::fusion::vector<list... >
type_real;
108 typedef int yes_is_aggregate;
117 this->operator=(aggr);
125 template<
unsigned int i>
typename boost::mpl::at<type,boost::mpl::int_<i>>
::type &
get()
127 return boost::fusion::at_c<i>(
data);
135 template<
unsigned int i>
const typename boost::mpl::at<type,boost::mpl::int_<i>>
::type &
get()
const
137 return boost::fusion::at_c<i>(
data);
153 boost::mpl::for_each_ref< boost::mpl::range_c<
int,0,
sizeof...(list)> >(ca);
158 static const unsigned int max_prop = boost::mpl::size<type>::type::value;
159 static const unsigned int max_prop_real = boost::mpl::size<type>::type::value + SE3_SUB_MAX_PROP;
188 template<
unsigned int i>
typename boost::mpl::at<type,boost::mpl::int_<i>>
::type &
get()
190 return boost::fusion::at_c<i>(
data);
198 template<
unsigned int i>
const typename boost::mpl::at<type,boost::mpl::int_<i>>
::type &
get()
const
200 return boost::fusion::at_c<i>(
data);
203 static const unsigned int max_prop = boost::mpl::size<type>::type::value;
213template<
typename ... list>
217 typedef boost::fusion::vector<list...>
type;
222 typedef int yes_is_aggregate;
232 this->operator=(aggr);
240 template<
unsigned int i> __device__ __host__
typename boost::mpl::at<type,boost::mpl::int_<i>>
::type &
get()
242 return boost::fusion::at_c<i>(
data);
259 template<
unsigned int i> __device__ __host__
const typename boost::mpl::at<type,boost::mpl::int_<i>>
::type &
get()
const
261 return boost::fusion::at_c<i>(
data);
268 boost::mpl::for_each_ref< boost::mpl::range_c<int,0,
sizeof...(list)> >(ca);
273 static const unsigned int max_prop = boost::mpl::size<type>::type::value;
274 static const unsigned int max_prop_real = boost::mpl::size<type>::type::value;
279template<
typename T,
typename Sfinae =
void>
294 template<
unsigned int p,
typename aggr>
295 auto at_c(aggr & agg) ->
decltype(boost::fusion::at_c<p>(agg.data))
297 return boost::fusion::at_c<p>(agg.data);
300 template<
unsigned int p,
typename aggr>
301 auto get(aggr & agg) ->
decltype(boost::fusion::at_c<p>(agg.data))
303 return boost::fusion::at_c<p>(agg.data);
307template<
typename BlockT,
typename T>
312template<
typename BlockT,
typename ... list>
KeyT const ValueT ValueT OffsetIteratorT OffsetIteratorT int
[in] The number of segments that comprise the sorting data
convert a type into constant type
An aggregate that accept a boost fusion vector as type.
boost::mpl::at< type, boost::mpl::int_< i > >::type & get()
get the properties i
T type
type the object store
const boost::mpl::at< type, boost::mpl::int_< i > >::type & get() const
get the properties i
T type_real
real type the object store
aggregate of properties, from a list of object if create a struct that follow the OPENFPM native stru...
static bool noPointers()
it return false if this aggregate has no pointers
__device__ __host__ boost::mpl::at< type, boost::mpl::int_< i > >::type & get()
get the properties i
boost::fusion::vector< list... > type_real
real internal type containing the data
__device__ __host__ const boost::mpl::at< type, boost::mpl::int_< i > >::type & get() const
get the properties i
boost::fusion::vector< list... > type
internal type containing the data
this class is a functor for "for_each" algorithm
bfv & dst
destination fusion vector
__device__ __host__ copy_fusion_vector(const bfv &src, bfv &dst)
constructor
__device__ __host__ void operator()(T &t)
It call the copy function for each property.
const bfv & src
source fusion vector
It return true if the object T require complex serialization.