HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
UT_TypeTraits.h File Reference
#include "pxr/pxr.h"
#include <SYS/SYS_TypeTraits.h>
#include <SYS/SYS_Types.h>
#include <UT/UT_VectorTypes.h>
#include "pxr/base/gf/half.h"
+ Include dependency graph for UT_TypeTraits.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  GusdPodTupleTraits< T >
 

Macros

#define GUSDUT_DECLARE_POD_TUPLE(TYPE, VALUETYPE, TUPLESIZE)
 Helper for declaring a POD tuple. More...
 

Functions

template<typename T >
constexpr bool GusdIsPodTuple ()
 Returns true if a type is a POD tuple. More...
 
template<typename T >
constexpr int GusdGetTupleSize ()
 Returns the tuples ize of a POD tuple. More...
 
template<typename A , typename B >
constexpr bool GusdPodTuplesAreCompatible ()
 
template<typename A , typename B >
constexpr bool GusdPodTuplesAreBitwiseCompatible ()
 Returns true if two POD tuples have identical memory layouts. More...
 
 GUSDUT_DECLARE_POD_TUPLE (UT_Vector2H, fpreal16, 2)
 Declare traits on core types. More...
 
 GUSDUT_DECLARE_POD_TUPLE (UT_Vector3H, fpreal16, 3)
 
 GUSDUT_DECLARE_POD_TUPLE (UT_Vector4H, fpreal16, 4)
 
 GUSDUT_DECLARE_POD_TUPLE (UT_Vector2F, fpreal32, 2)
 
 GUSDUT_DECLARE_POD_TUPLE (UT_Vector3F, fpreal32, 3)
 
 GUSDUT_DECLARE_POD_TUPLE (UT_Vector4F, fpreal32, 4)
 
 GUSDUT_DECLARE_POD_TUPLE (UT_Vector2D, fpreal64, 2)
 
 GUSDUT_DECLARE_POD_TUPLE (UT_Vector3D, fpreal64, 3)
 
 GUSDUT_DECLARE_POD_TUPLE (UT_Vector4D, fpreal64, 4)
 
 GUSDUT_DECLARE_POD_TUPLE (UT_Vector2I, int64, 2)
 
 GUSDUT_DECLARE_POD_TUPLE (UT_Vector3I, int64, 3)
 
 GUSDUT_DECLARE_POD_TUPLE (UT_Vector4I, int64, 4)
 
 GUSDUT_DECLARE_POD_TUPLE (UT_Vector2i, int32, 2)
 
 GUSDUT_DECLARE_POD_TUPLE (UT_Vector3i, int32, 3)
 
 GUSDUT_DECLARE_POD_TUPLE (UT_Vector4i, int32, 4)
 
 GUSDUT_DECLARE_POD_TUPLE (UT_QuaternionH, fpreal16, 4)
 
 GUSDUT_DECLARE_POD_TUPLE (UT_QuaternionF, fpreal32, 4)
 
 GUSDUT_DECLARE_POD_TUPLE (UT_QuaternionD, fpreal64, 4)
 
 GUSDUT_DECLARE_POD_TUPLE (UT_Matrix2F, fpreal32, 4)
 
 GUSDUT_DECLARE_POD_TUPLE (UT_Matrix3F, fpreal32, 9)
 
 GUSDUT_DECLARE_POD_TUPLE (UT_Matrix4F, fpreal32, 16)
 
 GUSDUT_DECLARE_POD_TUPLE (UT_Matrix2D, fpreal64, 4)
 
 GUSDUT_DECLARE_POD_TUPLE (UT_Matrix3D, fpreal64, 9)
 
 GUSDUT_DECLARE_POD_TUPLE (UT_Matrix4D, fpreal64, 16)
 
 GUSDUT_DECLARE_POD_TUPLE (bool, bool, 1)
 Declare PODs as POD tuples of tupleSize=1. More...
 
 GUSDUT_DECLARE_POD_TUPLE (uint8, uint8, 1)
 
 GUSDUT_DECLARE_POD_TUPLE (uint16, uint16, 1)
 
 GUSDUT_DECLARE_POD_TUPLE (uint32, uint32, 1)
 
 GUSDUT_DECLARE_POD_TUPLE (uint64, uint64, 1)
 
 GUSDUT_DECLARE_POD_TUPLE (int8, int8, 1)
 
 GUSDUT_DECLARE_POD_TUPLE (int16, int16, 1)
 
 GUSDUT_DECLARE_POD_TUPLE (int32, int32, 1)
 
 GUSDUT_DECLARE_POD_TUPLE (int64, int64, 1)
 
 GUSDUT_DECLARE_POD_TUPLE (fpreal16, fpreal16, 1)
 
 GUSDUT_DECLARE_POD_TUPLE (fpreal32, fpreal32, 1)
 
 GUSDUT_DECLARE_POD_TUPLE (fpreal64, fpreal64, 1)
 
 GUSDUT_DECLARE_POD_TUPLE (GfHalf, GfHalf, 1)
 

Macro Definition Documentation

#define GUSDUT_DECLARE_POD_TUPLE (   TYPE,
  VALUETYPE,
  TUPLESIZE 
)
Value:
template <> \
static const int tupleSize = TUPLESIZE; \
using ValueType = VALUETYPE; \
};

Helper for declaring a POD tuple.

Definition at line 50 of file UT_TypeTraits.h.

Function Documentation

template<typename T >
constexpr int GusdGetTupleSize ( )

Returns the tuples ize of a POD tuple.

Definition at line 68 of file UT_TypeTraits.h.

template<typename T >
constexpr bool GusdIsPodTuple ( )

Returns true if a type is a POD tuple.

Definition at line 60 of file UT_TypeTraits.h.

template<typename A , typename B >
constexpr bool GusdPodTuplesAreBitwiseCompatible ( )

Returns true if two POD tuples have identical memory layouts.

Definition at line 85 of file UT_TypeTraits.h.

template<typename A , typename B >
constexpr bool GusdPodTuplesAreCompatible ( )

Returns true if two POD tuples are compatible (I.e., same tuple size, not necessarily same types).

Definition at line 77 of file UT_TypeTraits.h.

GUSDUT_DECLARE_POD_TUPLE ( UT_Vector2H  ,
fpreal16  ,
 
)

Declare traits on core types.

GUSDUT_DECLARE_POD_TUPLE ( UT_Vector3H  ,
fpreal16  ,
 
)
GUSDUT_DECLARE_POD_TUPLE ( UT_Vector4H  ,
fpreal16  ,
 
)
GUSDUT_DECLARE_POD_TUPLE ( UT_Vector2F  ,
fpreal32  ,
 
)
GUSDUT_DECLARE_POD_TUPLE ( UT_Vector3F  ,
fpreal32  ,
 
)
GUSDUT_DECLARE_POD_TUPLE ( UT_Vector4F  ,
fpreal32  ,
 
)
GUSDUT_DECLARE_POD_TUPLE ( UT_Vector2D  ,
fpreal64  ,
 
)
GUSDUT_DECLARE_POD_TUPLE ( UT_Vector3D  ,
fpreal64  ,
 
)
GUSDUT_DECLARE_POD_TUPLE ( UT_Vector4D  ,
fpreal64  ,
 
)
GUSDUT_DECLARE_POD_TUPLE ( UT_Vector2I  ,
int64  ,
 
)
GUSDUT_DECLARE_POD_TUPLE ( UT_Vector3I  ,
int64  ,
 
)
GUSDUT_DECLARE_POD_TUPLE ( UT_Vector4I  ,
int64  ,
 
)
GUSDUT_DECLARE_POD_TUPLE ( UT_Vector2i  ,
int32  ,
 
)
GUSDUT_DECLARE_POD_TUPLE ( UT_Vector3i  ,
int32  ,
 
)
GUSDUT_DECLARE_POD_TUPLE ( UT_Vector4i  ,
int32  ,
 
)
GUSDUT_DECLARE_POD_TUPLE ( UT_QuaternionH  ,
fpreal16  ,
 
)
GUSDUT_DECLARE_POD_TUPLE ( UT_QuaternionF  ,
fpreal32  ,
 
)
GUSDUT_DECLARE_POD_TUPLE ( UT_QuaternionD  ,
fpreal64  ,
 
)
GUSDUT_DECLARE_POD_TUPLE ( UT_Matrix2F  ,
fpreal32  ,
 
)
GUSDUT_DECLARE_POD_TUPLE ( UT_Matrix3F  ,
fpreal32  ,
 
)
GUSDUT_DECLARE_POD_TUPLE ( UT_Matrix4F  ,
fpreal32  ,
16   
)
GUSDUT_DECLARE_POD_TUPLE ( UT_Matrix2D  ,
fpreal64  ,
 
)
GUSDUT_DECLARE_POD_TUPLE ( UT_Matrix3D  ,
fpreal64  ,
 
)
GUSDUT_DECLARE_POD_TUPLE ( UT_Matrix4D  ,
fpreal64  ,
16   
)
GUSDUT_DECLARE_POD_TUPLE ( bool  ,
bool  ,
 
)

Declare PODs as POD tuples of tupleSize=1.

GUSDUT_DECLARE_POD_TUPLE ( uint8  ,
uint8  ,
 
)
GUSDUT_DECLARE_POD_TUPLE ( uint16  ,
uint16  ,
 
)
GUSDUT_DECLARE_POD_TUPLE ( uint32  ,
uint32  ,
 
)
GUSDUT_DECLARE_POD_TUPLE ( uint64  ,
uint64  ,
 
)
GUSDUT_DECLARE_POD_TUPLE ( int8  ,
int8  ,
 
)
GUSDUT_DECLARE_POD_TUPLE ( int16  ,
int16  ,
 
)
GUSDUT_DECLARE_POD_TUPLE ( int32  ,
int32  ,
 
)
GUSDUT_DECLARE_POD_TUPLE ( int64  ,
int64  ,
 
)
GUSDUT_DECLARE_POD_TUPLE ( fpreal16  ,
fpreal16  ,
 
)
GUSDUT_DECLARE_POD_TUPLE ( fpreal32  ,
fpreal32  ,
 
)
GUSDUT_DECLARE_POD_TUPLE ( fpreal64  ,
fpreal64  ,
 
)
GUSDUT_DECLARE_POD_TUPLE ( GfHalf  ,
GfHalf  ,
 
)