ML Reference
mlTemplateSupport.h File Reference
#include "mlInitSystemML.h"
#include "mlTypeTraits.h"

Go to the source code of this file.

Functions

Test for standard (built-in) typed pointers: Returns 1 (=true) for standard types and otherwise, it returns 0 (=false).

This file contains a set of convenience functions to determine information about a currently used template data type.

General comments about this file:

  • If this template code is used, then it is typically very time-critical, thus tracing should be avoided if possible. The functions are intended as traits where different template code is used after compilation.
  • Most of these templates are detected as constants after instantiation, so that they are optimized 'away' by compilers. This way, adding calculating functionality or even tracing would make them time critical where before was nothing done after compiler optimization.

Disable all C++ specific features for this C file because it must fulfill C-API requirements, i.e., it must not use C++. The template code does not make sense in C anyway.

template<typename T >
MLint32 MLIsScalarTypePtr (const T *)
 
Test for signed typed pointers: returns 1 (=true) for signed types and otherwise, it returns 0 (=false).

For registered types, the correct type must have been set with a MLTypeInfosPushAndSet* function.

template<typename T >
MLint32 MLIsSignedTypePtr (const T *)
 
Returns the MLDataType for the currently used template data type pointer.

For registered types, the correct type must have been set with a MLTypeInfosPushAndSet* function.

template<typename T >
MLDataType MLGetDataTypeFromPtr (const T *)
 
Returns the size in bytes of the physically compiled type for the currently used template data type pointer.
template<typename T >
size_t MLGetDataTypeSizeFromPtr (const T *)
 
Tests for standard (built-in) integer typed pointers from 8 to 32 bits:

returns 1 (=true) for those types and otherwise, (also for integer typed registered types) it returns 0 (=false).

template<typename T >
MLint32 MLIs8_16_Or_32BitIntegerTypePtr (const T *)
 
Tests for built-in 8 bit signed or unsigned integer typed pointers: returns 1 (=true) for those types and otherwise, it returns 0 (=false).
template<typename T >
MLint32 MLIs8BitIntegerTypePtr (const T *)
 
Tesst for built-in 16 bit signed or unsigned integer typed pointers: returns 1 (=true) for those types and otherwise, it returns 0 (=false).
template<typename T >
MLint32 MLIs16BitIntegerTypePtr (const T *)
 
Tests for built-in 32-bit signed or unsigned integer typed pointers: Returns 1 (=true) for those types and otherwise, it returns 0 (=false).
template<typename T >
MLint32 MLIs32BitIntegerTypePtr (const T *)
 
Tests for built-in 64-bit signed or unsigned typed pointers: returns 1 (=true) for those types and otherwise, it returns 0 (=false).
template<typename T >
MLint32 MLIs64BitIntegerTypePtr (const T *)
 
Tests for built-in integer typed pointers: returns 1 (=true) for those types and otherwise, it returns 0 (=false).
template<typename T >
MLint32 MLIsBuiltInIntegerTypePtr (const T *)
 
Tests for built-in floating point typed pointers: returns 1 (=true) for those types and otherwise, it returns 0 (=false).
template<typename T >
MLint32 MLIsBuiltInFloatingPointTypePtr (const T *)
 

Function Documentation

◆ MLGetDataTypeFromPtr()

template<typename T >
MLDataType MLGetDataTypeFromPtr ( const T *  )
inline

Definition at line 54 of file mlTemplateSupport.h.

◆ MLGetDataTypeSizeFromPtr()

template<typename T >
size_t MLGetDataTypeSizeFromPtr ( const T *  )
inline

Definition at line 60 of file mlTemplateSupport.h.

◆ MLIs16BitIntegerTypePtr()

template<typename T >
MLint32 MLIs16BitIntegerTypePtr ( const T *  )
inline

Definition at line 79 of file mlTemplateSupport.h.

◆ MLIs32BitIntegerTypePtr()

template<typename T >
MLint32 MLIs32BitIntegerTypePtr ( const T *  )
inline

Definition at line 85 of file mlTemplateSupport.h.

◆ MLIs64BitIntegerTypePtr()

template<typename T >
MLint32 MLIs64BitIntegerTypePtr ( const T *  )
inline

Definition at line 91 of file mlTemplateSupport.h.

◆ MLIs8_16_Or_32BitIntegerTypePtr()

template<typename T >
MLint32 MLIs8_16_Or_32BitIntegerTypePtr ( const T *  )
inline

Definition at line 67 of file mlTemplateSupport.h.

◆ MLIs8BitIntegerTypePtr()

template<typename T >
MLint32 MLIs8BitIntegerTypePtr ( const T *  )
inline

Definition at line 73 of file mlTemplateSupport.h.

◆ MLIsBuiltInFloatingPointTypePtr()

template<typename T >
MLint32 MLIsBuiltInFloatingPointTypePtr ( const T *  )
inline

Definition at line 103 of file mlTemplateSupport.h.

◆ MLIsBuiltInIntegerTypePtr()

template<typename T >
MLint32 MLIsBuiltInIntegerTypePtr ( const T *  )
inline

Definition at line 97 of file mlTemplateSupport.h.

References OverloadSelector::isBuiltInIntegerType().

◆ MLIsScalarTypePtr()

template<typename T >
MLint32 MLIsScalarTypePtr ( const T *  )
inline

Definition at line 39 of file mlTemplateSupport.h.

Referenced by ml::TSubImage< DATATYPE >::copySubImageTyped().

◆ MLIsSignedTypePtr()

template<typename T >
MLint32 MLIsSignedTypePtr ( const T *  )
inline

Definition at line 47 of file mlTemplateSupport.h.