neuray API Programmer's Manual

type_traits.h File Reference

Description

Type traits.

Code Example

type_traits.h

‎//*****************************************************************************
// Copyright 1986, 2016 NVIDIA Corporation. All rights reserved.
//*****************************************************************************
//*****************************************************************************

#ifndef MI_NEURAYLIB_TYPE_TRAITS_H
#define MI_NEURAYLIB_TYPE_TRAITS_H

#include <mi/base/interface_declare.h>
#include <mi/neuraylib/idata.h>

namespace mi {

class IData;
class IBoolean;
class ISint8;
class ISint16;
class ISint32;
class ISint64;
class IUint8;
class IUint16;
class IUint32;
class IUint64;
class IFloat32;
class IFloat64;
class ISize;
class IDifference;
class IString;
class IUuid;
class IVoid;
class IRef;
class IParameter;
class ITemporary;
class IBoolean_2;
class IBoolean_3;
class IBoolean_4;
class ISint32_2;
class ISint32_3;
class ISint32_4;
class IUint32_2;
class IUint32_3;
class IUint32_4;
class IFloat32_2;
class IFloat32_3;
class IFloat32_4;
class IFloat64_2;
class IFloat64_3;
class IFloat64_4;
class IBoolean_2_2;
class IBoolean_2_3;
class IBoolean_2_4;
class IBoolean_3_2;
class IBoolean_3_3;
class IBoolean_3_4;
class IBoolean_4_2;
class IBoolean_4_3;
class IBoolean_4_4;
class ISint32_2_2;
class ISint32_2_3;
class ISint32_2_4;
class ISint32_3_2;
class ISint32_3_3;
class ISint32_3_4;
class ISint32_4_2;
class ISint32_4_3;
class ISint32_4_4;
class IUint32_2_2;
class IUint32_2_3;
class IUint32_2_4;
class IUint32_3_2;
class IUint32_3_3;
class IUint32_3_4;
class IUint32_4_2;
class IUint32_4_3;
class IUint32_4_4;
class IFloat32_2_2;
class IFloat32_2_3;
class IFloat32_2_4;
class IFloat32_3_2;
class IFloat32_3_3;
class IFloat32_3_4;
class IFloat32_4_2;
class IFloat32_4_3;
class IFloat32_4_4;
class IFloat64_2_2;
class IFloat64_2_3;
class IFloat64_2_4;
class IFloat64_3_2;
class IFloat64_3_3;
class IFloat64_3_4;
class IFloat64_4_2;
class IFloat64_4_3;
class IFloat64_4_4;
class IColor;
class IColor3;
class ISpectrum;
class IBbox3;

template<typename I> struct Type_traits {};

template<> struct Type_traits<mi::IBoolean>
{ static const char* get_type_name() { return "Boolean"; } };

template<> struct Type_traits<mi::ISint8>
{ static const char* get_type_name() { return "Sint8"; } };

template<> struct Type_traits<mi::ISint16>
{ static const char* get_type_name() { return "Sint16"; } };

template<> struct Type_traits<mi::ISint32>
{ static const char* get_type_name() { return "Sint32"; } };

template<> struct Type_traits<mi::ISint64>
{ static const char* get_type_name() { return "Sint64"; } };

template<> struct Type_traits<mi::IUint8>
{ static const char* get_type_name() { return "Uint8"; } };

template<> struct Type_traits<mi::IUint16>
{ static const char* get_type_name() { return "Uint16"; } };

template<> struct Type_traits<mi::IUint32>
{ static const char* get_type_name() { return "Uint32"; } };

template<> struct Type_traits<mi::IUint64>
{ static const char* get_type_name() { return "Uint64"; } };

template<> struct Type_traits<mi::IFloat32>
{ static const char* get_type_name() { return "Float32"; } };

template<> struct Type_traits<mi::IFloat64>
{ static const char* get_type_name() { return "Float64"; } };

template<> struct Type_traits<mi::ISize>
{ static const char* get_type_name() { return "Size"; } };

template<> struct Type_traits<mi::IDifference>
{ static const char* get_type_name() { return "Difference"; } };

template<> struct Type_traits<mi::IString>
{ static const char* get_type_name() { return "String"; } };

template<> struct Type_traits<mi::IUuid>
{ static const char* get_type_name() { return "Uuid"; } };

template<> struct Type_traits<mi::IVoid>
{ static const char* get_type_name() { return "Void"; } };

template<> struct Type_traits<mi::IRef>
{ static const char* get_type_name() { return "Ref"; } };

template<> struct Type_traits<mi::IParameter>
{ static const char* get_type_name() { return "Parameter"; } };

template<> struct Type_traits<mi::ITemporary>
{ static const char* get_type_name() { return "Temporary"; } };

template<> struct Type_traits<mi::IBoolean_2>
{ static const char* get_type_name() { return "Boolean<2>"; } };

template<> struct Type_traits<mi::IBoolean_3>
{ static const char* get_type_name() { return "Boolean<3>"; } };

template<> struct Type_traits<mi::IBoolean_4>
{ static const char* get_type_name() { return "Boolean<4>"; } };

template<> struct Type_traits<mi::ISint32_2>
{ static const char* get_type_name() { return "Sint32<2>"; } };

template<> struct Type_traits<mi::ISint32_3>
{ static const char* get_type_name() { return "Sint32<3>"; } };

template<> struct Type_traits<mi::ISint32_4>
{ static const char* get_type_name() { return "Sint32<4>"; } };

template<> struct Type_traits<mi::IUint32_2>
{ static const char* get_type_name() { return "Uint32<2>"; } };

template<> struct Type_traits<mi::IUint32_3>
{ static const char* get_type_name() { return "Uint32<3>"; } };

template<> struct Type_traits<mi::IUint32_4>
{ static const char* get_type_name() { return "Uint32<4>"; } };

template<> struct Type_traits<mi::IFloat32_2>
{ static const char* get_type_name() { return "Float32<2>"; } };

template<> struct Type_traits<mi::IFloat32_3>
{ static const char* get_type_name() { return "Float32<3>"; } };

template<> struct Type_traits<mi::IFloat32_4>
{ static const char* get_type_name() { return "Float32<4>"; } };

template<> struct Type_traits<mi::IFloat64_2>
{ static const char* get_type_name() { return "Float64<2>"; } };

template<> struct Type_traits<mi::IFloat64_3>
{ static const char* get_type_name() { return "Float64<3>"; } };

template<> struct Type_traits<mi::IFloat64_4>
{ static const char* get_type_name() { return "Float64<4>"; } };

template<> struct Type_traits<mi::IBoolean_2_2>
{ static const char* get_type_name() { return "Boolean<2,2>"; } };

template<> struct Type_traits<mi::IBoolean_2_3>
{ static const char* get_type_name() { return "Boolean<2,3>"; } };

template<> struct Type_traits<mi::IBoolean_2_4>
{ static const char* get_type_name() { return "Boolean<2,4>"; } };

template<> struct Type_traits<mi::IBoolean_3_2>
{ static const char* get_type_name() { return "Boolean<3,2>"; } };

template<> struct Type_traits<mi::IBoolean_3_3>
{ static const char* get_type_name() { return "Boolean<3,3>"; } };

template<> struct Type_traits<mi::IBoolean_3_4>
{ static const char* get_type_name() { return "Boolean<3,4>"; } };

template<> struct Type_traits<mi::IBoolean_4_2>
{ static const char* get_type_name() { return "Boolean<4,2>"; } };

template<> struct Type_traits<mi::IBoolean_4_3>
{ static const char* get_type_name() { return "Boolean<4,3>"; } };

template<> struct Type_traits<mi::IBoolean_4_4>
{ static const char* get_type_name() { return "Boolean<4,4>"; } };

template<> struct Type_traits<mi::ISint32_2_2>
{ static const char* get_type_name() { return "Sint32<2,2>"; } };

template<> struct Type_traits<mi::ISint32_2_3>
{ static const char* get_type_name() { return "Sint32<2,3>"; } };

template<> struct Type_traits<mi::ISint32_2_4>
{ static const char* get_type_name() { return "Sint32<2,4>"; } };

template<> struct Type_traits<mi::ISint32_3_2>
{ static const char* get_type_name() { return "Sint32<3,2>"; } };

template<> struct Type_traits<mi::ISint32_3_3>
{ static const char* get_type_name() { return "Sint32<3,3>"; } };

template<> struct Type_traits<mi::ISint32_3_4>
{ static const char* get_type_name() { return "Sint32<3,4>"; } };

template<> struct Type_traits<mi::ISint32_4_2>
{ static const char* get_type_name() { return "Sint32<4,2>"; } };

template<> struct Type_traits<mi::ISint32_4_3>
{ static const char* get_type_name() { return "Sint32<4,3>"; } };

template<> struct Type_traits<mi::ISint32_4_4>
{ static const char* get_type_name() { return "Sint32<4,4>"; } };

template<> struct Type_traits<mi::IUint32_2_2>
{ static const char* get_type_name() { return "Uint32<2,2>"; } };

template<> struct Type_traits<mi::IUint32_2_3>
{ static const char* get_type_name() { return "Uint32<2,3>"; } };

template<> struct Type_traits<mi::IUint32_2_4>
{ static const char* get_type_name() { return "Uint32<2,4>"; } };

template<> struct Type_traits<mi::IUint32_3_2>
{ static const char* get_type_name() { return "Uint32<3,2>"; } };

template<> struct Type_traits<mi::IUint32_3_3>
{ static const char* get_type_name() { return "Uint32<3,3>"; } };

template<> struct Type_traits<mi::IUint32_3_4>
{ static const char* get_type_name() { return "Uint32<3,4>"; } };

template<> struct Type_traits<mi::IUint32_4_2>
{ static const char* get_type_name() { return "Uint32<4,2>"; } };

template<> struct Type_traits<mi::IUint32_4_3>
{ static const char* get_type_name() { return "Uint32<4,3>"; } };

template<> struct Type_traits<mi::IUint32_4_4>
{ static const char* get_type_name() { return "Uint32<4,4>"; } };

template<> struct Type_traits<mi::IFloat32_2_2>
{ static const char* get_type_name() { return "Float32<2,2>"; } };

template<> struct Type_traits<mi::IFloat32_2_3>
{ static const char* get_type_name() { return "Float32<2,3>"; } };

template<> struct Type_traits<mi::IFloat32_2_4>
{ static const char* get_type_name() { return "Float32<2,4>"; } };

template<> struct Type_traits<mi::IFloat32_3_2>
{ static const char* get_type_name() { return "Float32<3,2>"; } };

template<> struct Type_traits<mi::IFloat32_3_3>
{ static const char* get_type_name() { return "Float32<3,3>"; } };

template<> struct Type_traits<mi::IFloat32_3_4>
{ static const char* get_type_name() { return "Float32<3,4>"; } };

template<> struct Type_traits<mi::IFloat32_4_2>
{ static const char* get_type_name() { return "Float32<4,2>"; } };

template<> struct Type_traits<mi::IFloat32_4_3>
{ static const char* get_type_name() { return "Float32<4,3>"; } };

template<> struct Type_traits<mi::IFloat32_4_4>
{ static const char* get_type_name() { return "Float32<4,4>"; } };

template<> struct Type_traits<mi::IFloat64_2_2>
{ static const char* get_type_name() { return "Float64<2,2>"; } };

template<> struct Type_traits<mi::IFloat64_2_3>
{ static const char* get_type_name() { return "Float64<2,3>"; } };

template<> struct Type_traits<mi::IFloat64_2_4>
{ static const char* get_type_name() { return "Float64<2,4>"; } };

template<> struct Type_traits<mi::IFloat64_3_2>
{ static const char* get_type_name() { return "Float64<3,2>"; } };

template<> struct Type_traits<mi::IFloat64_3_3>
{ static const char* get_type_name() { return "Float64<3,3>"; } };

template<> struct Type_traits<mi::IFloat64_3_4>
{ static const char* get_type_name() { return "Float64<3,4>"; } };

template<> struct Type_traits<mi::IFloat64_4_2>
{ static const char* get_type_name() { return "Float64<4,2>"; } };

template<> struct Type_traits<mi::IFloat64_4_3>
{ static const char* get_type_name() { return "Float64<4,3>"; } };

template<> struct Type_traits<mi::IFloat64_4_4>
{ static const char* get_type_name() { return "Float64<4,4>"; } };

template<> struct Type_traits<mi::IColor>
{ static const char* get_type_name() { return "Color"; } };

template<> struct Type_traits<mi::IColor3>
{ static const char* get_type_name() { return "Color3"; } };

template<> struct Type_traits<mi::ISpectrum>
{ static const char* get_type_name() { return "Spectrum"; } };

template<> struct Type_traits<mi::IBbox3>
{ static const char* get_type_name() { return "Bbox3"; } };

template<typename I, Size DIM> struct Vector_type_traits {};

template<> struct Vector_type_traits<bool, 2>
{ typedef mi::IBoolean_2 Interface_type; };

template<> struct Vector_type_traits<bool, 3>
{ typedef mi::IBoolean_3 Interface_type; };

template<> struct Vector_type_traits<bool, 4>
{ typedef mi::IBoolean_4 Interface_type; };

template<> struct Vector_type_traits<mi::Sint32, 2>
{ typedef mi::ISint32_2 Interface_type; };

template<> struct Vector_type_traits<mi::Sint32, 3>
{ typedef mi::ISint32_3 Interface_type; };

template<> struct Vector_type_traits<mi::Sint32, 4>
{ typedef mi::ISint32_4 Interface_type; };

template<> struct Vector_type_traits<mi::Float32, 2>
{ typedef mi::IFloat32_2 Interface_type; };

template<> struct Vector_type_traits<mi::Float32, 3>
{ typedef mi::IFloat32_3 Interface_type; };

template<> struct Vector_type_traits<mi::Float32, 4>
{ typedef mi::IFloat32_4 Interface_type; };

template<> struct Vector_type_traits<mi::Float64, 2>
{ typedef mi::IFloat64_2 Interface_type; };

template<> struct Vector_type_traits<mi::Float64, 3>
{ typedef mi::IFloat64_3 Interface_type; };

template<> struct Vector_type_traits<mi::Float64, 4>
{ typedef mi::IFloat64_4 Interface_type; };

template<typename I, Size ROW, Size COL> struct Matrix_type_traits {};

template<> struct Matrix_type_traits<bool, 2, 2>
{ typedef mi::IBoolean_2_2 Interface_type; };

template<> struct Matrix_type_traits<bool, 2, 3>
{ typedef mi::IBoolean_2_3 Interface_type; };

template<> struct Matrix_type_traits<bool, 2, 4>
{ typedef mi::IBoolean_2_4 Interface_type; };

template<> struct Matrix_type_traits<bool, 3, 2>
{ typedef mi::IBoolean_3_2 Interface_type; };

template<> struct Matrix_type_traits<bool, 3, 3>
{ typedef mi::IBoolean_3_3 Interface_type; };

template<> struct Matrix_type_traits<bool, 3, 4>
{ typedef mi::IBoolean_3_4 Interface_type; };

template<> struct Matrix_type_traits<bool, 4, 2>
{ typedef mi::IBoolean_4_2 Interface_type; };

template<> struct Matrix_type_traits<bool, 4, 3>
{ typedef mi::IBoolean_4_3 Interface_type; };

template<> struct Matrix_type_traits<bool, 4, 4>
{ typedef mi::IBoolean_4_4 Interface_type; };

template<> struct Matrix_type_traits<mi::Sint32, 2, 2>
{ typedef mi::ISint32_2_2 Interface_type; };

template<> struct Matrix_type_traits<mi::Sint32, 2, 3>
{ typedef mi::ISint32_2_3 Interface_type; };

template<> struct Matrix_type_traits<mi::Sint32, 2, 4>
{ typedef mi::ISint32_2_4 Interface_type; };

template<> struct Matrix_type_traits<mi::Sint32, 3, 2>
{ typedef mi::ISint32_3_2 Interface_type; };

template<> struct Matrix_type_traits<mi::Sint32, 3, 3>
{ typedef mi::ISint32_3_3 Interface_type; };

template<> struct Matrix_type_traits<mi::Sint32, 3, 4>
{ typedef mi::ISint32_3_4 Interface_type; };

template<> struct Matrix_type_traits<mi::Sint32, 4, 2>
{ typedef mi::ISint32_4_2 Interface_type; };

template<> struct Matrix_type_traits<mi::Sint32, 4, 3>
{ typedef mi::ISint32_4_3 Interface_type; };

template<> struct Matrix_type_traits<mi::Sint32, 4, 4>
{ typedef mi::ISint32_4_4 Interface_type; };

template<> struct Matrix_type_traits<mi::Float32, 2, 2>
{ typedef mi::IFloat32_2_2 Interface_type; };

template<> struct Matrix_type_traits<mi::Float32, 2, 3>
{ typedef mi::IFloat32_2_3 Interface_type; };

template<> struct Matrix_type_traits<mi::Float32, 2, 4>
{ typedef mi::IFloat32_2_4 Interface_type; };

template<> struct Matrix_type_traits<mi::Float32, 3, 2>
{ typedef mi::IFloat32_3_2 Interface_type; };

template<> struct Matrix_type_traits<mi::Float32, 3, 3>
{ typedef mi::IFloat32_3_3 Interface_type; };

template<> struct Matrix_type_traits<mi::Float32, 3, 4>
{ typedef mi::IFloat32_3_4 Interface_type; };

template<> struct Matrix_type_traits<mi::Float32, 4, 2>
{ typedef mi::IFloat32_4_2 Interface_type; };

template<> struct Matrix_type_traits<mi::Float32, 4, 3>
{ typedef mi::IFloat32_4_3 Interface_type; };

template<> struct Matrix_type_traits<mi::Float32, 4, 4>
{ typedef mi::IFloat32_4_4 Interface_type; };

template<> struct Matrix_type_traits<mi::Float64, 2, 2>
{ typedef mi::IFloat64_2_2 Interface_type; };

template<> struct Matrix_type_traits<mi::Float64, 2, 3>
{ typedef mi::IFloat64_2_3 Interface_type; };

template<> struct Matrix_type_traits<mi::Float64, 2, 4>
{ typedef mi::IFloat64_2_4 Interface_type; };

template<> struct Matrix_type_traits<mi::Float64, 3, 2>
{ typedef mi::IFloat64_3_2 Interface_type; };

template<> struct Matrix_type_traits<mi::Float64, 3, 3>
{ typedef mi::IFloat64_3_3 Interface_type; };

template<> struct Matrix_type_traits<mi::Float64, 3, 4>
{ typedef mi::IFloat64_3_4 Interface_type; };

template<> struct Matrix_type_traits<mi::Float64, 4, 2>
{ typedef mi::IFloat64_4_2 Interface_type; };

template<> struct Matrix_type_traits<mi::Float64, 4, 3>
{ typedef mi::IFloat64_4_3 Interface_type; };

template<> struct Matrix_type_traits<mi::Float64, 4, 4>
{ typedef mi::IFloat64_4_4 Interface_type; };
 // end group mi_neuray_types

} // namespace mi

#endif // MI_NEURAYLIB_TYPE_TRAITS_H

Namespaces

namespace 
Common namespace for APIs of NVIDIA Advanced Rendering Center GmbH. More...