OpenFPM_pdata  4.1.0
Project that contain the implementation of distributed structures
map_vector_printers.hpp
1 /*
2  * map_vector_printers.hpp
3  *
4  * Created on: Feb 10, 2019
5  * Author: i-bird
6  */
7 
8 #ifndef MAP_VECTOR_PRINTERS_HPP_
9 #define MAP_VECTOR_PRINTERS_HPP_
10 
11 
22 template<typename vector_type, unsigned int ... prp>
24 {
26  size_t & ele;
27 
30 
31  // stringstream
32  std::stringstream & ss;
33 
34  typedef typename to_boost_vmpl<prp...>::type vprp;
35 
42  inline vector_printer(vector_type & vt, size_t & ele, std::stringstream & ss)
43  :vt(vt),ele(ele),ss(ss)
44  {};
45 
47  template<typename T>
48  inline void operator()(T& t) const
49  {
50  ss << vt.template get<T::value>(ele) << " ";
51  }
52 };
53 
54 
55 #endif /* MAP_VECTOR_PRINTERS_HPP_ */
vector_printer(vector_type &vt, size_t &ele, std::stringstream &ss)
constructor
vector_type & vt
vector to print
this class is a functor for "for_each" algorithm
void operator()(T &t) const
It call the copy function for each property.
size_t & ele
element to print
Distributed vector.