MeVis/Foundation/Sources/ML/include/mlTypeTraits.h File Reference

#include "mlInitSystemML.h"
#include "mlCarrierTypes.h"

Go to the source code of this file.


Classes

struct  ml::TypeTraits< T >
 TypeTraits for physical ML Datatypes. More...
struct  ml::PhysicalTypeSelector< physicalTypeId >
 Helper template so select a physical type from its type id. More...

Namespaces

namespace  ml
 Define the namespace name like in the ML. Default is ml.

Defines

#define _ML_DECLARE_TYPETRAIT_BODY(TYPE, FLAGS)
#define ML_DECLARE_TYPETRAIT(TYPE, FLAGS)
 Macro to declare own type traits.
#define ML_DECLARE_CARRIER_TYPETRAIT(TYPE, FLAGS)
 Macro to declare own carrier type traits.

Enumerations

enum  {
  ml::ML_INTEGER_TYPE = 0x1, ml::ML_FLOAT_TYPE = 0x2, ml::ML_CARRIER_OUT_TYPE = 0x4, ml::ML_CARRIER_IN_TYPE = 0x8,
  ml::ML_LDOUBLE_TYPE = 0x10, ml::ML_SIGNED_TYPE = 0x20
}


Detailed Description

Author:
Florian Link
Date:
09/2009

Definition in file mlTypeTraits.h.


Define Documentation

#define _ML_DECLARE_TYPETRAIT_BODY ( TYPE,
FLAGS   ) 

Value:

template <> struct PhysicalTypeSelector<TYPE##Type>   { typedef TYPE Type; };                      \
  template <> struct TypeTraits<TYPE>  {                                                             \
  enum {                                                                                             \
  physicalDataType      = TYPE##Type,                                                                \
  isBuiltInFloatType    = (((FLAGS) & ML_FLOAT_TYPE) != 0),                                          \
  isBuiltInIntegerType  = (((FLAGS) & ML_INTEGER_TYPE) != 0),                                        \
  isStandardType        = (((FLAGS) & (ML_INTEGER_TYPE | ML_FLOAT_TYPE)) != 0),                      \
  isBuiltInSignedType   = (((FLAGS) & ML_SIGNED_TYPE) != 0),                                         \
  /*isSignedType      = Not possible, since this is a dynamic behavior of the carrier types */       \
  isAnyCarrierType      = (((FLAGS) & (ML_CARRIER_OUT_TYPE | ML_CARRIER_IN_TYPE)) != 0),             \
  isCarrierOutType      = (((FLAGS) & ML_CARRIER_OUT_TYPE) != 0),                                    \
  isCarrierInType       = (((FLAGS) & ML_CARRIER_IN_TYPE) != 0),                                     \
  isLDouble             = (((FLAGS) & ML_LDOUBLE_TYPE) != 0),                                        \
  is8BitInteger         = ((((FLAGS) & ML_INTEGER_TYPE) != 0) && (sizeof(TYPE)==sizeof(MLuint8))  ), \
  is16BitInteger        = ((((FLAGS) & ML_INTEGER_TYPE) != 0) && (sizeof(TYPE)==sizeof(MLuint16)) ), \
  is32BitInteger        = ((((FLAGS) & ML_INTEGER_TYPE) != 0) && (sizeof(TYPE)==sizeof(MLuint32)) ), \
  is64BitInteger        = ((((FLAGS) & ML_INTEGER_TYPE) != 0) && (sizeof(TYPE)==sizeof(MLuint64)) ), \
  is8_16_32BitInteger   = ((((FLAGS) & ML_INTEGER_TYPE) != 0) &&                                     \
  ((sizeof(TYPE)==sizeof(MLuint8))  ||                                                               \
  (sizeof(TYPE)==sizeof(MLuint16)) ||                                                                \
  (sizeof(TYPE)==sizeof(MLuint32)))),                                                                \
  isUnknown             = false                                                                      \
  };

Definition at line 89 of file mlTypeTraits.h.

#define ML_DECLARE_CARRIER_TYPETRAIT ( TYPE,
FLAGS   ) 

Value:

_ML_DECLARE_TYPETRAIT_BODY(TYPE, FLAGS)          \
  /* dynamically get the signed type */            \
  static inline MLint32    isSignedType() { return MLTypePropBitsTest(TYPE::getTypeInfos().propertyBits, MLTypeIsSignedType); } \
  /* dynamically get the data type */              \
  static inline MLDataType getDataType()  { return static_cast<MLDataType>(TYPE::getTypeInfos().dataTypeId); }                  \
  };
Macro to declare own carrier type traits.

Definition at line 122 of file mlTypeTraits.h.

#define ML_DECLARE_TYPETRAIT ( TYPE,
FLAGS   ) 

Value:

_ML_DECLARE_TYPETRAIT_BODY(TYPE, FLAGS)  \
  static inline MLint32    isSignedType() { return (((FLAGS) & ML_SIGNED_TYPE) !=0)?1:0; } \
  static inline MLDataType getDataType()  { return static_cast<MLDataType>(TYPE##Type); } \
  };
Macro to declare own type traits.

Definition at line 115 of file mlTypeTraits.h.


Generated on Sat Sep 3 18:39:27 2011 for MeVisLab Toolbox Reference by  doxygen 1.5.8