OpenFPM_pdata  1.1.0
Project that contain the implementation of distributed structures
 All Data Structures Namespaces Functions Variables Typedefs Enumerations Friends Pages
Pack_selector.hpp
1 /*
2  * Pack_selector.hpp
3  *
4  * Created on: Jul 15, 2015
5  * Author: Pietro Incardona
6  */
7 
8 
9 #ifndef SRC_PACK_AAA_SELECTOR_HPP_
10 #define SRC_PACK_AAA_SELECTOR_HPP_
11 
12 #include <type_traits>
13 #include "util/common.hpp"
14 #include "Grid/Encap.hpp"
15 #include "Grid/util.hpp"
16 #include "Vector/util.hpp"
17 #include "Packer_Unpacker/has_pack_agg.hpp"
18 
20 #define PACKER_PRIMITIVE 1
21 #define PACKER_ARRAY_PRIMITIVE 2
23 #define PACKER_ENCAP_OBJECTS 3
25 #define PACKER_GENERAL 4
27 #define PACKER_GRID 5
29 #define PACKER_OBJECTS_WITH_WARNING_POINTERS 6
31 #define PACKER_OBJECTS_WITH_POINTER_CHECK 7
33 
34 #define IS_ENCAP 4
35 #define IS_GRID 2
36 #define HAS_PACKER 1
37 
42 template <typename T, bool has_noPointers>
44 {
45  enum
46  {
47  value = PACKER_OBJECTS_WITH_POINTER_CHECK
48  };
49 };
50 
51 template <typename T>
53 {
54  enum
55  {
56  value = PACKER_OBJECTS_WITH_WARNING_POINTERS
57  };
58 };
59 
64 template <typename T, int known_type>
66 {
67  enum
68  {
70  };
71 };
72 
73 template <typename T>
75 {
76  enum
77  {
78  value = PACKER_GRID
79  };
80 };
81 
82 template <typename T>
83 struct Pack_selector_known_type_impl<T,HAS_PACKER>
84 {
85  enum
86  {
87  value = PACKER_GENERAL
88  };
89 };
90 
91 template <typename T>
93 {
94  enum
95  {
96  value = PACKER_ENCAP_OBJECTS
97  };
98 };
99 
101 
104 template<typename T, bool is_foundamental>
106 {
107  enum
108  {
110  };
111 };
112 
116 template<typename T>
117 struct Pack_selector_impl<T,true>
118 {
119  enum
120  {
121  value = PACKER_PRIMITIVE
122  };
123 };
124 
126 
131 template <typename T>
133 {
134  enum
135  {
137  };
138 };
139 
140 
141 #endif /* SRC_PACK_SELECTOR_HPP_ */
Pack selector for unknown type.
Pack selector.
Definition: util.hpp:14
it is not a fundamental type
It return true if the object T require complex serialization.
Pack selector for unknown type.