Blaze 3.9
TypeValueMapping.h
Go to the documentation of this file.
1//=================================================================================================
33//=================================================================================================
34
35#ifndef _BLAZE_MATH_SERIALIZATION_TypeValueMapping_H_
36#define _BLAZE_MATH_SERIALIZATION_TypeValueMapping_H_
37
38
39//*************************************************************************************************
40// Includes
41//*************************************************************************************************
42
48
49
50namespace blaze {
51
52//=================================================================================================
53//
54// CLASS DEFINITION
55//
56//=================================================================================================
57
58//*************************************************************************************************
63template< bool IsSignedIntegral, bool IsUnsignedIntegral, bool IsFloatingPoint, bool IsComplex >
64struct TypeValueMappingHelper;
66//*************************************************************************************************
67
68
69//*************************************************************************************************
74template<>
75struct TypeValueMappingHelper<false,false,false,false>
76{
77 public:
78 //**********************************************************************************************
79 enum { value = 0 };
80 //**********************************************************************************************
81};
83//*************************************************************************************************
84
85
86//*************************************************************************************************
91template<>
92struct TypeValueMappingHelper<true,false,false,false>
93{
94 public:
95 //**********************************************************************************************
96 enum { value = 1 };
97 //**********************************************************************************************
98};
100//*************************************************************************************************
101
102
103//*************************************************************************************************
108template<>
109struct TypeValueMappingHelper<false,true,false,false>
110{
111 public:
112 //**********************************************************************************************
113 enum { value = 2 };
114 //**********************************************************************************************
115};
117//*************************************************************************************************
118
119
120//*************************************************************************************************
125template<>
126struct TypeValueMappingHelper<false,false,true,false>
127{
128 public:
129 //**********************************************************************************************
130 enum { value = 3 };
131 //**********************************************************************************************
132};
134//*************************************************************************************************
135
136
137//*************************************************************************************************
142template<>
143struct TypeValueMappingHelper<false,false,false,true>
144{
145 public:
146 //**********************************************************************************************
147 enum { value = 4 };
148 //**********************************************************************************************
149};
151//*************************************************************************************************
152
153
154//*************************************************************************************************
162template< typename T >
164{
165 public:
166 //**********************************************************************************************
168 enum { value = TypeValueMappingHelper< IsIntegral_v<T> && IsSigned_v<T>
169 , IsIntegral_v<T> && IsUnsigned_v<T>
170 , IsFloatingPoint_v<T>
171 , IsComplex_v<T>
172 >::value };
174 //**********************************************************************************************
175};
176//*************************************************************************************************
177
178} // namespace blaze
179
180#endif
Header file for the IsComplex type trait.
Header file for the IsFloatingPoint type trait.
Header file for the IsIntegral type trait.
Header file for the IsSigned type trait.
Header file for the IsUnsigned type trait.
Conversion from a data type to a serial representation.
Definition: TypeValueMapping.h:164