8#ifndef OBJECT_SI_D_HPP_
9#define OBJECT_SI_D_HPP_
11#include "for_each_ref.hpp"
12#include <boost/mpl/range_c.hpp>
13#include <boost/fusion/include/size.hpp>
26template<
typename v_src,
typename v_dst,
int... prp>
53 typedef decltype(
src.template get<boost::mpl::at<v_prp,boost::mpl::int_<T::value>>::type::value>()) stype;
65 template<
unsigned int T_value,
typename v_prp,
typename ctype,
typename Tsrc,
typename Tdst>
66 static inline void copy(
const Tsrc & src, Tdst & dst,
int sub_id)
68 meta_copy<ctype>::meta_copy_(src.template get<boost::mpl::at<v_prp,boost::mpl::int_<T_value>>::type::value>()[sub_id],dst.template get<T_value>());
72template<
unsigned int N1,
typename T>
75 template<
unsigned int T_value,
typename v_prp,
typename ctype,
typename Tsrc,
typename Tdst>
76 static inline void copy(
const Tsrc & src, Tdst & dst,
int sub_id)
78 for (
int i = 0 ; i < N1 ; i++)
80 meta_copy<T>::meta_copy_(src.template get<boost::mpl::at<v_prp,boost::mpl::int_<T_value>>::type::value>()[i][sub_id],dst.template get<T_value>()[i]);
96template<
typename v_src,
typename v_dst,
int... prp>
118 :src(src),dst(dst),sub_id(sub_id)
126 typedef typename boost::mpl::at<typename v_dst::type,typename boost::mpl::int_<T::value>>::type ctype;
143template<
typename v_src,
typename v_dst,
int... prp>
170 typedef typename boost::mpl::at<typename v_dst::type,typename boost::mpl::int_<T::value>>::type ctype;
172 meta_copy<ctype>::meta_copy_(boost::fusion::at_c<boost::mpl::at<v_prp,boost::mpl::int_<T::value>>::type::value>(src.data),boost::fusion::at_c<T::value>(dst.data));
178#define OBJ_ENCAP_CHUNKING 3
188template<
typename v_src,
typename v_dst,
int type_copy,
int... prp>
193 std::cerr <<
"Error object_copy: " << __FILE__ <<
" " << __LINE__ <<
"\n";
206template<
typename v_src,
typename v_dst,
int... prp>
212 boost::mpl::for_each_ref< boost::mpl::range_c<int,0,v_dst::max_prop> >(obj);
218 boost::mpl::for_each_ref< boost::mpl::range_c<int,0,v_dst::max_prop> >(obj);
236template<
typename v_src,
typename v_dst,
int... prp>
239 __device__ __host__
inline object_si_d(
const v_src && vs, v_dst && vd)
242 boost::mpl::for_each_ref< boost::mpl::range_c<int,0,v_dst::max_prop> >(obj);
245 __device__ __host__
inline object_si_d(
const v_src & vs, v_dst & vd)
248 boost::mpl::for_each_ref< boost::mpl::range_c<int,0,v_dst::max_prop> >(obj);
267template<
typename v_src,
typename v_dst,
int... prp>
270 inline object_si_d(
const v_src && vs,
size_t sub_id, v_dst && vd)
273 boost::mpl::for_each_ref< boost::mpl::range_c<int,0,v_dst::max_prop> >(obj);
276 inline object_si_d(
const v_src & vs,
size_t sub_id, v_dst & vd)
279 boost::mpl::for_each_ref< boost::mpl::range_c<int,0,v_dst::max_prop> >(obj);
283template<
typename v_src,
typename v_dst>
286 __device__ __host__
inline object_si_d(
const v_src && vs, v_dst && vd)
290 __device__ __host__
inline object_si_d(
const v_src & vs, v_dst & vd)
this class is a functor for "for_each" algorithm
void operator()(T &t)
It call the functor for each member.
object_si_d_e_cnk(const v_src &src, size_t sub_id, v_dst &dst)
Constructor.
this class is a functor for "for_each" algorithm
v_dst & dst
Destination object.
__device__ __host__ void operator()(T &t)
It call the functor for each member.
to_boost_vmpl< prp... >::type v_prp
Convert the packed properties into an MPL vector.
const v_src & src
Source object.
__device__ __host__ object_si_d_e(const v_src &src, v_dst &dst)
Constructor.
this class is a functor for "for_each" algorithm
object_si_d_f(const v_src &src, v_dst &dst)
Constructor.
void operator()(T &t)
It call the functor for each member.
It copy the properties from one object to another.