HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
enum.h File Reference
#include "pxr/pxr.h"
#include "pxr/base/arch/defines.h"
#include "pxr/base/arch/demangle.h"
#include "pxr/base/tf/hash.h"
#include "pxr/base/tf/preprocessorUtilsLite.h"
#include "pxr/base/tf/safeTypeCompare.h"
#include "pxr/base/tf/api.h"
#include <iosfwd>
#include <string>
#include <typeinfo>
#include <type_traits>
#include <vector>
+ Include dependency graph for enum.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  TfEnum
 

Macros

#define TF_ADD_ENUM_NAME(VAL,...)
 

Functions

template<class HashState , class Enum >
std::enable_if_t< std::is_same
< Enum, TfEnum >::value
TfHashAppend (HashState &h, Enum const &e)
 
TF_API std::ostream & operator<< (std::ostream &out, const TfEnum &e)
 

Macro Definition Documentation

#define TF_ADD_ENUM_NAME (   VAL,
  ... 
)

Macro used to associate a name with an enumerated value.

TF_ADD_ENUM_NAME() registers a name for an enumerated value so that the association can be accessed in calls to TfEnum::GetValueFromName(), TfEnum::GetValueFromFullName(), TfEnum::GetName(), and TfEnum::GetFullName(). It's first argument, VAL, is the symbolic name of the enumerated value or a TfEnum instance constructed from it. The name defined for the value is created by putting double quotes around the VAL argument.

An optional second argument, DISPLAY, is a name to be used for display purposes (i.e. in a user interface). The display name can contain characters like spaces and punctuation, and does not need to be a unique string. If this argument is not specified, the display name will be derived from VAL.

Only the names for which TF_ADD_ENUM_NAME() is called will be accessible with the name/value methods; you can hide values from this mechanism by not adding them.

Please note that the best way to call TF_ADD_ENUM_NAME() is using the TfRegistryManager macro TF_REGISTRY_FUNCTION().

Definition at line 470 of file enum.h.

Function Documentation

template<class HashState , class Enum >
std::enable_if_t<std::is_same<Enum, TfEnum>::value> TfHashAppend ( HashState &  h,
Enum const &  e 
)

Definition at line 435 of file enum.h.