8 #ifndef OBJECT_WRITE_HPP_
9 #define OBJECT_WRITE_HPP_
12 #include "for_each_ref.hpp"
13 #include "util/variadic_to_vmpl.hpp"
14 #include "util/copy_compare/meta_copy.hpp"
15 #include <boost/mpl/range_c.hpp>
16 #include <boost/fusion/include/size.hpp>
29 template<
typename v_src,
typename v_dst,
int... prp>
61 {std::cerr <<
"Error: " <<__FILE__ <<
":" << __LINE__ <<
" Passing a temporal object\n";};
68 typedef typename boost::mpl::at<typename v_dst::type,typename boost::mpl::int_<boost::mpl::at<v_prp,boost::mpl::int_<T::value>>::type::value>>::type ctype;
70 meta_copy<ctype>(src.template get<T::value>(),dst.template
get<boost::mpl::at<v_prp,boost::mpl::int_<T::value>>::type::value>());
86 template<
typename v_src,
typename v_dst,
int... prp>
118 {std::cerr <<
"Error: " <<__FILE__ <<
":" << __LINE__ <<
" Passing a temporal object\n";};
125 typedef typename boost::mpl::at<typename v_dst::type,typename boost::mpl::int_<boost::mpl::at<v_prp,boost::mpl::int_<T::value>>::type::value>>::type ctype;
127 meta_copy<ctype>(boost::fusion::at_c<T::value>(src.data),boost::fusion::at_c<boost::mpl::at<v_prp,boost::mpl::int_<T::value>>::type::value>(dst.data));
142 template<
typename v_src,
typename v_dst,
int type_copy,
int... prp>
147 std::cerr <<
"Error object_copy: " << __FILE__ <<
" " << __LINE__ <<
"\n";
158 template<
typename v_src,
typename v_dst,
int... prp>
164 boost::mpl::for_each_ref< boost::mpl::range_c<int,0,
sizeof...(prp)> >(obj);
170 boost::mpl::for_each_ref< boost::mpl::range_c<int,0,
sizeof...(prp)> >(obj);
188 template<
typename v_src,
typename v_dst,
int... prp>
194 boost::mpl::for_each_ref< boost::mpl::range_c<int,0,
sizeof...(prp)> >(obj);
200 boost::mpl::for_each_ref< boost::mpl::range_c<int,0,
sizeof...(prp)> >(obj);
It copy the properties from one object to another.
void operator()(T &t)
It call the functor for each member.
this class is a functor for "for_each" algorithm
object_s_di_f(const v_src &src, v_dst &dst)
Constructor.
object_s_di_e(const v_src &src, v_dst &dst)
Constructor.
void operator()(T &t)
It call the functor for each member.
this class is a functor for "for_each" algorithm