TfPyCall< Return > Class Template Reference

Provide a way to call a Python callable. More...

Public Member Functions

 TfPyCall (TfPyObjWrapper const &c)
 Construct with callable c. More...
template<typename... Args>
Return operator() (Args... args)

Detailed Description

template<typename Return>
class TfPyCall< Return >

Provide a way to call a Python callable.

Usage is as follows:

return TfPyCall<RetType>(callable)(arg1, arg2, ... argN);

Generally speaking, TfPyCall instances may be copied, assigned, destroyed, and invoked without the client holding the GIL. However, if the Return template parameter is a boost::python::object (or a derived class, such as list or tuple) then the client must hold the GIL in order to invoke the call operator.

Definition at line 57 of file pyCall.h.

Constructor & Destructor Documentation

◆ TfPyCall()

TfPyCall ( TfPyObjWrapper const &  c)

Construct with callable c.

Constructing with a boost::python::object works, since those implicitly convert to TfPyObjWrapper, however in that case the GIL must be held by the caller.

Definition at line 61 of file pyCall.h.

The documentation for this class was generated from the following file: