bool isValid = Shiboken::Object::isValid(%1, false);
%PYARG_0 = %CONVERTTOPYTHON[bool](isValid);
Shiboken::Object::invalidate(%1);
if (Shiboken::ObjectType::checkType((PyTypeObject*)%2))
%PYARG_0 = Shiboken::Object::newObject((SbkObjectType*)%2, (void*)%1, false, true);
else
PyErr_SetString(PyExc_TypeError, "You need a shiboken-based type.");
if (Shiboken::Object::checkType(%1)) {
std::vector<void*> ptrs = Shiboken::Object::cppPointers((SbkObject*)%1);
%PYARG_0 = PyTuple_New(ptrs.size());
for (std::size_t i = 0; i < ptrs.size(); ++i)
PyTuple_SET_ITEM(%PYARG_0, i, PyLong_FromVoidPtr(ptrs[i]));
} else {
PyErr_SetString(PyExc_TypeError, "You need a shiboken-based type.");
}
if (Shiboken::Object::checkType(%1)) {
Shiboken::Object::callCppDestructors((SbkObject*)%1);
} else {
PyErr_SetString(PyExc_TypeError, "You need a shiboken-based type.");
}
if (Shiboken::Object::checkType(%1)) {
bool hasOwnership = Shiboken::Object::hasOwnership((SbkObject*)%1);
%PYARG_0 = %CONVERTTOPYTHON[bool](hasOwnership);
} else {
PyErr_SetString(PyExc_TypeError, "You need a shiboken-based type.");
}
if (Shiboken::Object::checkType(%1)) {
bool wasCreatedByPython = Shiboken::Object::wasCreatedByPython((SbkObject*)%1);
%PYARG_0 = %CONVERTTOPYTHON[bool](wasCreatedByPython);
} else {
PyErr_SetString(PyExc_TypeError, "You need a shiboken-based type.");
}
if (!Shiboken::Object::checkType(%1)) {
%PYARG_0 = Shiboken::String::fromCString("Ordinary Python type.");
} else {
std::string str = Shiboken::Object::info((SbkObject*)%1);
%PYARG_0 = Shiboken::String::fromCString(str.c_str());
}
std::set<PyObject*> setAll = Shiboken::BindingManager::instance().getAllPyObjects();
PyObject* listAll = PyList_New(0);
if (listAll == NULL)
return NULL;
const std::set<PyObject*>::iterator end = setAll.end();
for (std::set<PyObject*>::iterator iter = setAll.begin(); iter != end; ++iter) {
if (*iter != NULL) {
if (PyList_Append(listAll, *iter) != 0) {
Py_DECREF(listAll);
return NULL;
}
}
}
return listAll;
// Add __version__ and __version_info__ attributes to the module
PyObject* version = PyTuple_New(5);
PyTuple_SET_ITEM(version, 0, PyInt_FromLong(SHIBOKEN_MAJOR_VERSION));
PyTuple_SET_ITEM(version, 1, PyInt_FromLong(SHIBOKEN_MINOR_VERSION));
PyTuple_SET_ITEM(version, 2, PyInt_FromLong(SHIBOKEN_MICRO_VERSION));
PyTuple_SET_ITEM(version, 3, Shiboken::String::fromCString(SHIBOKEN_RELEASE_LEVEL));
PyTuple_SET_ITEM(version, 4, PyInt_FromLong(SHIBOKEN_SERIAL));
PyModule_AddObject(module, "__version_info__", version);
PyModule_AddStringConstant(module, "__version__", SHIBOKEN_VERSION);
VoidPtr::addVoidPtrToModule(module);