HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
bitUtils.h File Reference
#include "pxr/pxr.h"
#include <cstddef>
#include <type_traits>
+ Include dependency graph for bitUtils.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  Tf_NumBits< N, SUM, BIT >
 
struct  Tf_NumBits< N, SUM, 0 >
 

Macros

#define TF_BITS_FOR_VALUES(n)
 
#define TF_BITS_FOR_ENUM_VALUES(n)
 

Macro Definition Documentation

#define TF_BITS_FOR_ENUM_VALUES (   n)

Compute the number of bits required to store the given number of (signed) enum values.

Note
This is intended to be used when storing enum values in a bitfield without casting the enum type to an unsigned integer. (At least GCC considers enums to be signed and hence wastes one bit when all enumerants are non-negative).

Definition at line 77 of file bitUtils.h.

#define TF_BITS_FOR_VALUES (   n)

Compute the number of bits required to store the given number of values.

Note that the computed result for a number smaller or equal to zero is undefined. The input number can be any compile-time constant.

Definition at line 44 of file bitUtils.h.