All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TypeValueMapping.h
Go to the documentation of this file.
1 //=================================================================================================
20 //=================================================================================================
21 
22 #ifndef _BLAZE_MATH_SERIALIZATION_TypeValueMapping_H_
23 #define _BLAZE_MATH_SERIALIZATION_TypeValueMapping_H_
24 
25 
26 //*************************************************************************************************
27 // Includes
28 //*************************************************************************************************
29 
35 
36 
37 namespace blaze {
38 
39 //=================================================================================================
40 //
41 // CLASS DEFINITION
42 //
43 //=================================================================================================
44 
45 //*************************************************************************************************
50 template< bool IsSignedIntegral, bool IsUnsignedIntegral, bool IsFloatingPoint, bool IsComplex >
51 struct TypeValueMappingHelper;
53 //*************************************************************************************************
54 
55 
56 //*************************************************************************************************
61 template<>
62 struct TypeValueMappingHelper<false,false,false,false>
63 {
64  public:
65  //**********************************************************************************************
66  enum { value = 0 };
67  //**********************************************************************************************
68 };
70 //*************************************************************************************************
71 
72 
73 //*************************************************************************************************
78 template<>
79 struct TypeValueMappingHelper<true,false,false,false>
80 {
81  public:
82  //**********************************************************************************************
83  enum { value = 1 };
84  //**********************************************************************************************
85 };
87 //*************************************************************************************************
88 
89 
90 //*************************************************************************************************
95 template<>
96 struct TypeValueMappingHelper<false,true,false,false>
97 {
98  public:
99  //**********************************************************************************************
100  enum { value = 2 };
101  //**********************************************************************************************
102 };
104 //*************************************************************************************************
105 
106 
107 //*************************************************************************************************
112 template<>
113 struct TypeValueMappingHelper<false,false,true,false>
114 {
115  public:
116  //**********************************************************************************************
117  enum { value = 3 };
118  //**********************************************************************************************
119 };
121 //*************************************************************************************************
122 
123 
124 //*************************************************************************************************
129 template<>
130 struct TypeValueMappingHelper<false,false,false,true>
131 {
132  public:
133  //**********************************************************************************************
134  enum { value = 4 };
135  //**********************************************************************************************
136 };
138 //*************************************************************************************************
139 
140 
141 //*************************************************************************************************
149 template< typename T >
151 {
152  public:
153  //**********************************************************************************************
155  enum { value = TypeValueMappingHelper< IsIntegral<T>::value && IsSigned<T>::value
159  >::value };
161  //**********************************************************************************************
162 };
163 //*************************************************************************************************
164 
165 } // namespace blaze
166 
167 #endif