MeVisLab Toolbox Reference
Loading...
Searching...
No Matches
mlTemplateSupport.h
Go to the documentation of this file.
1/*************************************************************************************
2**
3** Copyright 2007, MeVis Medical Solutions AG
4**
5** The user may use this file in accordance with the license agreement provided with
6** the Software or, alternatively, in accordance with the terms contained in a
7** written agreement between the user and MeVis Medical Solutions AG.
8**
9** For further information use the contact form at https://www.mevislab.de/contact
10**
11**************************************************************************************/
12
13#ifndef ML_TEMPLATE_SUPPORT_H
14#define ML_TEMPLATE_SUPPORT_H
15
32
33#include "mlInitSystemML.h"
34#include "mlTypeTraits.h"
35
39template <typename T> inline MLint32 MLIsScalarTypePtr(const T*)
40{
41 return ML_NAMESPACE::TypeTraits<T>::isStandardType ? 1 : 0;
42}
44
45
49template <typename T> inline MLint32 MLIsSignedTypePtr(const T*)
50{
51 return ML_NAMESPACE::TypeTraits<T>::isBuiltInSignedType;
52}
54
58template <typename T> inline MLDataType MLGetDataTypeFromPtr(const T*)
59{
60 return ML_NAMESPACE::TypeTraits<T>::dataType;
61}
63
66template <typename T> inline size_t MLGetDataTypeSizeFromPtr(const T*)
67{
68 return sizeof(T);
69}
71
75template <typename T> inline MLint32 MLIs8_16_Or_32BitIntegerTypePtr(const T*)
76{
77 return ML_NAMESPACE::TypeTraits<T>::is8_16_32BitInteger ? 1 : 0;
78}
80
84template <typename T> inline MLint32 MLIs8BitIntegerTypePtr(const T*)
85{
86 return ML_NAMESPACE::TypeTraits<T>::is8BitInteger ? 1 : 0;
87}
89
93template <typename T> inline MLint32 MLIs16BitIntegerTypePtr(const T*)
94{
95 return ML_NAMESPACE::TypeTraits<T>::is16BitInteger ? 1 : 0;
96}
98
102template <typename T> inline MLint32 MLIs32BitIntegerTypePtr(const T*)
103{
104 return ML_NAMESPACE::TypeTraits<T>::is32BitInteger ? 1 : 0;
105}
107
111template <typename T> inline MLint32 MLIs64BitIntegerTypePtr(const T*)
112{
113 return ML_NAMESPACE::TypeTraits<T>::is64BitInteger ? 1 : 0;
114}
116
120template <typename T> inline MLint32 MLIsBuiltInIntegerTypePtr(const T*)
121{
122 return ML_NAMESPACE::TypeTraits<T>::isBuiltInIntegerType ? 1 : 0;
123}
125
129template <typename T> inline MLint32 MLIsBuiltInFloatingPointTypePtr(const T*)
130{
131 return ML_NAMESPACE::TypeTraits<T>::isBuiltInFloatType ? 1 : 0;
132}
134
135
136#endif
@ T
MLint32 MLDataType
MLDataType.
Definition mlTypeDefs.h:592
MLint32 MLIsSignedTypePtr(const T *)
MLint32 MLIs8BitIntegerTypePtr(const T *)
MLint32 MLIsBuiltInFloatingPointTypePtr(const T *)
MLDataType MLGetDataTypeFromPtr(const T *)
MLint32 MLIs8_16_Or_32BitIntegerTypePtr(const T *)
MLint32 MLIs32BitIntegerTypePtr(const T *)
MLint32 MLIsBuiltInIntegerTypePtr(const T *)
MLint32 MLIs16BitIntegerTypePtr(const T *)
size_t MLGetDataTypeSizeFromPtr(const T *)
MLint32 MLIsScalarTypePtr(const T *)
MLint32 MLIs64BitIntegerTypePtr(const T *)
signed int MLint32
Definition mlTypeDefs.h:161