|
Classes having to do with run-time typing. More...
Files | |
file | enum.h |
file | safeTypeCompare.h |
Safely compare C++ RTTI type structures. | |
file | typeInfoMap.h |
Classes | |
class | TfEnum |
An enum class that records both enum type and enum value. More... | |
class | TfTypeInfoMap< VALUE > |
A map whose key is a const std::type_info&, or a string alias. More... | |
Macros | |
#define | TF_ADD_ENUM_NAME(VAL, ...) |
Macro used to associate a name with an enumerated value. | |
Classes having to do with run-time typing.
#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()
.