HDK
|
#include <pyEnum.h>
Public Member Functions | |
TfPyWrapEnum (std::string const &name=std::string()) | |
Used to wrap enum types for script.
TfPyWrapEnum provides a way to wrap enums for python, tying in with the TfEnum system, and potentially providing automatic wrapping by using names registered with the TfEnum system and by making some assumptions about the way we structure our code. Enums that are not registered with TfEnum may be manually wrapped using hboost::python::enum_ instead.
Example usage. For an enum that looks like this:
Which has been registered in the TfEnum system and has names provided for all values, it may be wrapped like this:
The enum will appear in script as Foo.Choices.{First, Second, Third} and the values will also appear as Foo.{First, Second, Third}.
An enum may be given an explicit name by passing a string to TfPyWrapEnum's constructor.
If the enum is a C++11 scoped enum (aka enum class), the values will appear as Foo.Choices.{First, Second, Third} in the following example:
|
inlineexplicit |