24 #ifndef PXR_BASE_TF_PY_OVERRIDE_H
25 #define PXR_BASE_TF_PY_OVERRIDE_H
32 #include <hboost/python/override.hpp>
68 hboost::python::converter::return_from_python<T> converter;
69 return converter(m_obj.release());
76 hboost::python::converter::return_from_python<T&> converter;
78 const_cast<hboost::python::handle<>&
>(m_obj).release());
82 T as(hboost::type<T>* = 0)
85 hboost::python::converter::return_from_python<T> converter;
86 return converter(m_obj.release());
93 return hboost::python::extract<T>(m_obj)();
97 mutable hboost::python::handle<> m_obj;
117 template <
typename Arg>
118 constexpr
static char _PyObjArg()
131 template <
typename... Args>
138 static const char pyCallFormat[] =
139 {
'(', _PyObjArg<Args>()...,
')',
'\0' };
144 const_cast<char*>(pyCallFormat),
145 hboost::python::converter::arg_to_python<Args>(args).
get()...));
152 #endif // PXR_BASE_TF_PY_OVERRIDE_H
TfPyMethodResult & operator=(TfPyMethodResult const &other)
Implement assign to do python refcounting while holding the GIL.
T as(hboost::type< T > *=0)
T unchecked(hboost::type< T > *=0)
~TfPyMethodResult()
Implement dtor to do python refcounting while holding the GIL.
TfPyMethodResult operator()(Args const &...args) const
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
#define PXR_NAMESPACE_CLOSE_SCOPE
**If you just want to fire and args
TfPyOverride(hboost::python::handle<> callable)
Clients must hold the GIL to construct.