OpenFPM_data  0.1.0
Project that contain the implementation and interfaces for basic structure like vectors, grids, graph ... .
 All Data Structures Namespaces Functions Variables Typedefs Friends
aggregate.hpp
1 /*
2  * aggregate.hpp
3  *
4  * Created on: Oct 31, 2015
5  * Author: i-bird
6  */
7 
8 #ifndef OPENFPM_DATA_SRC_UTIL_AGGREGATE_HPP_
9 #define OPENFPM_DATA_SRC_UTIL_AGGREGATE_HPP_
10 
11 #include <boost/fusion/container/vector.hpp>
12 
20 template<typename ... list>
21 struct aggregate
22 {
23  typedef boost::fusion::vector<list...> type;
24 
25  type data;
26 
32  template<unsigned int i> typename boost::mpl::at<type,boost::mpl::int_<i>>::type & get()
33  {
34  return boost::fusion::at_c<i>(data);
35  }
36 
42  template<unsigned int i> const typename boost::mpl::at<type,boost::mpl::int_<i>>::type & get() const
43  {
44  return boost::fusion::at_c<i>(data);
45  }
46 
47  aggregate<list...> & operator=(aggregate<list...> & ag) = delete;
48 
49  static const unsigned int max_prop = boost::mpl::size<type>::type::value;
50 };
51 
52 
53 #endif /* OPENFPM_DATA_SRC_UTIL_AGGREGATE_HPP_ */
aggregate of properties, from a list of object if create a struct that follow the OPENFPM native stru...
Definition: aggregate.hpp:21