|
resonance 1.0.1
|
Builder for the CPython type object of an extension type. More...
#include <pythontype.h>
Public Member Functions | |
| PythonType (int nBasicSize, int nItemSize) | |
| Allocate the type object and clear every slot but the size, the name, and the deallocator. | |
| virtual | ~PythonType () |
| Free the type object and the protocol tables. | |
| PyTypeObject * | type_object () const |
| Read the type object. | |
| void | dealloc (destructor pfnDealloc) |
| Set the deallocator. | |
| void | supportSequenceType () |
| Give the type the sequence protocol, once. | |
| void | supportMappingType () |
| Give the type the mapping protocol, once. | |
| void | supportBufferType () |
| Give the type the buffer protocol, once. | |
Builder for the CPython type object of an extension type.
Its RTTI descriptor is at 0x0086f588. It has no base. Its accessor is at 0x005aba50, and the mangled name string sits at 0x00833400.
The object is 0x18 bytes, the five table pointers at +0x00 to +0x10 and the vptr after them at +0x14. The vtable at 0x008331e0 has two entries, the type function at 0x005aba50 and the destructor at 0x005ac220.
The constructor takes no type name, unlike released PyCXX's, and every type it builds is called unknown. The support setters that fill the protocol tables are outside this declaration.
| Py::PythonType::PythonType | ( | int | nBasicSize, |
| int | nItemSize ) |
Allocate the type object and clear every slot but the size, the name, and the deallocator.
| nBasicSize | The instance size. |
| nItemSize | The size of one variable-length item. |
|
virtual |
Free the type object and the protocol tables.
|
inline |
Read the type object.
|
inline |
Set the deallocator.
| pfnDealloc | The deallocator. |
| void Py::PythonType::supportSequenceType | ( | ) |
Give the type the sequence protocol, once.
The first call allocates the table, attaches it, and points its first seven entries at the Py::PythonExtensionBase handlers. The three entries after them remain unwritten.
| void Py::PythonType::supportMappingType | ( | ) |
Give the type the mapping protocol, once.
| void Py::PythonType::supportBufferType | ( | ) |
Give the type the buffer protocol, once.
The character buffer entry remains unwritten.