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

Go to the source code of this file.

Classes

struct  UT_StorageNum< T >
 
struct  UT_StorageNum< int8 >
 
struct  UT_StorageNum< uint8 >
 
struct  UT_StorageNum< int16 >
 
struct  UT_StorageNum< int32 >
 
struct  UT_StorageNum< int64 >
 
struct  UT_StorageNum< fpreal16 >
 
struct  UT_StorageNum< fpreal32 >
 
struct  UT_StorageNum< fpreal64 >
 
struct  UT_StorageType< STORAGE >
 
struct  UT_StorageType< UT_Storage::INT8 >
 
struct  UT_StorageType< UT_Storage::UINT8 >
 
struct  UT_StorageType< UT_Storage::INT16 >
 
struct  UT_StorageType< UT_Storage::INT32 >
 
struct  UT_StorageType< UT_Storage::INT64 >
 
struct  UT_StorageType< UT_Storage::REAL16 >
 
struct  UT_StorageType< UT_Storage::REAL32 >
 
struct  UT_StorageType< UT_Storage::REAL64 >
 
struct  UT_StorageBetter< T0, T1 >
 This allows one to determine the type of T0+T1 at compile-time. More...
 
struct  UT_StorageAtLeast32Bit< T0, T1 >
 This allows one to determine the type of T0+T1 at compile-time. More...
 
struct  UT_TupleType< TSIZE, DATA_T >
 
struct  UT_TupleType<-1, DATA_T >
 
struct  UT_TupleType< TSIZE, void >
 
struct  UT_TupleType<-1, void >
 

Macros

#define __UT_Storage__
 
#define DECLARE_CONVERT_STORAGE_ROUND(T, F)
 

Typedefs

template<typename T0 , typename T1 >
using UT_StorageBetter_t = typename UT_StorageBetter< T0, T1 >::type
 
template<typename T0 , typename T1 >
using UT_StorageAtLeast32Bit_t = typename UT_StorageAtLeast32Bit< T0, T1 >::type
 
template<typename T >
using UT_StorageMathFloat_t = typename UT_StorageNum< T >::MathFloat
 

Enumerations

enum  UT_Storage {
  UT_Storage::INVALID = -1, UT_Storage::INT8, UT_Storage::UINT8, UT_Storage::INT16,
  UT_Storage::INT32, UT_Storage::INT64, UT_Storage::REAL16, UT_Storage::REAL32,
  UT_Storage::REAL64
}
 

Functions

SYS_FORCE_INLINE constexpr bool UTisIntStorage (UT_Storage storage)
 Returns true iff the given storage type represents an integer. More...
 
SYS_FORCE_INLINE constexpr bool UTisFloatStorage (UT_Storage storage)
 Returns true iff the given storage type represents a floating-point number. More...
 
SYS_FORCE_INLINE constexpr int UTstorageSize (UT_Storage storage)
 Returns the number of bytes in the given storage type. More...
 
template<typename TO , typename FROM >
SYS_FORCE_INLINE TO UTconvertStorage (FROM from)
 

Macro Definition Documentation

#define __UT_Storage__

Definition at line 14 of file UT_Storage.h.

#define DECLARE_CONVERT_STORAGE_ROUND (   T,
 
)
Value:
template<> \
SYS_FORCE_INLINE \
T UTconvertStorage<T,F>(F from) \
{ return T(from + ((from > 0) ? F(0.5) : F(-0.5))); } \
/* end of macro */

Definition at line 316 of file UT_Storage.h.

Typedef Documentation

template<typename T0 , typename T1 >
using UT_StorageAtLeast32Bit_t = typename UT_StorageAtLeast32Bit<T0,T1>::type

Definition at line 265 of file UT_Storage.h.

template<typename T0 , typename T1 >
using UT_StorageBetter_t = typename UT_StorageBetter<T0,T1>::type

Definition at line 256 of file UT_Storage.h.

template<typename T >
using UT_StorageMathFloat_t = typename UT_StorageNum<T>::MathFloat

Definition at line 176 of file UT_Storage.h.

Enumeration Type Documentation

enum UT_Storage
strong

An enum representing numeric data storage types.

NOTE: The order must be the conversion precedence order. For example, int8(0)+int16(0) will be an int16, and int64(0)+fpreal32(0) will be an fpreal32. This enables UT_StorageBetter.

Enumerator
INVALID 
INT8 
UINT8 
INT16 
INT32 
INT64 
REAL16 
REAL32 
REAL64 

Definition at line 28 of file UT_Storage.h.

Function Documentation

template<typename TO , typename FROM >
SYS_FORCE_INLINE TO UTconvertStorage ( FROM  from)

Definition at line 313 of file UT_Storage.h.

SYS_FORCE_INLINE constexpr bool UTisFloatStorage ( UT_Storage  storage)

Returns true iff the given storage type represents a floating-point number.

Definition at line 50 of file UT_Storage.h.

SYS_FORCE_INLINE constexpr bool UTisIntStorage ( UT_Storage  storage)

Returns true iff the given storage type represents an integer.

Definition at line 43 of file UT_Storage.h.

SYS_FORCE_INLINE constexpr int UTstorageSize ( UT_Storage  storage)

Returns the number of bytes in the given storage type.

Definition at line 57 of file UT_Storage.h.