24
int createSWIGPointerObj_T(const char* TypeName, void* obj, PyObject** ptr, int own)
26
swig_module_info* module = SWIG_GetModule(nullptr);
31
swig_type_info* swig_type = nullptr;
32
swig_type = SWIG_TypeQuery(TypeName);
34
std::stringstream str;
35
str << "SWIG: Cannot find type information for requested type: " << TypeName;
36
throw Base::RuntimeError(str.str());
39
*ptr = SWIG_NewPointerObj(obj, swig_type, own);
41
throw Base::RuntimeError("Cannot convert into requested type");
48
int convertSWIGPointerObj_T(const char* TypeName, PyObject* obj, void** ptr, int flags)
50
swig_module_info* module = SWIG_GetModule(nullptr);
55
swig_type_info* swig_type = nullptr;
56
swig_type = SWIG_TypeQuery(TypeName);
59
throw Base::RuntimeError("Cannot find type information for requested type");
63
if (SWIG_ConvertPtr(obj, ptr, swig_type, flags)) {
64
throw Base::RuntimeError("Cannot convert into requested type");
71
void cleanupSWIG_T(const char* TypeName)
73
swig_module_info* swig_module = SWIG_GetModule(nullptr);
78
swig_type_info* swig_type = nullptr;
79
swig_type = SWIG_TypeQuery(TypeName);
84
PyObject *module {}, *dict {};
85
PyObject* modules = PyImport_GetModuleDict();
86
module = PyDict_GetItemString(modules, "__builtin__");
87
if (module && PyModule_Check(module)) {
88
dict = PyModule_GetDict(module);
89
PyDict_SetItemString(dict, "_", Py_None);
92
module = PyDict_GetItemString(modules, "__main__");
93
if (module && PyModule_Check(module)) {
94
PyObject* dict = PyModule_GetDict(module);
100
PyObject *key {}, *value {};
102
while (PyDict_Next(dict, &pos, &key, &value)) {
103
if (value != Py_None && PyUnicode_Check(key)) {
105
if (SWIG_ConvertPtr(value, &ptr, nullptr, 0) == 0) {
106
PyDict_SetItem(dict, key, Py_None);
116
int getSWIGPointerTypeObj_T(const char* TypeName, PyTypeObject** ptr)
118
swig_module_info* module = SWIG_GetModule(nullptr);
123
swig_type_info* swig_type = nullptr;
124
SwigPyClientData* clientData = nullptr;
125
PyTypeObject* pyType = nullptr;
126
swig_type = SWIG_TypeQuery(TypeName);
128
clientData = static_cast<SwigPyClientData*>(swig_type->clientdata);
132
pyType = reinterpret_cast<PyTypeObject*>(clientData->newargs);
136
std::stringstream str;
137
str << "SWIG: Cannot find type information for requested type: " << TypeName;
138
throw Base::RuntimeError(str.str());