8 #ifndef OPENFPM_DATA_SRC_UTIL_COPY_GENERAL_HPP_
9 #define OPENFPM_DATA_SRC_UTIL_COPY_GENERAL_HPP_
11 #include "util/common.hpp"
12 #include "util/util_debug.hpp"
13 #include "copy_compare_aggregates.hpp"
14 #include "util/for_each_ref.hpp"
15 #include <boost/mpl/range_c.hpp>
24 template<
typename Tdst,
typename Tsrc>
33 static inline void operation(Tdst & dst,
const Tsrc & src)
45 template<
typename Tdst,
typename Tsrc>
54 static inline void operation(Tdst & dst,
const Tsrc & src)
66 template<
typename Tdst,
typename Tsrc>
75 static inline void operation(Tdst & dst,
const Tsrc & src)
86 template<typename T, unsigned int agg=2 * is_openfpm_native<T>::value + std::is_copy_assignable<T>::value>
97 std::cerr <<
"Error: " << __FILE__ <<
":" << __LINE__ <<
" " << demangle(
typeid(T).name()) <<
" does not have an operator= and is not an aggregate or an openfpm native structure, copy is not possible" <<
"\n";
131 boost::mpl::for_each_ref<boost::mpl::range_c<int,0,T::max_prop>>(cp);
158 template<
template<
typename,
typename>
class op,
typename T,
unsigned int agg=2 *
is_openfpm_native<T>::value + std::is_copy_assignable<T>::value>
169 std::cerr <<
"Error: " << __FILE__ <<
":" << __LINE__ <<
" " << demangle(
typeid(T).name()) <<
" does not have an operator= and is not an aggregate or an openfpm native structure, copy is not possible" <<
"\n";
174 template<
template<
typename,
typename>
class op,
typename T>
185 op<T,T>::operation(dst,src);
190 template<
template<
typename,
typename>
class op,
typename T>
203 boost::mpl::for_each_ref<boost::mpl::range_c<int,0,T::max_prop>>(cp);
208 template<
template<
typename,
typename>
class op,
typename T>
219 op<T,T>::operation(dst,src);
Structure to copy aggregates.
structure to copy aggregates applying an operation
This structure define the operation add to use with copy general.
copy_general(const T &src, T &dst)
copy objects that has an operator= (implicit or explicit)
structure to copy aggregates
copy_general_op(const T &src, T &dst)
copy objects that has an operator= (implicit or explicit)
This structure define the operation add to use with copy general.
static void operation(Tdst &dst, const Tsrc &src)
Defition of the add operation.
Structure to copy aggregates applying an operation.
copy_general(const T &src, T &dst)
copy objects that are aggregates but define an operator=
static void operation(Tdst &dst, const Tsrc &src)
Defition of the replace operation.
is_openfpm_native check if a type is an openfpm native structure type
copy_general_op(const T &src, T &dst)
copy objects that are aggregates
copy_general_op(const T &src, T &dst)
copy objects that are aggregates but define an operator=
copy_general_op(const T &src, T &dst)
Specialization when there is unknown copy method.
static void operation(Tdst &dst, const Tsrc &src)
Defition of the add operation.
copy_general(const T &src, T &dst)
Specialization when there is unknown copy method.
This structure define the operation add to use with copy general.
copy_general(const T &src, T &dst)
copy objects that are aggregates