resonance 1.0.1
Loading...
Searching...
No Matches
pythontype.h
Go to the documentation of this file.
1#pragma once
2
3#include "script/cxx/config.h"
4
5namespace Py {
6
21public:
30 PythonType(int nBasicSize, int nItemSize);
31
38 virtual ~PythonType();
39
47 PyTypeObject *type_object() const {
48 return mTable;
49 }
50
58 void dealloc(destructor pfnDealloc) {
59 mTable->tp_dealloc = pfnDealloc;
60 }
61
72
80
90
91private:
98 static void standard_dealloc(PyObject *pyob);
99
100 PyTypeObject *mTable;
101 PySequenceMethods *mSequenceTable;
102 PyMappingMethods *mMappingTable;
103 PyNumberMethods *mNumberTable;
104 PyBufferProcs *mBufferTable;
105};
106
107} // namespace Py
void supportMappingType()
Give the type the mapping protocol, once.
PyTypeObject * type_object() const
Read the type object.
Definition pythontype.h:47
void supportBufferType()
Give the type the buffer protocol, once.
void supportSequenceType()
Give the type the sequence protocol, once.
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.
void dealloc(destructor pfnDealloc)
Set the deallocator.
Definition pythontype.h:58
Configuration header of the PyCXX binding layer.
C++ wrappers for the embedded Python interpreter's objects, types, and extension modules.
Definition attributeerror.h:7