25 #ifndef PXR_BASE_TF_PY_STATIC_TOKENS_H
26 #define PXR_BASE_TF_PY_STATIC_TOKENS_H
37 #include <hboost/python/class.hpp>
38 #include <hboost/python/scope.hpp>
50 #define TF_PY_WRAP_PUBLIC_TOKENS(name, key, seq) \
51 hboost::python::class_<_TF_TOKENS_STRUCT_NAME(key), hboost::noncopyable>( \
52 name, hboost::python::no_init) \
53 _TF_PY_TOKENS_WRAP_SEQ(key, _TF_PY_TOKENS_EXPAND(seq))
61 #define TF_PY_WRAP_PUBLIC_TOKENS_IN_CURRENT_SCOPE(key, seq) \
62 _TF_PY_TOKENS_WRAP_ATTR_SEQ(key, _TF_PY_TOKENS_EXPAND(seq))
82 #define _TF_PY_TOKENS_WRAP_ATTR_MEMBER(r, key, name) \
83 hboost::python::scope().attr( \
84 TF_PP_STRINGIZE(name)) = key->name.GetString();
86 #define _TF_PY_TOKENS_WRAP_MEMBER(r, key, name) \
87 .add_static_property(TF_PP_STRINGIZE(name), \
88 hboost::python::make_function(_TfPyWrapStaticToken((&key->name)), \
89 hboost::python::return_value_policy< \
90 hboost::python::return_by_value>(), \
91 hboost::mpl::vector1<std::string>()))
93 #define _TF_PY_TOKENS_EXPAND(seq) \
94 HBOOST_PP_SEQ_FILTER(_TF_TOKENS_IS_NOT_ARRAY, ~, seq) \
95 _TF_TOKENS_EXPAND_ARRAY_ELEMENTS(seq)
98 #define _TF_PY_TOKENS_WRAP_ELEMENT(key, elem) \
99 _TF_PY_TOKENS_WRAP_MEMBER(r, key, _TF_PY_TOKEN_GET_ELEM(elem))
101 #define _TF_PY_TOKENS_WRAP_ATTR_ELEMENT(key, elem) \
102 _TF_PY_TOKENS_WRAP_ATTR_MEMBER(r, key, _TF_PY_TOKEN_GET_ELEM(elem))
104 #define _TF_PY_TOKEN_GET_ELEM(elem) \
105 _TF_PP_IFF(TF_PP_IS_TUPLE(elem), \
106 TF_PP_TUPLE_ELEM(0, elem), elem)
109 #define _TF_PY_TOKENS_WRAP_SEQ(key, seq) \
110 TF_PP_SEQ_FOR_EACH(_TF_PY_TOKENS_WRAP_ELEMENT, key, seq)
112 #define _TF_PY_TOKENS_WRAP_ATTR_SEQ(key, seq) \
113 TF_PP_SEQ_FOR_EACH(_TF_PY_TOKENS_WRAP_ATTR_ELEMENT, key, seq)
117 #endif // PXR_BASE_TF_PY_STATIC_TOKENS_H
GLsizei const GLchar *const * string
std::string const & GetString() const
Return the string that this token represents.
_TfPyWrapStaticToken(const TfToken *token)
std::string operator()() const
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
#define PXR_NAMESPACE_CLOSE_SCOPE