MeVisLab Toolbox Reference
ml::MLTStdTypeInfos< VTYP > Class Template Reference

Template class to register the standard integer classes as voxel types in the ML. More...

#include <mlStdTypeInfos.h>

Inheritance diagram for ml::MLTStdTypeInfos< VTYP >:
MLTypeInfos

Public Member Functions

 MLTStdTypeInfos ()
 Constructor. More...
 
void MLTYPE_negate (const MLTypeData *p, MLTypeData *q)
 
void MLTYPE_negate (const MLTypeData *p, MLTypeData *q)
 
void MLTYPE_negate (const MLTypeData *p, MLTypeData *q)
 
void MLTYPE_negate (const MLTypeData *p, MLTypeData *q)
 

Static Public Member Functions

Returns specialized data type names.
static const char * typeName (MLint8 *)
 
static const char * typeName (MLuint8 *)
 
static const char * typeName (MLint16 *)
 
static const char * typeName (MLuint16 *)
 
static const char * typeName (MLint32 *)
 
static const char * typeName (MLuint32 *)
 
static const char * typeName (MLfloat *)
 
static const char * typeName (MLdouble *)
 
static const char * typeName (MLint64 *)
 
static const char * typeName (MLuint64 *)
 
Methods to be overloaded by derived classes if the corresponding flag is \c true.
static char * MLTYPE_getStringValue (const MLTypeData *p)
 Returns the value as string to be freed by MLFree(). Use MLTypeComponentsToString() if possible. More...
 
static void MLTYPE_setStringValue (const char *s, MLTypeData *r)
 Converts the string s to a value and writes result into r. Use MLTypeComponentsFromString() if possible. More...
 
static void MLTYPE_setToMinimum (MLTypeData *p)
 Sets value to minimum value. Must be implemented. More...
 
static void MLTYPE_setToMaximum (MLTypeData *p)
 Sets value to minimum value. Must be implemented. More...
 
static void MLTYPE_setToDefault (MLTypeData *p)
 Sets value to default value. Must be implemented. More...
 
static MLdouble MLTYPE_getComponent (const MLTypeData *p, size_t)
 Returns n-th component as double value. Must be implemented. More...
 
static void MLTYPE_setComponent (MLTypeData *p, size_t, MLdouble v)
 Sets n-th component from double value. Must be implemented. More...
 
static void MLTYPE_copy (const MLTypeData *source, MLTypeData *dest)
 Copies first parameter to second one. More...
 
static void MLTYPE_arrayCopy (const MLTypeData *source, MLTypeData *dest, size_t size)
 Copies s elements from the first parameter to the second one. More...
 
static void MLTYPE_arrayCopyWithStrides (const MLTypeData *source, MLssize_t sourceStride, MLTypeData *dest, MLssize_t destStride, size_t size)
 Same as MLTYPE_arrayCopy, but allows to specify stride values for source and destination. More...
 
static void MLTYPE_arrayFill (const MLTypeData *fillValue, MLTypeData *dest, size_t n)
 Copies the first parameter to the second one as often as given in the third parameter. More...
 
static bool MLTYPE_castToBool (const MLTypeData *p)
 Returns the parameter cast to bool. Typically, it returns false if it is identically to the default element; otherwise, it returns true. More...
 
static MLint MLTYPE_castToInt (const MLTypeData *p)
 Returns the parameter cast to integer. Often the integer cast of the first component. More...
 
static MLdouble MLTYPE_castToDouble (const MLTypeData *p)
 Returns the parameter cast to double. Often the integer cast of the first component. More...
 
static void MLTYPE_castToOtherType (const MLTypeData *myData, const MLTypeInfos *otherInfos, MLTypeData *otherData)
 Returns the parameter cast to double. Usually implemented by default with function casting component-wise. More...
 
static void MLTYPE_castFromInt (MLint p, MLTypeData *q)
 Casts the first parameters to data type and writes it into the second parameter. More...
 
static void MLTYPE_castFromDouble (MLdouble p, MLTypeData *q)
 Casts the first parameters to data type and writes it into the second parameter. More...
 
static void MLTYPE_castFromOtherType (const MLTypeInfos *otherInfos, const MLTypeData *otherData, MLTypeData *myData)
 Casts the first parameters to data type and writes it into the second parameter. More...
 
static bool MLTYPE_isEqualToType (const MLTypeData *p, const MLTypeData *q)
 Returns true if both parameters are equal; otherwise, it returns false. More...
 
static bool MLTYPE_isEqualToTypeWithEpsilon (const MLTypeData *p, const MLTypeData *q, MLdouble eps)
 Returns true if both parameters are equal within a static epsilon; otherwise, it returns false. More...
 
static void MLTYPE_negate (const MLTypeData *p, MLTypeData *q)
 Negates the value. See also the specialized negations for unsigned types that leave the value unchanged. More...
 
static void MLTYPE_normalize (const MLTypeData *, MLTypeData *q)
 Normalizes the type. More...
 
static void MLTYPE_arrayRescale (const MLTypeData *source, MLdouble factor, const MLTypeData *offset, MLTypeData *dest, size_t size)
 Scales the values from the first parameter with the second parameter and offsets it with the value from the third parameter, writing it to the position of the fourth parameter, times the fifth parameter. More...
 
static bool MLTYPE_arrayEqualsValue (const MLTypeData *value, const MLTypeData *buffer, size_t size)
 Checks that the first argument equals all the values given with the second argument (and the size in the third argument). More...
 
static void MLTYPE_arrayGetMinMax (const MLTypeData *p, size_t s, MLdouble &min, MLdouble &max)
 Gets the mininum and maximum component values from the array in the first argument, and returns it in the third and fourth argument, the size of the array is in the second argument. More...
 
static void MLTYPE_interpolate (const MLTypeData *p, const MLTypeData *q, MLdouble r, MLTypeData *t)
 Interpolates linearly between the first and the second parameter, at the position given by the third parameter (between 0 and 1). More...
 
static void MLTYPE_multWithInt (const MLTypeData *p, MLint q, MLTypeData *r)
 Implements multiplication with integer. Result is written into parameter three. More...
 
static void MLTYPE_multWithDouble (const MLTypeData *p, MLdouble q, MLTypeData *r)
 Implements multiplication with double. Result is written into parameter three. More...
 
static void MLTYPE_multWithType (const MLTypeData *p, const MLTypeData *q, MLTypeData *r)
 Implements multiplication with its own type. Result is written into parameter three. More...
 
static void MLTYPE_multWithOtherType (const MLTypeInfos *otherInfos, const MLTypeData *otherData, const MLTypeData *myData, MLTypeData *r)
 Implements multiplication with another type. Result is written into parameter three. More...
 
static void MLTYPE_plusInt (const MLTypeData *p, MLint q, MLTypeData *r)
 Implements integer addition to parameter one. Result is written into parameter three. More...
 
static void MLTYPE_plusDouble (const MLTypeData *p, MLdouble q, MLTypeData *r)
 Implements double addition to parameter one. Result is written into parameter three. More...
 
static void MLTYPE_plusType (const MLTypeData *p, const MLTypeData *q, MLTypeData *r)
 Implements parameter two addition to parameter one. Result is written into parameter three. More...
 

Protected Member Functions

MLfloat castToType (MLdouble v)
 
MLdouble castToType (MLdouble v)
 
Returns the types and their quantities to which this type can be cast without information loss.
void _getGoodCastTos (MLint8, MLuint &num, const char **&typeNames)
 
void _getGoodCastTos (MLuint8, MLuint &num, const char **&typeNames)
 
void _getGoodCastTos (MLint16, MLuint &num, const char **&typeNames)
 
void _getGoodCastTos (MLuint16, MLuint &num, const char **&typeNames)
 
void _getGoodCastTos (MLint32, MLuint &num, const char **&typeNames)
 
void _getGoodCastTos (MLuint32, MLuint &num, const char **&typeNames)
 
void _getGoodCastTos (MLfloat, MLuint &num, const char **&typeNames)
 
void _getGoodCastTos (MLdouble, MLuint &num, const char **&typeNames)
 
void _getGoodCastTos (MLint64, MLuint &num, const char **&typeNames)
 
void _getGoodCastTos (MLuint64, MLuint &num, const char **&typeNames)
 

Static Protected Member Functions

static VTYP castToType (MLdouble v)
 Implements a method that rounds a double value when casting to an integer but does not round when casting to a float type (special case below). More...
 

Static Protected Attributes

static const VTYP _typeMin
 Permanent instance of the minimum value. More...
 
static const VTYP _typeMax
 Permanent instance of the maximum value. More...
 
static const VTYP _typeDefault = VTYP(0)
 Permanent instance of the default value. More...
 
static const char _typeInfoString [_ML_STD_SLEN]
 Permanent instance of the type's description. More...
 
static MLTypeInfos_myInfos = nullptr
 Permanent instance of a pointer to the typeInfos used by this class. More...
 
static MLint32 _numInstances = 0
 The number of instances of this class. More...
 

Returns the correct equivalent for range and precision routines.

MLDataType _rangeAndPrecisionEquiv (MLint8)
 
MLDataType _rangeAndPrecisionEquiv (MLuint8)
 
MLDataType _rangeAndPrecisionEquiv (MLint16)
 
MLDataType _rangeAndPrecisionEquiv (MLuint16)
 
MLDataType _rangeAndPrecisionEquiv (MLint32)
 
MLDataType _rangeAndPrecisionEquiv (MLuint32)
 
MLDataType _rangeAndPrecisionEquiv (MLfloat)
 
MLDataType _rangeAndPrecisionEquiv (MLdouble)
 
MLDataType _rangeAndPrecisionEquiv (MLint64)
 
MLDataType _rangeAndPrecisionEquiv (MLuint64)
 
static VTYP & value_cast (MLTypeData *v)
 Avoid using reinterpret_casts. More...
 
static const VTYP & value_cast (const MLTypeData *v)
 

Additional Inherited Members

- Public Types inherited from MLTypeInfos
typedef void(* Function_SetTo) (MLTypeData *dest)
 
typedef bool(* Function_CastToBool) (const MLTypeData *p)
 
typedef MLint(* Function_CastToInt) (const MLTypeData *p)
 
typedef MLdouble(* Function_CastToDouble) (const MLTypeData *p)
 
typedef char *(* Function_GetStringValue) (const MLTypeData *p)
 
typedef void(* Function_CastFromInt) (MLint value, MLTypeData *result)
 
typedef void(* Function_CastFromDouble) (MLdouble value, MLTypeData *result)
 
typedef void(* Function_SetStringValue) (const char *str, MLTypeData *result)
 
typedef void(* Function_CopyValue) (const MLTypeData *source, MLTypeData *dest)
 
typedef bool(* Function_IsEqualToType) (const MLTypeData *source1, const MLTypeData *source2)
 
typedef bool(* Function_IsEqualToTypeWithEpsilon) (const MLTypeData *source1, const MLTypeData *source2, MLdouble epsilon)
 
typedef void(* Function_ApplyIntOperation) (const MLTypeData *source, MLint value, MLTypeData *result)
 
typedef void(* Function_ApplyDoubleOperation) (const MLTypeData *source, MLdouble value, MLTypeData *result)
 
typedef void(* Function_ApplyOperation) (const MLTypeData *source1, const MLTypeData *source2, MLTypeData *result)
 
typedef void(* Function_CastToOtherType) (const MLTypeData *myData, const MLTypeInfos *otherInfos, MLTypeData *otherData)
 
typedef void(* Function_CastFromOtherType) (const MLTypeInfos *myInfos, const MLTypeData *myData, MLTypeData *otherData)
 
typedef void(* Function_MultWithOtherType) (const MLTypeInfos *myInfos, const MLTypeData *myData, const MLTypeData *otherData, MLTypeData *result)
 
typedef void(* Function_ArrayCopy) (const MLTypeData *source, MLTypeData *dest, size_t size)
 
typedef void(* Function_ArrayFill) (const MLTypeData *fillValue, MLTypeData *dest, size_t size)
 
typedef void(* Function_ArrayCopyWithStrides) (const MLTypeData *source, MLssize_t sourceStride, MLTypeData *dest, MLssize_t destStride, size_t size)
 
typedef void(* Function_Interpolate) (const MLTypeData *source1, const MLTypeData *source2, MLdouble alpha, MLTypeData *result)
 
typedef void(* Function_ArrayRescale) (const MLTypeData *source, MLdouble scaleFactor, const MLTypeData *offset, MLTypeData *dest, size_t size)
 
typedef bool(* Function_ArrayEqualsValue) (const MLTypeData *value, const MLTypeData *buffer, size_t size)
 
typedef void(* Function_ArrayGetMinMax) (const MLTypeData *source, size_t size, MLdouble &min, MLdouble &max)
 
typedef MLdouble(* Function_GetComponent) (const MLTypeData *source, size_t componentIndex)
 
typedef void(* Function_SetComponent) (MLTypeData *dest, size_t componentIndex, MLdouble value)
 
- Public Attributes inherited from MLTypeInfos
size_t numComponents
 Number of components of this data type. Equals number of characters in *structInfoString. More...
 
size_t typeSize
 sizeof the data type in bytes. More...
 
const char * name
 Pointer to the data type name. More...
 
MLDataType rangeAndPrecisionEquivalent
 Standard data type which has a comparable range and precision behavior. More...
 
MLdouble dblMin
 double minimum of data type if it exists. More...
 
MLdouble dblMax
 double maximum of data type if it exists. More...
 
const MLTypeDatatypeMinPtr
 Data type minimum specified by derived class. More...
 
const MLTypeDatatypeMaxPtr
 Data type maximum specified by derived class. More...
 
const MLTypeDatatypeDefaultPtr
 Data type default specified by derived class. More...
 
size_t numGoodCastTos
 Number of datatypes to which this type can be cast without information or functionality loss. More...
 
const char ** goodCastTos
 Data types names to which this type can be cast without information or functionality loss. More...
 
size_t componentOffsets [ML_MAX_COMPONENTS_EXTENDED_TYPE]
 Array of offsets from the first to other components to address any component directly. More...
 
const char * structInfoString
 Pointer to a NULL-terminated string describing the type configuration. More...
 
MLint32 dataTypeId
 Real MLDataType id of under which these operations are registered as data type. More...
 
MLTypeGroup typeGroup
 Type group to which this type belongs. More...
 
MLTypePropertyBits propertyBits
 Variable containing an enabled bit for each defined property. More...
 
Function_GetStringValue getStringValue
 Returns a value as a string. More...
 
Function_SetStringValue setStringValue
 Try to convert string as far as possible. If string cannot be scanned at all, then use the data type default. More...
 
Function_SetTo setToMinimum
 Sets the value to minimum value. Must be implemented. More...
 
Function_SetTo setToMaximum
 Sets the value to minimum value. Must be implemented. More...
 
Function_SetTo setToDefault
 Sets the value to default value. Must be implemented. More...
 
Function_GetComponent getComponent
 Returns the n-th component of the type as double. More...
 
Function_SetComponent setComponent
 Sets the n-th component of the type from double (applying rounding if needed). More...
 
Function_CopyValue copy
 Copies the first parameter to the second one. More...
 
Function_ArrayCopy arrayCopy
 Copies the number of elements of the first parameter to the second one. More...
 
Function_ArrayCopyWithStrides arrayCopyWithStrides
 Same as arrayCopy, but allows to specify stride values for source and destination. More...
 
Function_ArrayFill arrayFill
 Sets the first parameter to array at the second one. More...
 
Function_CastToBool castToBool
 Returns a type value cast to bool. Usually an equality to 0 should return false, e.g., a null vector. More...
 
Function_CastToInt castToInt
 Returns a type value cast to integer. More...
 
Function_CastToDouble castToDouble
 Returns a type value cast to double. More...
 
Function_CastToOtherType castToOtherType
 Casts data to another registered type. More...
 
Function_CastFromInt castFromInt
 Casts the first (the integer) parameter to the data type and returns it into second parameter. More...
 
Function_CastFromDouble castFromDouble
 Casts the first (the double) parameter to the data type and returns it into second parameter. More...
 
Function_CastFromOtherType castFromOtherType
 Casts another registered type to data. More...
 
Function_IsEqualToType isEqualToType
 Returns true if both parameters are equal; otherwise, it returns false. More...
 
Function_IsEqualToTypeWithEpsilon isEqualToTypeWithEpsilon
 Returns true if both parameters are equal within a static epsilon; otherwise, it returns false. More...
 
Function_CopyValue negate
 Negates the value. More...
 
Function_CopyValue normalize
 Normalizes the type value from parameter 1 and writes it into parameter 2. More...
 
Function_ArrayRescale arrayRescale
 Scales the values from the first parameter with the second parameter and offsets it with the value from the third parameter, writing it to the position of the fourth parameter, times the fifth parameter. More...
 
Function_ArrayEqualsValue arrayEqualsValue
 Checks whether the first argument equals all the values given with the second argument (and the size in the third argument), returns true if all values are equal. More...
 
Function_ArrayGetMinMax arrayGetMinMax
 Returns the minimum and maximum component values from the array in the first argument, and retursn it in the third and fourth argument, the size of the array is in the second argument. More...
 
Function_Interpolate interpolate
 Interpolates linearly between the first and the second parameter, at the position given by the third parameter (between 0 and 1). More...
 
Function_ApplyIntOperation multWithInt
 Implements multiplication with integer. Result is written into parameter three. More...
 
Function_ApplyDoubleOperation multWithDouble
 Implements multiplication with double. Result is written into parameter three. More...
 
Function_ApplyOperation multWithType
 Implements multiplication with its own type. Result is written into parameter three. More...
 
Function_MultWithOtherType multWithOtherType
 Implements multiplication with another type. Result is written into parameter three. More...
 
Function_ApplyIntOperation plusInt
 Implements integer addition to parameter one. Result is written into parameter three. More...
 
Function_ApplyDoubleOperation plusDouble
 Implements double addition to parameter one. Result is written into parameter three. More...
 
Function_ApplyOperation plusType
 Implements parameter two addition to parameter one. Result is written into parameter three. More...
 

Detailed Description

template<typename VTYP>
class ml::MLTStdTypeInfos< VTYP >

Template class to register the standard integer classes as voxel types in the ML.

Definition at line 39 of file mlStdTypeInfos.h.

Constructor & Destructor Documentation

◆ MLTStdTypeInfos()

template<typename VTYP >
ml::MLTStdTypeInfos< VTYP >::MLTStdTypeInfos ( )
inline

Constructor.

In derived classes, all members must be set correctly depending on the properties of the described data type. The more properties are implemented, the more modules can support this data type. See MLTypeInfos.

Assign all pointers to the static functions implementing the operations.

Initialization of the main properties of MLTypeInfos. Returns 1 (=true) on success, 0 (=false) on failure. Initialize the data type information.

-Define sizeof of real data type (not the size of the carrying byte type)

-Define string name of data type.

-Set minimum and maximum double values. Notes: Try to select values that will not be exceeded if the new type is cast to double. Try to select values that are converted to the types's minimum/maximum after casting them to the new type. However, that is desirable but not necessary.

-Set pointers to a permanent instances of the the data type minimum and maximum value. Notes: Try to select minimum and maximum value so that they match the minimum and maximum double value after casting them to double. However, that is desirable but not necessary.

-Set pointer to a permanent instance of the the data type default value in derived class. Notes: This value will be used when initializing or completing incomplete type components, e.g., after incomplete string scans or casts. This value will also be used as a 0-element. This value will be used as false on boolean casts in the default implementation. All other values will be considered as true.

-Set pointer to a permanent NULL-terminated string describing the type configuration. It is needed for most default implementations of the type, e.g., correct big endian/little endian conversions when storing or loading this data, for automatic casts to other types. It must exactly describe the type configuration. Use

  1. 'b' for a boolean.
  2. 'c' for an unsigned character.
  3. 'C' for a (signed) character.
  4. 's' for an unsigned short.
  5. 'S' for a signed short.
  6. 'i' for an unsigned int.
  7. 'I' for a signed int.
  8. 'l' for an unsigned long.
  9. 'L' for a signed long.
  10. '6' for a 64-bit signed integer.
  11. '9' for a 64-bit unsigned integer.
  12. 'f' for a float.
  13. 'd' for a double.
  14. 'D' for a long double.

So a data type consisting of a float[3], a bool, and two signed integers would lead to "fffbII".

-Pass true if it is a basic type, i.e., one of the following: (unsigned) char, (unsigned) short, (unsigned) int, (unsigned) long, float, double, long double, or MLint64.

-Pass a standard data type that has comparable range and precision behavior.

-componentAddresses is an array of pointers to the components of an example data instance. This way, gaps between components can be evaluated. It must contain exactly as many pointers as the length of typeStructInfo.

Take a type instance and create an array of addresses to all of it is components.

Definition at line 231 of file mlStdTypeInfos.h.

References ML_HARAKIRI, ML_PRINT_FATAL_ERROR, ML_PROGRAMMING_ERROR, ML_TYPE_ASSIGN_FUNCTION_POINTERS, MLScalarTypeGroup, and MLTypeInfosInit().

Member Function Documentation

◆ _getGoodCastTos() [1/10]

template<typename VTYP >
void ml::MLTStdTypeInfos< VTYP >::_getGoodCastTos ( MLdouble  ,
MLuint num,
const char **&  typeNames 
)
inlineprotected

Definition at line 190 of file mlStdTypeInfos.h.

◆ _getGoodCastTos() [2/10]

template<typename VTYP >
void ml::MLTStdTypeInfos< VTYP >::_getGoodCastTos ( MLfloat  ,
MLuint num,
const char **&  typeNames 
)
inlineprotected

Definition at line 180 of file mlStdTypeInfos.h.

◆ _getGoodCastTos() [3/10]

template<typename VTYP >
void ml::MLTStdTypeInfos< VTYP >::_getGoodCastTos ( MLint16  ,
MLuint num,
const char **&  typeNames 
)
inlineprotected

Definition at line 127 of file mlStdTypeInfos.h.

◆ _getGoodCastTos() [4/10]

template<typename VTYP >
void ml::MLTStdTypeInfos< VTYP >::_getGoodCastTos ( MLint32  ,
MLuint num,
const char **&  typeNames 
)
inlineprotected

Definition at line 155 of file mlStdTypeInfos.h.

◆ _getGoodCastTos() [5/10]

template<typename VTYP >
void ml::MLTStdTypeInfos< VTYP >::_getGoodCastTos ( MLint64  ,
MLuint num,
const char **&  typeNames 
)
inlineprotected

Definition at line 196 of file mlStdTypeInfos.h.

◆ _getGoodCastTos() [6/10]

template<typename VTYP >
void ml::MLTStdTypeInfos< VTYP >::_getGoodCastTos ( MLint8  ,
MLuint num,
const char **&  typeNames 
)
inlineprotected

Definition at line 96 of file mlStdTypeInfos.h.

◆ _getGoodCastTos() [7/10]

template<typename VTYP >
void ml::MLTStdTypeInfos< VTYP >::_getGoodCastTos ( MLuint16  ,
MLuint num,
const char **&  typeNames 
)
inlineprotected

Definition at line 140 of file mlStdTypeInfos.h.

◆ _getGoodCastTos() [8/10]

template<typename VTYP >
void ml::MLTStdTypeInfos< VTYP >::_getGoodCastTos ( MLuint32  ,
MLuint num,
const char **&  typeNames 
)
inlineprotected

Definition at line 167 of file mlStdTypeInfos.h.

◆ _getGoodCastTos() [9/10]

template<typename VTYP >
void ml::MLTStdTypeInfos< VTYP >::_getGoodCastTos ( MLuint64  ,
MLuint num,
const char **&  typeNames 
)
inlineprotected

Definition at line 207 of file mlStdTypeInfos.h.

◆ _getGoodCastTos() [10/10]

template<typename VTYP >
void ml::MLTStdTypeInfos< VTYP >::_getGoodCastTos ( MLuint8  ,
MLuint num,
const char **&  typeNames 
)
inlineprotected

Definition at line 110 of file mlStdTypeInfos.h.

◆ _rangeAndPrecisionEquiv() [1/10]

template<typename VTYP >
MLDataType ml::MLTStdTypeInfos< VTYP >::_rangeAndPrecisionEquiv ( MLdouble  )
inlineprotected

Definition at line 80 of file mlStdTypeInfos.h.

References MLdoubleType.

◆ _rangeAndPrecisionEquiv() [2/10]

template<typename VTYP >
MLDataType ml::MLTStdTypeInfos< VTYP >::_rangeAndPrecisionEquiv ( MLfloat  )
inlineprotected

Definition at line 79 of file mlStdTypeInfos.h.

References MLfloatType.

◆ _rangeAndPrecisionEquiv() [3/10]

template<typename VTYP >
MLDataType ml::MLTStdTypeInfos< VTYP >::_rangeAndPrecisionEquiv ( MLint16  )
inlineprotected

Definition at line 75 of file mlStdTypeInfos.h.

References MLint16Type.

◆ _rangeAndPrecisionEquiv() [4/10]

template<typename VTYP >
MLDataType ml::MLTStdTypeInfos< VTYP >::_rangeAndPrecisionEquiv ( MLint32  )
inlineprotected

Definition at line 77 of file mlStdTypeInfos.h.

References MLint32Type.

◆ _rangeAndPrecisionEquiv() [5/10]

template<typename VTYP >
MLDataType ml::MLTStdTypeInfos< VTYP >::_rangeAndPrecisionEquiv ( MLint64  )
inlineprotected

Definition at line 81 of file mlStdTypeInfos.h.

References MLint64Type.

◆ _rangeAndPrecisionEquiv() [6/10]

template<typename VTYP >
MLDataType ml::MLTStdTypeInfos< VTYP >::_rangeAndPrecisionEquiv ( MLint8  )
inlineprotected

Definition at line 73 of file mlStdTypeInfos.h.

References MLint8Type.

◆ _rangeAndPrecisionEquiv() [7/10]

template<typename VTYP >
MLDataType ml::MLTStdTypeInfos< VTYP >::_rangeAndPrecisionEquiv ( MLuint16  )
inlineprotected

Definition at line 76 of file mlStdTypeInfos.h.

References MLuint16Type.

◆ _rangeAndPrecisionEquiv() [8/10]

template<typename VTYP >
MLDataType ml::MLTStdTypeInfos< VTYP >::_rangeAndPrecisionEquiv ( MLuint32  )
inlineprotected

Definition at line 78 of file mlStdTypeInfos.h.

References MLuint32Type.

◆ _rangeAndPrecisionEquiv() [9/10]

template<typename VTYP >
MLDataType ml::MLTStdTypeInfos< VTYP >::_rangeAndPrecisionEquiv ( MLuint64  )
inlineprotected

Definition at line 82 of file mlStdTypeInfos.h.

References MLuint64Type.

◆ _rangeAndPrecisionEquiv() [10/10]

template<typename VTYP >
MLDataType ml::MLTStdTypeInfos< VTYP >::_rangeAndPrecisionEquiv ( MLuint8  )
inlineprotected

Definition at line 74 of file mlStdTypeInfos.h.

References MLuint8Type.

◆ castToType() [1/3]

template<typename VTYP >
static VTYP ml::MLTStdTypeInfos< VTYP >::castToType ( MLdouble  v)
inlinestaticprotected

Implements a method that rounds a double value when casting to an integer but does not round when casting to a float type (special case below).


Definition at line 92 of file mlStdTypeInfos.h.

◆ castToType() [2/3]

MLfloat ml::MLTStdTypeInfos< MLfloat >::castToType ( MLdouble  v)
inlineprotected

Definition at line 484 of file mlStdTypeInfos.h.

◆ castToType() [3/3]

MLdouble ml::MLTStdTypeInfos< MLdouble >::castToType ( MLdouble  v)
inlineprotected

Definition at line 485 of file mlStdTypeInfos.h.

◆ MLTYPE_arrayCopy()

template<typename VTYP >
static void ml::MLTStdTypeInfos< VTYP >::MLTYPE_arrayCopy ( const MLTypeData source,
MLTypeData dest,
size_t  size 
)
inlinestatic

Copies s elements from the first parameter to the second one.

Definition at line 363 of file mlStdTypeInfos.h.

References boost::source().

◆ MLTYPE_arrayCopyWithStrides()

template<typename VTYP >
static void ml::MLTStdTypeInfos< VTYP >::MLTYPE_arrayCopyWithStrides ( const MLTypeData source,
MLssize_t  sourceStride,
MLTypeData dest,
MLssize_t  destStride,
size_t  size 
)
inlinestatic

Same as MLTYPE_arrayCopy, but allows to specify stride values for source and destination.

Definition at line 365 of file mlStdTypeInfos.h.

References boost::source().

◆ MLTYPE_arrayEqualsValue()

template<typename VTYP >
static bool ml::MLTStdTypeInfos< VTYP >::MLTYPE_arrayEqualsValue ( const MLTypeData value,
const MLTypeData buffer,
size_t  size 
)
inlinestatic

Checks that the first argument equals all the values given with the second argument (and the size in the third argument).

Returns true if all values are equal.

Definition at line 436 of file mlStdTypeInfos.h.

◆ MLTYPE_arrayFill()

template<typename VTYP >
static void ml::MLTStdTypeInfos< VTYP >::MLTYPE_arrayFill ( const MLTypeData fillValue,
MLTypeData dest,
size_t  n 
)
inlinestatic

Copies the first parameter to the second one as often as given in the third parameter.

Definition at line 376 of file mlStdTypeInfos.h.

◆ MLTYPE_arrayGetMinMax()

template<typename VTYP >
static void ml::MLTStdTypeInfos< VTYP >::MLTYPE_arrayGetMinMax ( const MLTypeData p,
size_t  s,
MLdouble min,
MLdouble max 
)
inlinestatic

Gets the mininum and maximum component values from the array in the first argument, and returns it in the third and fourth argument, the size of the array is in the second argument.

Definition at line 448 of file mlStdTypeInfos.h.

◆ MLTYPE_arrayRescale()

template<typename VTYP >
static void ml::MLTStdTypeInfos< VTYP >::MLTYPE_arrayRescale ( const MLTypeData source,
MLdouble  factor,
const MLTypeData offset,
MLTypeData dest,
size_t  size 
)
inlinestatic

Scales the values from the first parameter with the second parameter and offsets it with the value from the third parameter, writing it to the position of the fourth parameter, times the fifth parameter.

Definition at line 424 of file mlStdTypeInfos.h.

References boost::source().

◆ MLTYPE_castFromDouble()

template<typename VTYP >
static void ml::MLTStdTypeInfos< VTYP >::MLTYPE_castFromDouble ( MLdouble  p,
MLTypeData q 
)
inlinestatic

Casts the first parameters to data type and writes it into the second parameter.

Definition at line 405 of file mlStdTypeInfos.h.

◆ MLTYPE_castFromInt()

template<typename VTYP >
static void ml::MLTStdTypeInfos< VTYP >::MLTYPE_castFromInt ( MLint  p,
MLTypeData q 
)
inlinestatic

Casts the first parameters to data type and writes it into the second parameter.

Definition at line 403 of file mlStdTypeInfos.h.

◆ MLTYPE_castFromOtherType()

template<typename VTYP >
static void ml::MLTStdTypeInfos< VTYP >::MLTYPE_castFromOtherType ( const MLTypeInfos otherInfos,
const MLTypeData otherData,
MLTypeData myData 
)
inlinestatic

Casts the first parameters to data type and writes it into the second parameter.

Definition at line 407 of file mlStdTypeInfos.h.

References MLTypeCastToOtherType().

◆ MLTYPE_castToBool()

template<typename VTYP >
static bool ml::MLTStdTypeInfos< VTYP >::MLTYPE_castToBool ( const MLTypeData p)
inlinestatic

Returns the parameter cast to bool. Typically, it returns false if it is identically to the default element; otherwise, it returns true.

Definition at line 394 of file mlStdTypeInfos.h.

References MLValuesDifferWOM().

◆ MLTYPE_castToDouble()

template<typename VTYP >
static MLdouble ml::MLTStdTypeInfos< VTYP >::MLTYPE_castToDouble ( const MLTypeData p)
inlinestatic

Returns the parameter cast to double. Often the integer cast of the first component.

Definition at line 398 of file mlStdTypeInfos.h.

◆ MLTYPE_castToInt()

template<typename VTYP >
static MLint ml::MLTStdTypeInfos< VTYP >::MLTYPE_castToInt ( const MLTypeData p)
inlinestatic

Returns the parameter cast to integer. Often the integer cast of the first component.

Definition at line 396 of file mlStdTypeInfos.h.

◆ MLTYPE_castToOtherType()

template<typename VTYP >
static void ml::MLTStdTypeInfos< VTYP >::MLTYPE_castToOtherType ( const MLTypeData myData,
const MLTypeInfos otherInfos,
MLTypeData otherData 
)
inlinestatic

Returns the parameter cast to double. Usually implemented by default with function casting component-wise.

Definition at line 400 of file mlStdTypeInfos.h.

References MLTypeCastToOtherType().

◆ MLTYPE_copy()

template<typename VTYP >
static void ml::MLTStdTypeInfos< VTYP >::MLTYPE_copy ( const MLTypeData source,
MLTypeData dest 
)
inlinestatic

Copies first parameter to second one.

Definition at line 361 of file mlStdTypeInfos.h.

References boost::source().

◆ MLTYPE_getComponent()

template<typename VTYP >
static MLdouble ml::MLTStdTypeInfos< VTYP >::MLTYPE_getComponent ( const MLTypeData p,
size_t   
)
inlinestatic

Returns n-th component as double value. Must be implemented.

Definition at line 357 of file mlStdTypeInfos.h.

◆ MLTYPE_getStringValue()

template<typename VTYP >
static char* ml::MLTStdTypeInfos< VTYP >::MLTYPE_getStringValue ( const MLTypeData p)
inlinestatic

Returns the value as string to be freed by MLFree(). Use MLTypeComponentsToString() if possible.

Definition at line 340 of file mlStdTypeInfos.h.

References MLTypeComponentsToString().

◆ MLTYPE_interpolate()

template<typename VTYP >
static void ml::MLTStdTypeInfos< VTYP >::MLTYPE_interpolate ( const MLTypeData p,
const MLTypeData q,
MLdouble  r,
MLTypeData t 
)
inlinestatic

Interpolates linearly between the first and the second parameter, at the position given by the third parameter (between 0 and 1).

Result is written into parameter three.

Definition at line 460 of file mlStdTypeInfos.h.

◆ MLTYPE_isEqualToType()

template<typename VTYP >
static bool ml::MLTStdTypeInfos< VTYP >::MLTYPE_isEqualToType ( const MLTypeData p,
const MLTypeData q 
)
inlinestatic

Returns true if both parameters are equal; otherwise, it returns false.

Definition at line 411 of file mlStdTypeInfos.h.

References MLValuesAreEqualWOM().

◆ MLTYPE_isEqualToTypeWithEpsilon()

template<typename VTYP >
static bool ml::MLTStdTypeInfos< VTYP >::MLTYPE_isEqualToTypeWithEpsilon ( const MLTypeData p,
const MLTypeData q,
MLdouble  eps 
)
inlinestatic

Returns true if both parameters are equal within a static epsilon; otherwise, it returns false.

Definition at line 413 of file mlStdTypeInfos.h.

References MLAbs().

◆ MLTYPE_multWithDouble()

template<typename VTYP >
static void ml::MLTStdTypeInfos< VTYP >::MLTYPE_multWithDouble ( const MLTypeData p,
MLdouble  q,
MLTypeData r 
)
inlinestatic

Implements multiplication with double. Result is written into parameter three.

Definition at line 467 of file mlStdTypeInfos.h.

◆ MLTYPE_multWithInt()

template<typename VTYP >
static void ml::MLTStdTypeInfos< VTYP >::MLTYPE_multWithInt ( const MLTypeData p,
MLint  q,
MLTypeData r 
)
inlinestatic

Implements multiplication with integer. Result is written into parameter three.

Definition at line 465 of file mlStdTypeInfos.h.

◆ MLTYPE_multWithOtherType()

template<typename VTYP >
static void ml::MLTStdTypeInfos< VTYP >::MLTYPE_multWithOtherType ( const MLTypeInfos otherInfos,
const MLTypeData otherData,
const MLTypeData myData,
MLTypeData r 
)
inlinestatic

Implements multiplication with another type. Result is written into parameter three.

Definition at line 471 of file mlStdTypeInfos.h.

References MLTypeMultWithOtherType().

◆ MLTYPE_multWithType()

template<typename VTYP >
static void ml::MLTStdTypeInfos< VTYP >::MLTYPE_multWithType ( const MLTypeData p,
const MLTypeData q,
MLTypeData r 
)
inlinestatic

Implements multiplication with its own type. Result is written into parameter three.

Definition at line 469 of file mlStdTypeInfos.h.

◆ MLTYPE_negate() [1/5]

template<typename VTYP >
static void ml::MLTStdTypeInfos< VTYP >::MLTYPE_negate ( const MLTypeData p,
MLTypeData q 
)
inlinestatic

Negates the value. See also the specialized negations for unsigned types that leave the value unchanged.

Definition at line 416 of file mlStdTypeInfos.h.

◆ MLTYPE_negate() [2/5]

void ml::MLTStdTypeInfos< MLuint8 >::MLTYPE_negate ( const MLTypeData p,
MLTypeData q 
)
inline

Definition at line 489 of file mlStdTypeInfos.h.

◆ MLTYPE_negate() [3/5]

void ml::MLTStdTypeInfos< MLuint16 >::MLTYPE_negate ( const MLTypeData p,
MLTypeData q 
)
inline

Definition at line 490 of file mlStdTypeInfos.h.

◆ MLTYPE_negate() [4/5]

void ml::MLTStdTypeInfos< MLuint32 >::MLTYPE_negate ( const MLTypeData p,
MLTypeData q 
)
inline

Definition at line 491 of file mlStdTypeInfos.h.

◆ MLTYPE_negate() [5/5]

void ml::MLTStdTypeInfos< MLuint64 >::MLTYPE_negate ( const MLTypeData p,
MLTypeData q 
)
inline

Definition at line 492 of file mlStdTypeInfos.h.

◆ MLTYPE_normalize()

template<typename VTYP >
static void ml::MLTStdTypeInfos< VTYP >::MLTYPE_normalize ( const MLTypeData ,
MLTypeData q 
)
inlinestatic

Normalizes the type.

Definition at line 419 of file mlStdTypeInfos.h.

◆ MLTYPE_plusDouble()

template<typename VTYP >
static void ml::MLTStdTypeInfos< VTYP >::MLTYPE_plusDouble ( const MLTypeData p,
MLdouble  q,
MLTypeData r 
)
inlinestatic

Implements double addition to parameter one. Result is written into parameter three.

Definition at line 477 of file mlStdTypeInfos.h.

◆ MLTYPE_plusInt()

template<typename VTYP >
static void ml::MLTStdTypeInfos< VTYP >::MLTYPE_plusInt ( const MLTypeData p,
MLint  q,
MLTypeData r 
)
inlinestatic

Implements integer addition to parameter one. Result is written into parameter three.

Definition at line 475 of file mlStdTypeInfos.h.

◆ MLTYPE_plusType()

template<typename VTYP >
static void ml::MLTStdTypeInfos< VTYP >::MLTYPE_plusType ( const MLTypeData p,
const MLTypeData q,
MLTypeData r 
)
inlinestatic

Implements parameter two addition to parameter one. Result is written into parameter three.

Definition at line 479 of file mlStdTypeInfos.h.

◆ MLTYPE_setComponent()

template<typename VTYP >
static void ml::MLTStdTypeInfos< VTYP >::MLTYPE_setComponent ( MLTypeData p,
size_t  ,
MLdouble  v 
)
inlinestatic

Sets n-th component from double value. Must be implemented.

Definition at line 359 of file mlStdTypeInfos.h.

◆ MLTYPE_setStringValue()

template<typename VTYP >
static void ml::MLTStdTypeInfos< VTYP >::MLTYPE_setStringValue ( const char *  s,
MLTypeData r 
)
inlinestatic

Converts the string s to a value and writes result into r. Use MLTypeComponentsFromString() if possible.

Definition at line 342 of file mlStdTypeInfos.h.

References ml::logTypeComponentsFromStringError(), and MLTypeComponentsFromString().

◆ MLTYPE_setToDefault()

template<typename VTYP >
static void ml::MLTStdTypeInfos< VTYP >::MLTYPE_setToDefault ( MLTypeData p)
inlinestatic

Sets value to default value. Must be implemented.

Definition at line 355 of file mlStdTypeInfos.h.

◆ MLTYPE_setToMaximum()

template<typename VTYP >
static void ml::MLTStdTypeInfos< VTYP >::MLTYPE_setToMaximum ( MLTypeData p)
inlinestatic

Sets value to minimum value. Must be implemented.

Definition at line 353 of file mlStdTypeInfos.h.

◆ MLTYPE_setToMinimum()

template<typename VTYP >
static void ml::MLTStdTypeInfos< VTYP >::MLTYPE_setToMinimum ( MLTypeData p)
inlinestatic

Sets value to minimum value. Must be implemented.

Definition at line 351 of file mlStdTypeInfos.h.

◆ typeName() [1/10]

template<typename VTYP >
static const char* ml::MLTStdTypeInfos< VTYP >::typeName ( MLdouble )
inlinestatic

Definition at line 53 of file mlStdTypeInfos.h.

References MLTypeInfos::name.

◆ typeName() [2/10]

template<typename VTYP >
static const char* ml::MLTStdTypeInfos< VTYP >::typeName ( MLfloat )
inlinestatic

Definition at line 52 of file mlStdTypeInfos.h.

References MLTypeInfos::name.

◆ typeName() [3/10]

template<typename VTYP >
static const char* ml::MLTStdTypeInfos< VTYP >::typeName ( MLint16 )
inlinestatic

Definition at line 48 of file mlStdTypeInfos.h.

References MLTypeInfos::name.

◆ typeName() [4/10]

template<typename VTYP >
static const char* ml::MLTStdTypeInfos< VTYP >::typeName ( MLint32 )
inlinestatic

Definition at line 50 of file mlStdTypeInfos.h.

References MLTypeInfos::name.

◆ typeName() [5/10]

template<typename VTYP >
static const char* ml::MLTStdTypeInfos< VTYP >::typeName ( MLint64 )
inlinestatic

Definition at line 54 of file mlStdTypeInfos.h.

References MLTypeInfos::name.

◆ typeName() [6/10]

template<typename VTYP >
static const char* ml::MLTStdTypeInfos< VTYP >::typeName ( MLint8 )
inlinestatic

Definition at line 46 of file mlStdTypeInfos.h.

References MLTypeInfos::name.

◆ typeName() [7/10]

template<typename VTYP >
static const char* ml::MLTStdTypeInfos< VTYP >::typeName ( MLuint16 )
inlinestatic

Definition at line 49 of file mlStdTypeInfos.h.

References MLTypeInfos::name.

◆ typeName() [8/10]

template<typename VTYP >
static const char* ml::MLTStdTypeInfos< VTYP >::typeName ( MLuint32 )
inlinestatic

Definition at line 51 of file mlStdTypeInfos.h.

References MLTypeInfos::name.

◆ typeName() [9/10]

template<typename VTYP >
static const char* ml::MLTStdTypeInfos< VTYP >::typeName ( MLuint64 )
inlinestatic

Definition at line 55 of file mlStdTypeInfos.h.

References MLTypeInfos::name.

◆ typeName() [10/10]

template<typename VTYP >
static const char* ml::MLTStdTypeInfos< VTYP >::typeName ( MLuint8 )
inlinestatic

Definition at line 47 of file mlStdTypeInfos.h.

References MLTypeInfos::name.

◆ value_cast() [1/2]

template<typename VTYP >
static const VTYP& ml::MLTStdTypeInfos< VTYP >::value_cast ( const MLTypeData v)
inlinestaticprotected

Definition at line 87 of file mlStdTypeInfos.h.

◆ value_cast() [2/2]

template<typename VTYP >
static VTYP& ml::MLTStdTypeInfos< VTYP >::value_cast ( MLTypeData v)
inlinestaticprotected

Avoid using reinterpret_casts.

Definition at line 86 of file mlStdTypeInfos.h.

Member Data Documentation

◆ _myInfos

template<typename VTYP >
MLTypeInfos * ml::MLTStdTypeInfos< VTYP >::_myInfos = nullptr
staticprotected

Permanent instance of a pointer to the typeInfos used by this class.

Definition at line 220 of file mlStdTypeInfos.h.

◆ _numInstances

template<typename VTYP >
MLint32 ml::MLTStdTypeInfos< VTYP >::_numInstances = 0
staticprotected

The number of instances of this class.

It is used to avoid that more than one instance is created

Definition at line 224 of file mlStdTypeInfos.h.

◆ _typeDefault

template<typename VTYP >
const VTYP ml::MLTStdTypeInfos< VTYP >::_typeDefault = VTYP(0)
staticprotected

Permanent instance of the default value.

Definition at line 66 of file mlStdTypeInfos.h.

◆ _typeInfoString

template<typename VTYP >
const char ml::MLTStdTypeInfos< VTYP >::_typeInfoString[_ML_STD_SLEN]
staticprotected

Permanent instance of the type's description.

Definition at line 69 of file mlStdTypeInfos.h.

◆ _typeMax

template<typename VTYP >
const VTYP ml::MLTStdTypeInfos< VTYP >::_typeMax
staticprotected

Permanent instance of the maximum value.

Definition at line 63 of file mlStdTypeInfos.h.

◆ _typeMin

template<typename VTYP >
const VTYP ml::MLTStdTypeInfos< VTYP >::_typeMin
staticprotected

Permanent instance of the minimum value.

Definition at line 60 of file mlStdTypeInfos.h.


The documentation for this class was generated from the following file: