Loading...
Searching...
No Matches
TfPyCall< Return > Class Template Reference

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

#include <pyCall.h>

Public Member Functions

 TfPyCall (TfPyObjWrapper const &c)
 Construct with callable c.
 
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);
Provide a way to call a Python callable.
Definition: pyCall.h:57

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)
inlineexplicit

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.

Member Function Documentation

◆ operator()()

Return operator() ( Args...  args)
inline

Definition at line 73 of file pyCall.h.


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