OpenFPM_pdata  4.1.0
Project that contain the implementation of distributed structures
 
Loading...
Searching...
No Matches
object_creator< v, prp > Struct Template Reference

It create a boost::fusion vector with the selected properties. More...

Detailed Description

template<typename v, int... prp>
struct object_creator< v, prp >

It create a boost::fusion vector with the selected properties.

Template Parameters
vboost::fusion::vector
prpselected properties

Create a compile-time object and copy <em>from</em> the selected properties

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.

Create a compile-time Encap object and copy <em>from</em> the selected properties

v_point.resize(2);
v_point_red.resize(2);
v_point.template get<p::x>(0) = 1.0;
v_point.template get<p::y>(0) = 2.0;
for (size_t i = 0 ; i < 3 ; i++)
v_point.template get<p::v>(0)[i] = i + 5.0;
auto src_e = v_point.get(0);
auto dst_e = v_point_red.get(0);
BOOST_REQUIRE_EQUAL(v_point_red.get(0).template get<0>(),1.0);
BOOST_REQUIRE_EQUAL(v_point_red.get(0).template get<1>(),2.0);
for (size_t i = 0 ; i < 3 ; i++)
BOOST_REQUIRE_EQUAL(v_point_red.get(0).template get<2>()[i],i + 5.0);
Implementation of 1-D std::vector like structure.

Create a compile-time object and copy <em>to</em> the selected properties

\snipper util_test.hpp object write example

Create a compile-time Encap object and copy <em>to</em> the selected properties

\snipper util_test.hpp object write encap example

Definition at line 255 of file object_creator.hpp.

#include <object_creator.hpp>

Public Types

typedef boost::fusion::result_of::as_vector< typenameobject_creator_impl< v, boost::mpl::vector<>, prp... >::type >::type type
 

Member Typedef Documentation

◆ type

template<typename v , int... prp>
typedef boost::fusion::result_of::as_vector<typenameobject_creator_impl<v,boost::mpl::vector<>,prp...>::type>::type object_creator< v, prp >::type

Definition at line 257 of file object_creator.hpp.


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