OpenFPM_data  0.1.0
Project that contain the implementation and interfaces for basic structure like vectors, grids, graph ... .
 All Data Structures Namespaces Functions Variables Typedefs Friends
copy_fusion_vector.hpp
1 /*
2  * copy_fusion_vector.hpp
3  *
4  * Created on: Nov 1, 2015
5  * Author: i-bird
6  */
7 
8 #ifndef OPENFPM_DATA_SRC_GRID_COPY_FUSION_VECTOR_HPP_
9 #define OPENFPM_DATA_SRC_GRID_COPY_FUSION_VECTOR_HPP_
10 
16 template<typename bfv>
18 {
19  const bfv & src;
20  bfv & dst;
21 
29  inline copy_fusion_vector(const bfv & src, bfv & dst)
30  :src(src),dst(dst){};
31 
32 #ifdef SE_CLASS1
33 
39  inline copy_fusion_vector(const bfv && src, bfv && dst)
40  :src(src),dst(dst)
41  {std::cerr << "Error: " <<__FILE__ << ":" << __LINE__ << " Passing a temporal object\n";};
42 #endif
43 
45  template<typename T>
46  inline void operator()(T& t)
47  {
48  // This is the type of the object we have to copy
49  typedef typename boost::fusion::result_of::at_c<bfv,T::value>::type copy_type;
50 
51  // Remove the reference from the type to copy
52  typedef typename boost::remove_reference<copy_type>::type copy_rtype;
53 
54  meta_copy<copy_rtype> cp(boost::fusion::at_c<T::value>(src),boost::fusion::at_c<T::value>(dst));
55  }
56 };
57 
58 
59 
60 #endif /* OPENFPM_DATA_SRC_GRID_COPY_FUSION_VECTOR_HPP_ */
This class copy general objects.
void operator()(T &t)
It call the copy function for each property.
copy_fusion_vector(const bfv &src, bfv &dst)
constructor
this class is a functor for "for_each" algorithm