11 #include "util/for_each_ref.hpp"
12 #include "util/copy_compare/meta_copy.hpp"
13 #include "boost/mpl/range_c.hpp"
14 #include <boost/fusion/container/vector.hpp>
16 #include "Memleak_check.hpp"
18 #include "util/se_util.hpp"
19 #include "util/copy_compare/copy_fusion_vector.hpp"
20 #include "util/copy_compare/compare_fusion_vector.hpp"
33 template<
typename e_src,
typename e_dst>
56 if (e_src::max_prop != e_dst::max_prop)
57 std::cerr <<
"Error " << __FILE__ <<
":" << __LINE__ <<
" the number of properties between src and dst must match";
71 {std::cerr <<
"Error: " <<__FILE__ <<
":" << __LINE__ <<
" Passing a temporal object";};
79 typedef typename boost::fusion::result_of::at_c<typename e_src::type,T::value>::type copy_type;
82 typedef typename boost::remove_reference<copy_type>::type copy_rtype;
100 template<
typename e_src,
typename e_dst>
123 if (e_src::max_prop != e_dst::max_prop)
124 std::cerr <<
"Error " << __FILE__ <<
":" << __LINE__ <<
" the number of properties between src and dst must match";
138 {std::cerr <<
"Error: " <<__FILE__ <<
":" << __LINE__ <<
" Passing a temporal object";};
146 typedef typename boost::fusion::result_of::at_c<typename e_src::type,T::value>::type copy_type;
149 typedef typename boost::remove_reference<copy_type>::type copy_rtype;
164 template<
unsigned int p,
typename mem>
170 typedef typename boost::fusion::result_of::at< vtype,boost::mpl::int_<p> >
::type type;
182 template<
unsigned int p,
typename Mem>
188 typedef typename boost::fusion::result_of::at< vtype,boost::mpl::int_<p> >
::type rtype;
190 typedef typename boost::remove_reference<rtype>::type
mtype;
192 typedef typename mtype::type
type;
208 template<
unsigned int dim,
typename T,
typename Mem>
212 typedef typename T::type type;
220 typedef int yes_i_am_encap;
224 static const int max_prop = T::max_prop;
227 inline encapc(type & data_c)
251 return boost::fusion::at_c<p>(data_c);
264 return boost::fusion::at_c<p>(data_c);
273 return boost::fusion::at_c<p>(data_c) = ele;
285 boost::mpl::for_each_ref< boost::mpl::range_c<int,0,T::max_prop> >(cp);
299 boost::mpl::for_each_ref< boost::mpl::range_c<int,0,T::max_prop> >(cp);
315 boost::mpl::for_each_ref< boost::mpl::range_c<int,0,T::max_prop> >(cp);
340 template<
unsigned int dim,
typename Mem>
350 template <
unsigned int p>
void get()
354 template <
unsigned int p,
typename S>
void set(S & ele)
369 template<
unsigned int dim,
typename T,
typename Mem>
378 typedef int yes_i_am_encap;
383 encapg(Mem & data,
size_t k)
390 return boost::fusion::at_c<p>(data).mem_r->operator[](k);
396 return boost::fusion::at_c<p>(data).mem_r->operator[](k);
400 #include "util/common.hpp"
402 template<
typename T,
typename Sfinae =
void>
416 struct is_encap<T, typename
Void< typename T::yes_i_am_encap>::type> : std::true_type
void operator()(T &t) const
It call the copy function for each property.
bool operator!=(const encapc< dim, T, Mem > &ec) const
Compare.
this class is a functor for "for_each" algorithm
this class is a functor for "for_each" algorithm
This class is an helper to get the return type for get method for each property.
This class is an helper to get the return type of get for each property.
void operator()(T &t) const
It call the copy function for each property.
Mem vtype
return a boost::fusion::vector<memory_c<....>....>
boost::remove_reference< rtype >::type mtype
remove the reference
const e_src & src
object we have to compare
encapc< dim, T, Mem > & operator=(const T &obj)
Assignment.
bool operator==(const encapc< dim, T, Mem > &ec) const
Compare.
this structure encapsulate an object of the grid
bool result()
Returh the result of the comparison.
encapc< dim, T, Mem > & operator=(const encapc< dim, T, Mem > &ec)
Assignment.
mtype::type type
get the base type that the buffer is storing
compare_cpu_encap_encap(const e_src &src, const e_dst &dst)
constructor
this class is a functor for "for_each" algorithm
this structure encapsulate an object of the grid
boost::fusion::result_of::at< vtype, boost::mpl::int_< p > >::type rtype
return a memory_c<...>
boost::fusion::result_of::at< vtype, boost::mpl::int_< p > >::type type
return a memory_c<...>
type * operator&()
Return the address of the base.
copy_cpu_encap_encap(const e_src &src, e_dst &dst)
constructor
this class is a functor for "for_each" algorithm
const e_src & src
object we have to store
mem::vtype vtype
return a boost::fusion::vector<memory_c<....>....>