7 #ifndef PXR_USD_SDF_PY_LIST_OP_H
8 #define PXR_USD_SDF_PY_LIST_OP_H
16 #include "pxr/external/boost/python.hpp"
36 TfPyWrapOnce<T>([
name]() { SdfPyWrapListOp::_Wrap(name); });
42 listOp.ApplyOperations(&result);
46 _ApplyOperations2(
const T& outer,
const T& inner) {
47 if (std::optional<T>
r = outer.ApplyOperations(inner)) {
54 static size_t _Hash(
const T &
self){
58 static void _Wrap(
const std::string&
name)
60 using namespace pxr_boost::python;
64 class_<T>(name.c_str())
65 .def(
"__str__", &This::_GetStr)
66 .def(
"__hash__", &This::_Hash)
68 .def(
"Create", &T::Create,
72 .staticmethod(
"Create")
74 .def(
"CreateExplicit", &T::CreateExplicit,
76 .staticmethod(
"CreateExplicit")
81 .def(
"HasItem", &T::HasItem)
83 .def(
"Clear", &T::Clear)
84 .def(
"ClearAndMakeExplicit", &T::ClearAndMakeExplicit)
85 .def(
"ApplyOperations", &This::_ApplyOperations1)
86 .def(
"ApplyOperations", &This::_ApplyOperations2)
88 .add_property(
"explicitItems",
89 make_function(&T::GetExplicitItems,
90 return_value_policy<return_by_value>()),
91 +[](
T&
t,
const ItemVector& items){t.SetExplicitItems(items);})
92 .add_property(
"addedItems",
93 make_function(&T::GetAddedItems,
94 return_value_policy<return_by_value>()),
96 .add_property(
"prependedItems",
97 make_function(&T::GetPrependedItems,
98 return_value_policy<return_by_value>()),
99 +[](
T&
t,
const ItemVector& items){t.SetPrependedItems(items);})
100 .add_property(
"appendedItems",
101 make_function(&T::GetAppendedItems,
102 return_value_policy<return_by_value>()),
103 +[](
T&
t,
const ItemVector& items){t.SetAppendedItems(items);})
104 .add_property(
"deletedItems",
105 make_function(&T::GetDeletedItems,
106 return_value_policy<return_by_value>()),
107 +[](
T&
t,
const ItemVector& items){t.SetDeletedItems(items);})
108 .add_property(
"orderedItems",
109 make_function(&T::GetOrderedItems,
110 return_value_policy<return_by_value>()),
112 .def(
"GetAddedOrExplicitItems",
114 .def(
"GetAppliedItems",
117 .add_property(
"isExplicit", &T::IsExplicit)
123 static std::string _GetStr(
const T& listOp)
132 #endif // PXR_USD_SDF_PY_LIST_OP_H
**But if you need a result
auto arg(const Char *name, const T &arg) -> detail::named_arg< Char, T >
std::string TfStringify(const T &v)
SdfPyWrapListOp< T > This
GLuint const GLchar * name
SdfPyWrapListOp(const std::string &name)
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
#define PXR_NAMESPACE_CLOSE_SCOPE