7#ifndef PXR_BASE_TF_PY_CALL_H
8#define PXR_BASE_TF_PY_CALL_H
18#include "pxr/base/tf/pyError.h"
19#include "pxr/base/tf/pyLock.h"
20#include "pxr/base/tf/pyObjWrapper.h"
22#include "pxr/external/boost/python/call.hpp"
24PXR_NAMESPACE_OPEN_SCOPE
39template <
typename Return>
46 template <
typename... Args>
47 Return operator()(Args... args);
53template <
typename Return>
54template <
typename... Args>
60 if (!PyErr_Occurred()) {
62 return pxr_boost::python::call<Return>
63 (_callable.ptr(), args...);
64 }
catch (pxr_boost::python::error_already_set
const &) {
66 TfPyConvertPythonExceptionToTfErrors();
73PXR_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.