resonance 1.0.1
Loading...
Searching...
No Matches
Py::Callable Class Reference

Handle on any callable Python object. More...

#include <callable.h>

Inheritance diagram for Py::Callable:
Collaboration diagram for Py::Callable:

Public Member Functions

 Callable (const Object &other)
 Narrow an existing handle to a callable one.
virtual bool accepts (PyObject *pyob) const
 Accept only a callable object.
Public Member Functions inherited from Py::Object
 Object (PyObject *pyob=Py_None)
 Take a borrowed reference and add a count of its own.
 Object (const Object &other)
 Copy another handle and add a count of its own.
virtual ~Object ()
 Release the reference.
Object & operator= (const Object &other)
 Replace the reference with another handle's.
Object getAttr (const HxStr &name) const
 Read one attribute.
String str () const
 Produce the text of str() applied to the object.
HxStr as_string () const
 Produce the text of str() applied to the object, as a game string.
Type type () const
 Produce the object's type.
bool isType (const Type &type) const
 Report whether the object's type is a given type.
bool isTuple () const
 Report whether the object is a tuple.
bool isList () const
 Report whether the object is a list.

Additional Inherited Members

Public Attributes inherited from Py::Object
PyObject * mPtr
 Wrapped reference, null only between release() and the next assignment.
Protected Member Functions inherited from Py::Object
void release ()
 Release the reference and empty the handle.
void set (PyObject *pyob)
 Replace the reference with a borrowed one and add a count of its own.
void validate ()
 Enforce this type's accepts() test on the stored reference.

Detailed Description

Handle on any callable Python object.

Its RTTI descriptor is at 0x00902a30. It has Py::Object at offset 0 as its one base. Its accessor is at 0x0050d2e8.

The vtable at 0x008257f8 has three entries, the same shape as Py::Object.

Slot Member Address
0 compiler-generated type function 0x0050d2e8
1 compiler-generated destructor 0x0050d270
2 accepts 0x0050d360

Released PyCXX also gives this class apply() overloads for invoking the object. None appears in the image as a routine of its own, and PyShell::ReportError() invokes traceback_str through the plain interpreter call instead, so none is reconstructed.

Constructor & Destructor Documentation

◆ Callable()

Py::Callable::Callable ( const Object & other)
inlineexplicit

Narrow an existing handle to a callable one.

Recovered from PyShell::ReportError(), which narrows the traceback_str attribute of the hxutl module this way. The body is inlined at that site and has no address of its own.

Parameters
otherThe handle to narrow.

Member Function Documentation

◆ accepts()

virtual bool Py::Callable::accepts ( PyObject * pyob) const
inlinevirtual

Accept only a callable object.

Parameters
pyobThe reference to test.
Returns
True when the reference is callable.
Ghidra address:
NTSC-U/C: 0x0050d360
Ghidra address:
PAL: 0x0054c818

Reimplemented from Py::Object.


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