All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TfPyCall< Return > Class Template Reference

#include <pyCall.h>

Public Member Functions

 TfPyCall (TfPyObjWrapper const &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);

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 hboost::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

template<typename Return>
TfPyCall< Return >::TfPyCall ( TfPyObjWrapper const c)

Construct with callable c. Constructing with a hboost::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

template<typename Return >
template<typename... Args>
Return TfPyCall< Return >::operator() ( Args...  args)

Definition at line 73 of file pyCall.h.

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