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>
41PXR_NAMESPACE_OPEN_SCOPE
56template <
typename Return>
63 template <
typename... Args>
64 Return operator()(Args... args);
70template <
typename Return>
71template <
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();
90PXR_NAMESPACE_CLOSE_SCOPE
Convenience class for accessing the Python Global Interpreter Lock.
Boost Python object wrapper.
Provide a way to call a Python callable.
TfPyCall(TfPyObjWrapper const &c)
Construct with callable c.