All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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<T>::value && IsSigned<T>::value
172  >::value };
174  //**********************************************************************************************
175 };
176 //*************************************************************************************************
177 
178 } // namespace blaze
179 
180 #endif
Header file for the IsIntegral type trait.
Compile time check for signed data types.This type trait tests whether or not the given template para...
Definition: IsSigned.h:96
Header file for the IsFloatingPoint type trait.
Compile time check for floating point data types.This type trait tests whether or not the given templ...
Definition: IsFloatingPoint.h:94
Conversion from a data type to a serial representation.This class template converts the given data ty...
Definition: TypeValueMapping.h:163
Compile time check for integral data types.This type trait tests whether or not the given template pa...
Definition: IsIntegral.h:94
Header file for the IsSigned type trait.
Header file for the IsUnsigned type trait.
Compile time check for unsigned data types.This type trait tests whether or not the given template pa...
Definition: IsUnsigned.h:96
Compile time check for complex types.This type trait tests whether or not the given template paramete...
Definition: IsComplex.h:76
Header file for the IsComplex type trait.