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/preprocessorUtils.h"
#include "pxr/base/tf/safeTypeCompare.h"
#include "pxr/base/tf/api.h"
#include <hboost/operators.hpp>
#include <hboost/preprocessor/punctuation/comma_if.hpp>
#include <hboost/preprocessor/stringize.hpp>
#include <hboost/type_traits/is_enum.hpp>
#include <hboost/utility/enable_if.hpp>
#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

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 439 of file enum.h.