ML Reference
|
00001 // **InsertLicense** code 00002 //------------------------------------------------------------------------- 00020 //-------------------------------------------------------------------------------- 00021 00022 00023 //-------------------------------------------------------------------------------- 00027 //-------------------------------------------------------------------------------- 00028 00029 #ifndef __mlTemplateSupport_H 00030 #define __mlTemplateSupport_H 00031 00032 #ifndef __mlInitSystemML_H 00033 #include "mlInitSystemML.h" 00034 #endif 00035 #include "mlTypeTraits.h" 00036 00038 00039 template<typename T> 00040 inline MLint32 MLIsScalarTypePtr(const T*) { return ML_NAMESPACE::TypeTraits<T>::isStandardType?1:0; }; 00042 00043 00045 00046 template<typename T> 00047 inline MLint32 MLIsSignedTypePtr(const T*) { return ML_NAMESPACE::TypeTraits<T>::isBuiltInSignedType; }; 00049 00051 00052 template<typename T> 00053 inline MLDataType MLGetDataTypeFromPtr(const T*) { return ML_NAMESPACE::TypeTraits<T>::dataType; }; 00055 00057 00058 template<typename T> 00059 inline size_t MLGetDataTypeSizeFromPtr(const T*) { return sizeof(T); } 00061 00063 00064 template<typename T> 00065 inline MLint32 MLIs8_16_Or_32BitIntegerTypePtr(const T*) { return ML_NAMESPACE::TypeTraits<T>::is8_16_32BitInteger?1:0; }; 00067 00069 00070 template<typename T> 00071 inline MLint32 MLIs8BitIntegerTypePtr(const T*) { return ML_NAMESPACE::TypeTraits<T>::is8BitInteger?1:0; }; 00073 00075 00076 template<typename T> 00077 inline MLint32 MLIs16BitIntegerTypePtr(const T*) { return ML_NAMESPACE::TypeTraits<T>::is16BitInteger?1:0; }; 00079 00081 00082 template<typename T> 00083 inline MLint32 MLIs32BitIntegerTypePtr(const T*) { return ML_NAMESPACE::TypeTraits<T>::is32BitInteger?1:0; }; 00085 00087 00088 template<typename T> 00089 inline MLint32 MLIs64BitIntegerTypePtr(const T*) { return ML_NAMESPACE::TypeTraits<T>::is64BitInteger?1:0; }; 00091 00093 00094 template<typename T> 00095 inline MLint32 MLIsBuiltInIntegerTypePtr(const T*) { return ML_NAMESPACE::TypeTraits<T>::isBuiltInIntegerType?1:0; }; 00097 00099 00100 template<typename T> 00101 inline MLint32 MLIsBuiltInFloatingPointTypePtr(const T*) { return ML_NAMESPACE::TypeTraits<T>::isBuiltInFloatType?1:0; }; 00103 00104 00105 #ifdef ML_DEPRECATED 00106 00107 template<typename T> 00108 inline MLint32 MLIsCarrierTypePtr(const T*) { return ML_NAMESPACE::TypeTraits<T>::isStandardType?0:1; }; 00109 00110 template<typename T> 00111 inline MLint32 MLIsCarrierInTypePtr(const T*) { return ML_NAMESPACE::TypeTraits<T>::isStandardType?0:1; }; 00112 00113 template<typename T> 00114 inline MLint32 MLIsAnyCarrierTypePtr(const T*) { return ML_NAMESPACE::TypeTraits<T>::isStandardType?0:1; }; 00115 00116 template<typename T> 00117 inline MLint32 MLIsStandardTypePtr(const T*) { return ML_NAMESPACE::TypeTraits<T>::isStandardType?1:0; }; 00118 00119 template<typename T> 00120 inline size_t MLGetPhysicalDataTypeSizeFromPtr(const T*) { return sizeof(T); } 00121 00122 // compatibility function 00123 template <typename OUTDTYPE, typename INDTYPE> 00124 inline MLint32 MLTTypeInfosPushAndSetBoth(const OUTDTYPE *outPtr, MLDataType outDT, 00125 const INDTYPE *inPtr, MLDataType inDT) 00126 { 00127 return 0; 00128 } 00129 00130 #if defined(WIN32) && defined(ML_WARN_DEPRECATED) 00131 #pragma deprecated("MLIsCarrierTypePtr") 00132 #pragma deprecated("MLIsCarrierInTypePtr") 00133 #pragma deprecated("MLIsAnyCarrierTypePtr") 00134 #pragma deprecated("MLIsStandardTypePtr") 00135 #pragma deprecated("MLGetPhysicalDataTypeSizeFromPtr") 00136 #pragma deprecated("MLTTypeInfosPushAndSetBoth") 00137 #endif 00138 00139 #endif // ML_DEPRECATED 00140 00141 00142 #endif // of __mlTemplateSupport_H 00143 00144