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 
50 namespace blaze {
51 
52 //=================================================================================================
53 //
54 // CLASS DEFINITION
55 //
56 //=================================================================================================
57 
58 //*************************************************************************************************
63 template< bool IsSignedIntegral, bool IsUnsignedIntegral, bool IsFloatingPoint, bool IsComplex >
64 struct TypeValueMappingHelper;
66 //*************************************************************************************************
67 
68 
69 //*************************************************************************************************
74 template<>
75 struct TypeValueMappingHelper<false,false,false,false>
76 {
77  public:
78  //**********************************************************************************************
79  enum { value = 0 };
80  //**********************************************************************************************
81 };
83 //*************************************************************************************************
84 
85 
86 //*************************************************************************************************
91 template<>
92 struct TypeValueMappingHelper<true,false,false,false>
93 {
94  public:
95  //**********************************************************************************************
96  enum { value = 1 };
97  //**********************************************************************************************
98 };
100 //*************************************************************************************************
101 
102 
103 //*************************************************************************************************
108 template<>
109 struct TypeValueMappingHelper<false,true,false,false>
110 {
111  public:
112  //**********************************************************************************************
113  enum { value = 2 };
114  //**********************************************************************************************
115 };
117 //*************************************************************************************************
118 
119 
120 //*************************************************************************************************
125 template<>
126 struct TypeValueMappingHelper<false,false,true,false>
127 {
128  public:
129  //**********************************************************************************************
130  enum { value = 3 };
131  //**********************************************************************************************
132 };
134 //*************************************************************************************************
135 
136 
137 //*************************************************************************************************
142 template<>
143 struct TypeValueMappingHelper<false,false,false,true>
144 {
145  public:
146  //**********************************************************************************************
147  enum { value = 4 };
148  //**********************************************************************************************
149 };
151 //*************************************************************************************************
152 
153 
154 //*************************************************************************************************
162 template< 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 IsIntegral type trait.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
Header file for the IsFloatingPoint type trait.
Conversion from a data type to a serial representation.This class template converts the given data ty...
Definition: TypeValueMapping.h:163
Header file for the IsSigned type trait.
Header file for the IsUnsigned type trait.
Header file for the IsComplex type trait.