|
resonance 1.0.1
|
Accumulator for the method table of an extension module. More...
#include <methodtable.h>
Public Member Functions | |
| MethodTable () | |
| Start with the terminator record alone. | |
| virtual | ~MethodTable () |
| Release the flattened table. | |
| void | add (const char *pszMethodName, PyCFunction pfnMethod, const char *pszDoc="", int nFlags=1) |
| Append one method ahead of the terminator. | |
| PyMethodDef * | table () |
| Flatten the records into an array the interpreter can retain. | |
Accumulator for the method table of an extension module.
Its RTTI descriptor is at 0x0086f688. It has no base. The object is 0x14 bytes, the vector at +0x00, the flattened table at +0x0c, and the vptr after both at +0x10. This compiler places the vptr of a class with no base after the data.
The vtable at 0x00833210 has two entries.
| Slot | Member | Address |
|---|---|---|
| 0 | compiler-generated type function | 0x005ab9d0 |
| 1 | ~MethodTable | 0x005abb68 |
The one instance in the image is the function-local static behind the RegisterCFunction constructor. The game registers every script function exported to Python through that constructor.
|
inline |
Start with the terminator record alone.
|
inlinevirtual |
Release the flattened table.
|
inline |
Append one method ahead of the terminator.
Appending after table() has run is refused, because the flattened copy is what the interpreter already holds.
| pszMethodName | The Python-visible name. |
| pfnMethod | The C entry point. |
| pszDoc | The doc string. |
| nFlags | The calling convention flag. |
|
inline |
Flatten the records into an array the interpreter can retain.
The array is built once and reused, and that is also what closes the table to further additions.