No Matches
TfPyOverride Class Reference

A reimplementation of boost::python::override. More...

#include <pyOverride.h>

+ Inheritance diagram for TfPyOverride:

Public Member Functions

 TfPyOverride (boost::python::handle<> callable)
 Clients must hold the GIL to construct.
template<typename... Args>
TfPyMethodResult operator() (Args const &... args) const
 Call the override.
- Public Member Functions inherited from TfPyObjWrapper
TF_API TfPyObjWrapper ()
 Default construct a TfPyObjWrapper holding a reference to python None.
TF_API TfPyObjWrapper (object obj)
 Construct a TfPyObjectWrapper wrapping obj.
object const & Get () const
 Underlying object access.
TF_API PyObject * ptr () const
 Underlying PyObject* access.
TF_API bool operator== (TfPyObjWrapper const &other) const
TF_API bool operator!= (TfPyObjWrapper const &other) const

Detailed Description

A reimplementation of boost::python::override.

This class is reimplemented from the boost class simply because the provided class only allows construction from, ultimately, boost::python::wrapper::get_override(). Unfortunately, that method returns the wrong result when the overridden function we are asking about lives not on the directly wrapped C++ class, but a wrapped ancestor. So we provide our own version, TfPyOverride, with a public constructor.

Note that clients must have the python GIL when constructing a TfPyOverride object.

Definition at line 114 of file pyOverride.h.

Constructor & Destructor Documentation

◆ TfPyOverride()

TfPyOverride ( boost::python::handle<>  callable)

Clients must hold the GIL to construct.

Definition at line 125 of file pyOverride.h.

Member Function Documentation

◆ operator()()

TfPyMethodResult operator() ( Args const &...  args) const

Call the override.

Clients need not hold the GIL to invoke the call operator.

Definition at line 133 of file pyOverride.h.

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