24 #ifndef PXR_BASE_TF_PY_CALL_H 25 #define PXR_BASE_TF_PY_CALL_H 35 #include "pxr/base/tf/pyError.h" 36 #include "pxr/base/tf/pyLock.h" 37 #include "pxr/base/tf/pyObjWrapper.h" 39 #include <boost/python/call.hpp> 41 PXR_NAMESPACE_OPEN_SCOPE
56 template <
typename Return>
63 template <
typename... Args>
64 Return operator()(Args... args);
70 template <
typename Return>
71 template <
typename... Args>
77 if (!PyErr_Occurred()) {
79 return boost::python::call<Return>
80 (_callable.ptr(), args...);
81 }
catch (boost::python::error_already_set
const &) {
83 TfPyConvertPythonExceptionToTfErrors();
90 PXR_NAMESPACE_CLOSE_SCOPE
TfPyCall(TfPyObjWrapper const &c)
Construct with callable c.
Convenience class for accessing the Python Global Interpreter Lock.
Provide a way to call a Python callable.
Boost Python object wrapper.