OpenFPM_pdata  4.1.0
Project that contain the implementation of distributed structures
 
Loading...
Searching...
No Matches
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 "memory_ly/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
22#define PACKER_ARRAY_PRIMITIVE 2
24#define PACKER_ENCAP_OBJECTS 3
26#define PACKER_GENERAL 4
28#define PACKER_GRID 5
30#define PACKER_OBJECTS_WITH_WARNING_POINTERS 6
32#define PACKER_OBJECTS_WITH_POINTER_CHECK 7
34#define PACKER_ARRAY_CP_PRIMITIVE 8
36#define PACKER_ENCAP_OBJECTS_CHUNKING 9
37
38#define IS_ENCAP 4
39#define IS_GRID 2
40#define HAS_PACKER 1
41
46template <typename T, int has_noPointers>
48{
49 enum
50 {
51 value = PACKER_OBJECTS_WITH_POINTER_CHECK
52 };
53};
54
55template <typename T>
57{
58 enum
59 {
60 value = PACKER_OBJECTS_WITH_WARNING_POINTERS
61 };
62};
63
68template <typename T>
70{
71 enum
72 {
73 value = PACKER_ARRAY_CP_PRIMITIVE
74 };
75};
76
77template <typename T>
79{
80 enum
81 {
82 value = PACKER_ARRAY_CP_PRIMITIVE
83 };
84};
85
90template <typename T, int known_type>
92{
93 enum
94 {
95 value = Pack_selector_unknown_type_impl<T, has_noPointers<T>::value + 2*std::is_array<T>::value >::value
96 };
97};
98
99template <typename T>
101{
102 enum
103 {
104 value = PACKER_GRID
105 };
106};
107
108template <typename T>
110{
111 enum
112 {
113 value = PACKER_GENERAL
114 };
115};
116
117template <typename T>
119{
120 enum
121 {
122 value = PACKER_ENCAP_OBJECTS
123 };
124};
125
127
130template<typename T, bool is_foundamental>
132{
133 enum
134 {
136 };
137};
138
139template<typename T, bool impl = std::is_array<T>::value>
141{
142 enum
143 {
144 value = PACKER_PRIMITIVE
145 };
146};
147
148template<typename T>
150{
151 enum
152 {
153 value = PACKER_ARRAY_CP_PRIMITIVE
154 };
155};
156
160template<typename T>
161struct Pack_selector_impl<T,true>
162{
163 enum
164 {
166 };
167};
168
170
175template <typename T>
177{
178 enum
179 {
180 value = Pack_selector_impl< T,std::is_fundamental<T>::value || std::is_fundamental< typename std::remove_all_extents<T>::type >::value >::value
181 };
182};
183
184
185#endif /* SRC_PACK_SELECTOR_HPP_ */
it is not a fundamental type
Pack selector for unknown type.
Pack selector for unknown type.
Pack selector.
It return true if the object T require complex serialization.