OpenFPM_pdata  4.1.0
Project that contain the implementation of distributed structures
 
Loading...
Searching...
No Matches
object_s_di< v_src, v_dst, OBJ_NORMAL, prp... > Struct Template Reference

Given a set of properties for the destination (0,1,3,5) it copy the source properties (0,1,2,3) More...

Detailed Description

template<typename v_src, typename v_dst, int... prp>
struct object_s_di< v_src, v_dst, OBJ_NORMAL, prp... >

Given a set of properties for the destination (0,1,3,5) it copy the source properties (0,1,2,3)

Object copy example

typedef Point_test<float> p;
typedef Point_test<float>::type vboost;
typedef object_creator<Point_test<float>::type,0,1,4>::type vboost_red;
// fill the source properties x,y,v = 0,1,4 with data
boost::fusion::at_c<p::x>(src.data) = 1.0;
boost::fusion::at_c<p::y>(src.data) = 2.0;
for (size_t i = 0 ; i < 3 ; i++)
boost::fusion::at_c<p::v>(src.data)[i] = i + 5.0;
// copy from src to dst
object_si_d<object<vboost>,object<vboost_red>,OBJ_NORMAL,0,1,4>(src,dst);
// Check the result
BOOST_REQUIRE_EQUAL(boost::fusion::at_c<0>(dst.data),1.0);
BOOST_REQUIRE_EQUAL(boost::fusion::at_c<1>(dst.data),2.0);
for (size_t i = 0 ; i < 3 ; i++)
BOOST_REQUIRE_EQUAL(boost::fusion::at_c<2>(dst.data)[i],i + 5.0);
Test structure used for several test.
boost::fusion::vector< T, T, T, T, T[3], T[3][3]> type
declaration of what the Point_test store
It create a boost::fusion vector with the selected properties.
It copy the properties from one object to another.
This is a container to create a general object.

Definition at line 424 of file object_s_di.hpp.

#include <object_s_di.hpp>

Public Member Functions

 object_s_di (const v_src &&vs, v_dst &&vd)
 Implementation of the copy.
 
 object_s_di (const v_src &vs, v_dst &vd)
 Implementation of the copy.
 

Constructor & Destructor Documentation

◆ object_s_di() [1/2]

template<typename v_src , typename v_dst , int... prp>
object_s_di< v_src, v_dst, OBJ_NORMAL, prp... >::object_s_di ( const v_src &&  vs,
v_dst &&  vd 
)
inline

Implementation of the copy.

Parameters
vssource object
vddestination object

Definition at line 432 of file object_s_di.hpp.

◆ object_s_di() [2/2]

template<typename v_src , typename v_dst , int... prp>
object_s_di< v_src, v_dst, OBJ_NORMAL, prp... >::object_s_di ( const v_src &  vs,
v_dst &  vd 
)
inline

Implementation of the copy.

Parameters
vssource object
vddestination object

Definition at line 444 of file object_s_di.hpp.


The documentation for this struct was generated from the following file: