summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHugo Parente Lima <hugo.pl@gmail.com>2010-11-09 17:47:10 -0200
committerHugo Parente Lima <hugo.pl@gmail.com>2010-11-10 15:36:29 -0200
commit0949f2b49dcfd9516e4e3e4044a97070533799ad (patch)
treed923b0c89c8495f9db49912667b9f647f60abf1d
parentf1ad9bf233f1fe88e72d350caaffc5164ce20511 (diff)
downloadshiboken-0949f2b49dcfd9516e4e3e4044a97070533799ad.tar.gz
shiboken-0949f2b49dcfd9516e4e3e4044a97070533799ad.tar.xz
shiboken-0949f2b49dcfd9516e4e3e4044a97070533799ad.zip
SbkBaseWrapper renamed to SbkObject
-rw-r--r--generator/cppgenerator.cpp14
-rw-r--r--libshiboken/basewrapper.cpp82
-rw-r--r--libshiboken/basewrapper.h32
-rw-r--r--libshiboken/basewrapper_p.h12
-rw-r--r--libshiboken/bindingmanager.cpp20
-rw-r--r--libshiboken/bindingmanager.h10
6 files changed, 85 insertions, 85 deletions
diff --git a/generator/cppgenerator.cpp b/generator/cppgenerator.cpp
index 2ab4bfdc..4f4498ac 100644
--- a/generator/cppgenerator.cpp
+++ b/generator/cppgenerator.cpp
@@ -779,13 +779,13 @@ void CppGenerator::writeMetaObjectMethod(QTextStream& s, const AbstractMetaClass
{
Indentation indentation(INDENT);
s << INDENT << "PyObject *pySelf = BindingManager::instance().retrieveWrapper(this);\n"
- << INDENT << "void *typeData = Shiboken::getTypeUserData(reinterpret_cast<SbkBaseWrapper*>(pySelf));" << endl
+ << INDENT << "void *typeData = Shiboken::getTypeUserData(reinterpret_cast<SbkObject*>(pySelf));" << endl
<< INDENT << "if (!typeData) {" << endl;
{
Indentation indentation2(INDENT);
s << INDENT << "m_metaObject = PySide::DynamicQMetaObject::createBasedOn(pySelf, pySelf->ob_type, &"
<< metaClass->qualifiedCppName() << "::staticMetaObject);" << endl
- << INDENT << "Shiboken::setTypeUserData(reinterpret_cast<SbkBaseWrapper*>(pySelf), m_metaObject, PySide::deleteDynamicQMetaObject);" << endl;
+ << INDENT << "Shiboken::setTypeUserData(reinterpret_cast<SbkObject*>(pySelf), m_metaObject, PySide::deleteDynamicQMetaObject);" << endl;
}
s << INDENT << "} else {" << endl;
{
@@ -854,7 +854,7 @@ void CppGenerator::writeConstructorWrapper(QTextStream& s, const AbstractMetaFun
s << INDENT << "const QMetaObject* metaObject;" << endl;
}
- s << INDENT << "SbkBaseWrapper* sbkSelf = reinterpret_cast<SbkBaseWrapper*>(self);" << endl;
+ s << INDENT << "SbkObject* sbkSelf = reinterpret_cast<SbkObject*>(self);" << endl;
if (metaClass->isAbstract() || metaClass->baseClassNames().size() > 1) {
s << INDENT << "SbkBaseWrapperType* type = reinterpret_cast<SbkBaseWrapperType*>(self->ob_type);" << endl;
@@ -1843,7 +1843,7 @@ void CppGenerator::writeMethodCall(QTextStream& s, const AbstractMetaFunction* f
}
if (func->isAbstract()) {
- s << INDENT << "if (Shiboken::Wrapper::hasCppWrapper(reinterpret_cast<SbkBaseWrapper*>(self))) {\n";
+ s << INDENT << "if (Shiboken::Wrapper::hasCppWrapper(reinterpret_cast<SbkObject*>(self))) {\n";
{
Indentation indent(INDENT);
s << INDENT << "PyErr_SetString(PyExc_NotImplementedError, \"pure virtual method '";
@@ -2145,7 +2145,7 @@ void CppGenerator::writeMethodCall(QTextStream& s, const AbstractMetaFunction* f
break;
}
- s << INDENT << "Shiboken::keepReference(reinterpret_cast<SbkBaseWrapper*>(self), \"";
+ s << INDENT << "Shiboken::keepReference(reinterpret_cast<SbkObject*>(self), \"";
QString varName = arg_mod.referenceCounts.first().varName;
if (varName.isEmpty())
varName = func->minimalSignature() + QString().number(arg_mod.index);
@@ -2429,7 +2429,7 @@ void CppGenerator::writeClassDefinition(QTextStream& s, const AbstractMetaClass*
s << INDENT << "PyObject_HEAD_INIT(&Shiboken::SbkBaseWrapperType_Type)" << endl;
s << INDENT << "/*ob_size*/ 0," << endl;
s << INDENT << "/*tp_name*/ \"" << metaClass->fullName() << "\"," << endl;
- s << INDENT << "/*tp_basicsize*/ sizeof(SbkBaseWrapper)," << endl;
+ s << INDENT << "/*tp_basicsize*/ sizeof(SbkObject)," << endl;
s << INDENT << "/*tp_itemsize*/ 0," << endl;
s << INDENT << "/*tp_dealloc*/ " << tp_dealloc << ',' << endl;
s << INDENT << "/*tp_print*/ 0," << endl;
@@ -2748,7 +2748,7 @@ void CppGenerator::writeSetterFunction(QTextStream& s, const AbstractMetaField*
bool pythonWrapperRefCounting = metaField->type()->typeEntry()->isObject()
|| metaField->type()->isValuePointer();
if (pythonWrapperRefCounting) {
- s << INDENT << "Shiboken::keepReference(reinterpret_cast<SbkBaseWrapper*>(self), \"";
+ s << INDENT << "Shiboken::keepReference(reinterpret_cast<SbkObject*>(self), \"";
s << metaField->name() << "\", value);" << endl;
//s << INDENT << "Py_XDECREF(oldvalue);" << endl;
s << endl;
diff --git a/libshiboken/basewrapper.cpp b/libshiboken/basewrapper.cpp
index 7c0e7a4e..a1813350 100644
--- a/libshiboken/basewrapper.cpp
+++ b/libshiboken/basewrapper.cpp
@@ -36,7 +36,7 @@ namespace Shiboken
static void SbkBaseWrapperType_dealloc(PyObject* pyObj);
static PyObject* SbkBaseWrapperType_TpNew(PyTypeObject* metatype, PyObject* args, PyObject* kwds);
static void incRefPyObject(PyObject* pyObj);
-static void decRefPyObjectlist(const std::list<SbkBaseWrapper*> &pyObj);
+static void decRefPyObjectlist(const std::list<SbkObject*> &pyObj);
extern "C"
{
@@ -90,7 +90,7 @@ PyTypeObject SbkBaseWrapperType_Type = {
/*tp_weaklist*/ 0
};
-static PyObject* SbkBaseWrapper_get_dict(SbkBaseWrapper* obj)
+static PyObject* SbkBaseWrapper_get_dict(SbkObject* obj)
{
if (!obj->ob_dict)
obj->ob_dict = PyDict_New();
@@ -109,7 +109,7 @@ SbkBaseWrapperType SbkBaseWrapper_Type = { { {
PyObject_HEAD_INIT(&SbkBaseWrapperType_Type)
/*ob_size*/ 0,
/*tp_name*/ "Shiboken.BaseWrapper",
- /*tp_basicsize*/ sizeof(SbkBaseWrapper),
+ /*tp_basicsize*/ sizeof(SbkObject),
/*tp_itemsize*/ 0,
/*tp_dealloc*/ deallocWrapperWithPrivateDtor,
/*tp_print*/ 0,
@@ -131,7 +131,7 @@ SbkBaseWrapperType SbkBaseWrapper_Type = { { {
/*tp_traverse*/ 0,
/*tp_clear*/ 0,
/*tp_richcompare*/ 0,
- /*tp_weaklistoffset*/ offsetof(SbkBaseWrapper, weakreflist),
+ /*tp_weaklistoffset*/ offsetof(SbkObject, weakreflist),
/*tp_iter*/ 0,
/*tp_iternext*/ 0,
/*tp_methods*/ 0,
@@ -141,7 +141,7 @@ SbkBaseWrapperType SbkBaseWrapper_Type = { { {
/*tp_dict*/ 0,
/*tp_descr_get*/ 0,
/*tp_descr_set*/ 0,
- /*tp_dictoffset*/ offsetof(SbkBaseWrapper, ob_dict),
+ /*tp_dictoffset*/ offsetof(SbkObject, ob_dict),
/*tp_init*/ 0,
/*tp_alloc*/ 0,
/*tp_new*/ 0,
@@ -163,7 +163,7 @@ SbkBaseWrapperType SbkBaseWrapper_Type = { { {
} //extern "C"
-void removeParent(SbkBaseWrapper* child)
+void removeParent(SbkObject* child)
{
ParentInfo* pInfo = child->d->parentInfo;
if (!pInfo || !pInfo->parent)
@@ -201,8 +201,8 @@ void setParent(PyObject* parent, PyObject* child)
}
bool parentIsNull = !parent || parent == Py_None;
- SbkBaseWrapper* parent_ = reinterpret_cast<SbkBaseWrapper*>(parent);
- SbkBaseWrapper* child_ = reinterpret_cast<SbkBaseWrapper*>(child);
+ SbkObject* parent_ = reinterpret_cast<SbkObject*>(parent);
+ SbkObject* child_ = reinterpret_cast<SbkObject*>(child);
if (!parentIsNull) {
if (!parent_->d->parentInfo)
@@ -236,7 +236,7 @@ void setParent(PyObject* parent, PyObject* child)
Py_DECREF(child);
}
-static void _destroyParentInfo(SbkBaseWrapper* obj, bool removeFromParent)
+static void _destroyParentInfo(SbkObject* obj, bool removeFromParent)
{
ParentInfo* pInfo = obj->d->parentInfo;
if (removeFromParent && pInfo && pInfo->parent)
@@ -245,7 +245,7 @@ static void _destroyParentInfo(SbkBaseWrapper* obj, bool removeFromParent)
if (pInfo) {
ChildrenList::iterator it = pInfo->children.begin();
for (; it != pInfo->children.end(); ++it) {
- SbkBaseWrapper*& child = *it;
+ SbkObject*& child = *it;
// keep this, the wrapper still alive
if (!obj->d->containsCppWrapper && child->d->containsCppWrapper && child->d->parentInfo) {
@@ -262,7 +262,7 @@ static void _destroyParentInfo(SbkBaseWrapper* obj, bool removeFromParent)
}
}
-void destroyParentInfo(SbkBaseWrapper* obj, bool removeFromParent)
+void destroyParentInfo(SbkObject* obj, bool removeFromParent)
{
BindingManager::instance().destroyWrapper(obj);
_destroyParentInfo(obj, removeFromParent);
@@ -285,7 +285,7 @@ PyObject* SbkBaseWrapper_New(SbkBaseWrapperType* instanceType,
instanceType = BindingManager::instance().resolveType(cptr, instanceType);
}
- SbkBaseWrapper* self = reinterpret_cast<SbkBaseWrapper*>(SbkBaseWrapper_TpNew(reinterpret_cast<PyTypeObject*>(instanceType), 0, 0));
+ SbkObject* self = reinterpret_cast<SbkObject*>(SbkBaseWrapper_TpNew(reinterpret_cast<PyTypeObject*>(instanceType), 0, 0));
self->d->cptr[0] = cptr;
self->d->hasOwnership = hasOwnership;
self->d->validCppObject = 1;
@@ -316,7 +316,7 @@ void walkThroughClassHierarchy(PyTypeObject* currentType, HierarchyVisitor* visi
PyObject* SbkBaseWrapper_TpNew(PyTypeObject* subtype, PyObject*, PyObject*)
{
- SbkBaseWrapper* self = reinterpret_cast<SbkBaseWrapper*>(subtype->tp_alloc(subtype, 0));
+ SbkObject* self = reinterpret_cast<SbkObject*>(subtype->tp_alloc(subtype, 0));
self->d = new SbkBaseWrapperPrivate;
SbkBaseWrapperType* sbkType = reinterpret_cast<SbkBaseWrapperType*>(subtype);
@@ -339,10 +339,10 @@ void* getCppPointer(PyObject* wrapper, PyTypeObject* desiredType)
int idx = 0;
if (reinterpret_cast<SbkBaseWrapperType*>(type)->is_multicpp)
idx = getTypeIndexOnHierarchy(type, desiredType);
- return reinterpret_cast<SbkBaseWrapper*>(wrapper)->d->cptr[idx];
+ return reinterpret_cast<SbkObject*>(wrapper)->d->cptr[idx];
}
-bool setCppPointer(SbkBaseWrapper* wrapper, PyTypeObject* desiredType, void* cptr)
+bool setCppPointer(SbkObject* wrapper, PyTypeObject* desiredType, void* cptr)
{
int idx = 0;
if (reinterpret_cast<SbkBaseWrapperType*>(wrapper->ob_type)->is_multicpp)
@@ -361,14 +361,14 @@ bool cppObjectIsInvalid(PyObject* wrapper)
{
if (!wrapper || wrapper == Py_None
|| wrapper->ob_type->ob_type != &Shiboken::SbkBaseWrapperType_Type
- || ((SbkBaseWrapper*)wrapper)->d->validCppObject) {
+ || ((SbkObject*)wrapper)->d->validCppObject) {
return false;
}
PyErr_SetString(PyExc_RuntimeError, "Internal C++ object already deleted.");
return true;
}
-void setTypeUserData(SbkBaseWrapper* wrapper, void *user_data, DeleteUserDataFunc d_func)
+void setTypeUserData(SbkObject* wrapper, void *user_data, DeleteUserDataFunc d_func)
{
SbkBaseWrapperType* ob_type = reinterpret_cast<SbkBaseWrapperType*>(wrapper->ob_type);
if (ob_type->user_data)
@@ -378,22 +378,22 @@ void setTypeUserData(SbkBaseWrapper* wrapper, void *user_data, DeleteUserDataFun
ob_type->user_data = user_data;
}
-void* getTypeUserData(SbkBaseWrapper* wrapper)
+void* getTypeUserData(SbkObject* wrapper)
{
return reinterpret_cast<SbkBaseWrapperType*>(wrapper->ob_type)->user_data;
}
void deallocWrapperWithPrivateDtor(PyObject* self)
{
- if (((SbkBaseWrapper *)self)->weakreflist)
+ if (((SbkObject *)self)->weakreflist)
PyObject_ClearWeakRefs(self);
BindingManager::instance().releaseWrapper(self);
- clearReferences(reinterpret_cast<SbkBaseWrapper*>(self));
- Py_TYPE(reinterpret_cast<SbkBaseWrapper*>(self))->tp_free(self);
+ clearReferences(reinterpret_cast<SbkObject*>(self));
+ Py_TYPE(reinterpret_cast<SbkObject*>(self))->tp_free(self);
}
-void keepReference(SbkBaseWrapper* self, const char* key, PyObject* referredObject, bool append)
+void keepReference(SbkObject* self, const char* key, PyObject* referredObject, bool append)
{
bool isNone = (!referredObject || (referredObject == Py_None));
@@ -412,7 +412,7 @@ void keepReference(SbkBaseWrapper* self, const char* key, PyObject* referredObje
}
if (!isNone) {
- std::list<SbkBaseWrapper*> values = splitPyObject(referredObject);
+ std::list<SbkObject*> values = splitPyObject(referredObject);
if (append && (iter != refCountMap.end()))
refCountMap[key].insert(refCountMap[key].end(), values.begin(), values.end());
else
@@ -420,7 +420,7 @@ void keepReference(SbkBaseWrapper* self, const char* key, PyObject* referredObje
}
}
-void clearReferences(SbkBaseWrapper* self)
+void clearReferences(SbkObject* self)
{
if (!self->d->referredObjects)
return;
@@ -454,7 +454,7 @@ bool importModule(const char* moduleName, PyTypeObject*** cppApiPtr)
class DtorCallerVisitor : public HierarchyVisitor
{
public:
- DtorCallerVisitor(SbkBaseWrapper* pyObj) : m_count(0), m_pyObj(pyObj) {}
+ DtorCallerVisitor(SbkObject* pyObj) : m_count(0), m_pyObj(pyObj) {}
virtual void visit(SbkBaseWrapperType* node)
{
node->cpp_dtor(m_pyObj->d->cptr[m_count]);
@@ -462,12 +462,12 @@ public:
}
private:
int m_count;
- SbkBaseWrapper* m_pyObj;
+ SbkObject* m_pyObj;
};
void deallocWrapper(PyObject* pyObj)
{
- SbkBaseWrapper* sbkObj = reinterpret_cast<SbkBaseWrapper*>(pyObj);
+ SbkObject* sbkObj = reinterpret_cast<SbkObject*>(pyObj);
if (sbkObj->weakreflist)
PyObject_ClearWeakRefs(pyObj);
@@ -639,20 +639,20 @@ bool canCallConstructor(PyTypeObject* myType, PyTypeObject* ctorType)
return true;
}
-std::list<SbkBaseWrapper*> splitPyObject(PyObject* pyObj)
+std::list<SbkObject*> splitPyObject(PyObject* pyObj)
{
- std::list<SbkBaseWrapper*> result;
+ std::list<SbkObject*> result;
if (PySequence_Check(pyObj)) {
AutoDecRef lst(PySequence_Fast(pyObj, "Invalid keep reference object."));
if (!lst.isNull()) {
for(int i = 0, i_max = PySequence_Fast_GET_SIZE(lst.object()); i < i_max; i++) {
PyObject* item = PySequence_Fast_GET_ITEM(lst.object(), i);
if (isShibokenType(item))
- result.push_back(reinterpret_cast<SbkBaseWrapper*>(item));
+ result.push_back(reinterpret_cast<SbkObject*>(item));
}
}
} else {
- result.push_back(reinterpret_cast<SbkBaseWrapper*>(pyObj));
+ result.push_back(reinterpret_cast<SbkObject*>(pyObj));
}
return result;
}
@@ -668,9 +668,9 @@ static void incRefPyObject(PyObject* pyObj)
}
}
-static void decRefPyObjectlist(const std::list<SbkBaseWrapper*> &lst)
+static void decRefPyObjectlist(const std::list<SbkObject*> &lst)
{
- std::list<SbkBaseWrapper*>::const_iterator iter = lst.begin();
+ std::list<SbkObject*>::const_iterator iter = lst.begin();
while(iter != lst.end()) {
Py_DECREF(*iter);
++iter;
@@ -680,34 +680,34 @@ static void decRefPyObjectlist(const std::list<SbkBaseWrapper*> &lst)
static void setSequenceOwnership(PyObject* pyObj, bool owner)
{
if (PySequence_Check(pyObj)) {
- std::list<SbkBaseWrapper*> objs = splitPyObject(pyObj);
- std::list<SbkBaseWrapper*>::const_iterator it = objs.begin();
+ std::list<SbkObject*> objs = splitPyObject(pyObj);
+ std::list<SbkObject*>::const_iterator it = objs.begin();
for(; it != objs.end(); ++it)
(*it)->d->hasOwnership = owner;
} else if (isShibokenType(pyObj)) {
- reinterpret_cast<SbkBaseWrapper*>(pyObj)->d->hasOwnership = owner;
+ reinterpret_cast<SbkObject*>(pyObj)->d->hasOwnership = owner;
}
}
namespace Wrapper
{
-void setValidCpp(SbkBaseWrapper* pyObj, bool value)
+void setValidCpp(SbkObject* pyObj, bool value)
{
pyObj->d->validCppObject = value;
}
-void setHasCppWrapper(SbkBaseWrapper* pyObj, bool value)
+void setHasCppWrapper(SbkObject* pyObj, bool value)
{
pyObj->d->containsCppWrapper = value;
}
-bool hasCppWrapper(SbkBaseWrapper* pyObj)
+bool hasCppWrapper(SbkObject* pyObj)
{
return pyObj->d->containsCppWrapper;
}
-void getOwnership(SbkBaseWrapper* pyObj)
+void getOwnership(SbkObject* pyObj)
{
pyObj->d->hasOwnership = true;
}
@@ -717,7 +717,7 @@ void getOwnership(PyObject* pyObj)
setSequenceOwnership(pyObj, true);
}
-void releaseOwnership(SbkBaseWrapper* pyObj)
+void releaseOwnership(SbkObject* pyObj)
{
pyObj->d->hasOwnership = false;
}
diff --git a/libshiboken/basewrapper.h b/libshiboken/basewrapper.h
index 5d0d4728..51ee7f8d 100644
--- a/libshiboken/basewrapper.h
+++ b/libshiboken/basewrapper.h
@@ -36,7 +36,7 @@ extern "C"
struct SbkBaseWrapperPrivate;
/// Base Python object for all the wrapped C++ classes.
-struct LIBSHIBOKEN_API SbkBaseWrapper
+struct LIBSHIBOKEN_API SbkObject
{
PyObject_HEAD
/// Instance dictionary.
@@ -121,13 +121,13 @@ LIBSHIBOKEN_API void setParent(PyObject* parent, PyObject* child);
* Remove this child from their parent, if any.
* \param child the child.
*/
-LIBSHIBOKEN_API void removeParent(SbkBaseWrapper* child);
+LIBSHIBOKEN_API void removeParent(SbkObject* child);
/**
* \internal This is an internal function called by SbkBaseWrapper_Dealloc, it's exported just for techinical reasons.
* \note Do not call this function inside your bindings.
*/
-LIBSHIBOKEN_API void destroyParentInfo(SbkBaseWrapper* obj, bool removeFromParent = true);
+LIBSHIBOKEN_API void destroyParentInfo(SbkObject* obj, bool removeFromParent = true);
/**
* Returns true if the object is an instance of a type created by the Shiboken generator.
@@ -153,13 +153,13 @@ LIBSHIBOKEN_API void* getCppPointer(PyObject* wrapper, PyTypeObject* desiredType
/**
* Set the C++ pointer of type \p desiredType of a Python object.
*/
-LIBSHIBOKEN_API bool setCppPointer(SbkBaseWrapper* wrapper, PyTypeObject* desiredType, void* cptr);
+LIBSHIBOKEN_API bool setCppPointer(SbkObject* wrapper, PyTypeObject* desiredType, void* cptr);
/**
* Get/Set Userdata in type class
*/
-LIBSHIBOKEN_API void setTypeUserData(SbkBaseWrapper* wrapper, void* user_data, DeleteUserDataFunc d_func);
-LIBSHIBOKEN_API void* getTypeUserData(SbkBaseWrapper* wrapper);
+LIBSHIBOKEN_API void setTypeUserData(SbkObject* wrapper, void* user_data, DeleteUserDataFunc d_func);
+LIBSHIBOKEN_API void* getTypeUserData(SbkObject* wrapper);
/**
* Returns true if the constructor of \p ctorType can be called for a instance of type \p myType.
@@ -175,8 +175,8 @@ LIBSHIBOKEN_API bool canCallConstructor(PyTypeObject* myType, PyTypeObject* ctor
#define SbkBaseWrapper_Check(op) PyObject_TypeCheck(op, (PyTypeObject*)&Shiboken::SbkBaseWrapper_Type)
#define SbkBaseWrapper_CheckExact(op) ((op)->ob_type == &Shiboken::SbkBaseWrapper_Type)
-#define SbkBaseWrapper_instanceDict(pyobj) (((SbkBaseWrapper*)pyobj)->ob_dict)
-#define SbkBaseWrapper_setInstanceDict(pyobj,d) (((SbkBaseWrapper*)pyobj)->ob_dict = d)
+#define SbkBaseWrapper_instanceDict(pyobj) (((SbkObject*)pyobj)->ob_dict)
+#define SbkBaseWrapper_setInstanceDict(pyobj,d) (((SbkObject*)pyobj)->ob_dict = d)
LIBSHIBOKEN_API PyObject*
SbkBaseWrapper_New(SbkBaseWrapperType* instanceType,
@@ -200,7 +200,7 @@ SbkBaseWrapper_TpNew(PyTypeObject* subtype, PyObject*, PyObject*);
* \param key a key that identifies the C++ method signature and argument where the referredObject came from.
* \parem referredObject the object whose reference is used by the self object.
*/
-LIBSHIBOKEN_API void keepReference(SbkBaseWrapper* self, const char* key, PyObject* referredObject, bool append=false);
+LIBSHIBOKEN_API void keepReference(SbkObject* self, const char* key, PyObject* referredObject, bool append=false);
/// Returns true and sets a Python RuntimeError if the Python wrapper is not marked as valid.
LIBSHIBOKEN_API bool cppObjectIsInvalid(PyObject* wrapper);
@@ -221,14 +221,14 @@ LIBSHIBOKEN_API void setErrorAboutWrongArguments(PyObject* args, const char* fun
namespace Wrapper {
-LIBSHIBOKEN_API void setValidCpp(SbkBaseWrapper* pyObj, bool value);
-LIBSHIBOKEN_API void setHasCppWrapper(SbkBaseWrapper* pyObj, bool value);
-LIBSHIBOKEN_API bool hasCppWrapper(SbkBaseWrapper* pyObj);
+LIBSHIBOKEN_API void setValidCpp(SbkObject* pyObj, bool value);
+LIBSHIBOKEN_API void setHasCppWrapper(SbkObject* pyObj, bool value);
+LIBSHIBOKEN_API bool hasCppWrapper(SbkObject* pyObj);
-LIBSHIBOKEN_API void getOwnership(PyObject* pyobj);
-LIBSHIBOKEN_API void getOwnership(SbkBaseWrapper* pyobj);
-LIBSHIBOKEN_API void releaseOwnership(PyObject* pyobj);
-LIBSHIBOKEN_API void releaseOwnership(SbkBaseWrapper* pyobj);
+LIBSHIBOKEN_API void getOwnership(PyObject* pyObj);
+LIBSHIBOKEN_API void getOwnership(SbkObject* pyObj);
+LIBSHIBOKEN_API void releaseOwnership(PyObject* pyObj);
+LIBSHIBOKEN_API void releaseOwnership(SbkObject* pyObj);
} // namespace Wrapper
diff --git a/libshiboken/basewrapper_p.h b/libshiboken/basewrapper_p.h
index 1a72781d..34a3ea6d 100644
--- a/libshiboken/basewrapper_p.h
+++ b/libshiboken/basewrapper_p.h
@@ -27,7 +27,7 @@
#include <list>
#include <map>
-struct SbkBaseWrapper;
+struct SbkObject;
namespace Shiboken
{
@@ -35,11 +35,11 @@ namespace Shiboken
* This mapping associates a method and argument of an wrapper object with the wrapper of
* said argument when it needs the binding to help manage its reference counting.
*/
-typedef std::map<std::string, std::list<SbkBaseWrapper*> > RefCountMap;
+typedef std::map<std::string, std::list<SbkObject*> > RefCountMap;
/// Linked list of SbkBaseWrapper pointers
-typedef std::list<SbkBaseWrapper*> ChildrenList;
+typedef std::list<SbkObject*> ChildrenList;
/// Struct used to store information about object parent and children.
struct ParentInfo
@@ -47,7 +47,7 @@ struct ParentInfo
/// Default ctor.
ParentInfo() : parent(0), hasWrapperRef(false) {}
/// Pointer to parent object.
- SbkBaseWrapper* parent;
+ SbkObject* parent;
/// List of object children.
ChildrenList children;
/// has internal ref
@@ -86,7 +86,7 @@ namespace Shiboken
/**
* Utility function uset to transform PyObject which suppot sequence protocol in a std::list
**/
-std::list<SbkBaseWrapper*> splitPyObject(PyObject* pyObj);
+std::list<SbkObject*> splitPyObject(PyObject* pyObj);
struct SbkBaseWrapperType;
@@ -185,7 +185,7 @@ inline std::list<SbkBaseWrapperType*> getCppBaseClasses(PyTypeObject* baseType)
* Decrements the reference counters of every object referred by self.
* \param self the wrapper instance that keeps references to other objects.
*/
-void clearReferences(SbkBaseWrapper* self);
+void clearReferences(SbkObject* self);
} // namespace Shiboken
diff --git a/libshiboken/bindingmanager.cpp b/libshiboken/bindingmanager.cpp
index 5e9be699..e2d32d83 100644
--- a/libshiboken/bindingmanager.cpp
+++ b/libshiboken/bindingmanager.cpp
@@ -162,7 +162,7 @@ bool BindingManager::hasWrapper(const void* cptr)
{
return m_d->wrapperMapper.count(cptr);
}
-void BindingManager::registerWrapper(SbkBaseWrapper* pyobj, void* cptr)
+void BindingManager::registerWrapper(SbkObject* pyobj, void* cptr)
{
SbkBaseWrapperType* instanceType = reinterpret_cast<SbkBaseWrapperType*>(pyobj->ob_type);
@@ -184,7 +184,7 @@ void BindingManager::releaseWrapper(PyObject* wrapper)
SbkBaseWrapperType* sbkType = reinterpret_cast<SbkBaseWrapperType*>(wrapper->ob_type);
int numBases = sbkType->is_multicpp ? getNumberOfCppBaseClasses(wrapper->ob_type) : 1;
- void** cptrs = reinterpret_cast<SbkBaseWrapper*>(wrapper)->d->cptr;
+ void** cptrs = reinterpret_cast<SbkObject*>(wrapper)->d->cptr;
for (int i = 0; i < numBases; ++i) {
void* cptr = cptrs[i];
m_d->releaseWrapper(cptr);
@@ -250,13 +250,13 @@ PyObject* BindingManager::getOverride(const void* cptr, const char* methodName)
void BindingManager::invalidateWrapper(PyObject* pyobj)
{
- std::list<SbkBaseWrapper*> objs = splitPyObject(pyobj);
- std::list<SbkBaseWrapper*>::const_iterator it = objs.begin();
+ std::list<SbkObject*> objs = splitPyObject(pyobj);
+ std::list<SbkObject*>::const_iterator it = objs.begin();
for(; it != objs.end(); it++)
invalidateWrapper(*it);
}
-void BindingManager::invalidateWrapper(SbkBaseWrapper* wrapper)
+void BindingManager::invalidateWrapper(SbkObject* wrapper)
{
if (!wrapper || ((PyObject*)wrapper == Py_None) || !wrapper->d->validCppObject)
return;
@@ -302,10 +302,10 @@ void BindingManager::destroyWrapper(const void* cptr)
{
WrapperMap::iterator iter = m_d->wrapperMapper.find(cptr);
if (iter != m_d->wrapperMapper.end())
- destroyWrapper(reinterpret_cast<SbkBaseWrapper*>(iter->second));
+ destroyWrapper(reinterpret_cast<SbkObject*>(iter->second));
}
-void BindingManager::destroyWrapper(SbkBaseWrapper* wrapper)
+void BindingManager::destroyWrapper(SbkObject* wrapper)
{
GilState gil;
m_d->destroying = true;
@@ -315,13 +315,13 @@ void BindingManager::destroyWrapper(SbkBaseWrapper* wrapper)
void BindingManager::transferOwnershipToCpp(PyObject* wrapper)
{
- std::list<SbkBaseWrapper*> objs = splitPyObject(wrapper);
- std::list<SbkBaseWrapper*>::const_iterator it = objs.begin();
+ std::list<SbkObject*> objs = splitPyObject(wrapper);
+ std::list<SbkObject*>::const_iterator it = objs.begin();
for(; it != objs.end(); it++)
transferOwnershipToCpp(*it);
}
-void BindingManager::transferOwnershipToCpp(SbkBaseWrapper* wrapper)
+void BindingManager::transferOwnershipToCpp(SbkObject* wrapper)
{
if (wrapper->d->parentInfo)
Shiboken::removeParent(wrapper);
diff --git a/libshiboken/bindingmanager.h b/libshiboken/bindingmanager.h
index b5bf43b6..31ed7981 100644
--- a/libshiboken/bindingmanager.h
+++ b/libshiboken/bindingmanager.h
@@ -27,7 +27,7 @@
#include <set>
#include "shibokenmacros.h"
-struct SbkBaseWrapper;
+struct SbkObject;
namespace Shiboken
{
@@ -41,20 +41,20 @@ public:
bool hasWrapper(const void *cptr);
- void registerWrapper(SbkBaseWrapper* pyobj, void* cptr);
+ void registerWrapper(SbkObject* pyobj, void* cptr);
void releaseWrapper(PyObject* wrapper);
PyObject* retrieveWrapper(const void* cptr);
PyObject* getOverride(const void* cptr, const char* methodName);
/// Invalidate the Python wrapper and removes the relations from C++ pointers to the Python wrapper.
- void invalidateWrapper(SbkBaseWrapper* wrapper);
+ void invalidateWrapper(SbkObject* wrapper);
/// Convenience method to call invalidateWrapper with a properly cast SbkBaseWrapper.
void invalidateWrapper(PyObject* wrapper);
/// Convenience method to invalidate the Python wrapper for a C++ wrapped object. Do nothing if C++ pointer has no Python wrapper.
void invalidateWrapper(const void* cptr);
/// Transfers the ownership of a Python wrapper to C++.
- void transferOwnershipToCpp(SbkBaseWrapper* wrapper);
+ void transferOwnershipToCpp(SbkObject* wrapper);
/// Convenience method to call transferOwnershipToCpp with a properly cast SbkBaseWrapper.
void transferOwnershipToCpp(PyObject* wrapper);
void addClassInheritance(SbkBaseWrapperType* parent, SbkBaseWrapperType* child);
@@ -62,7 +62,7 @@ public:
/// Called by wrapper destructor
void destroyWrapper(const void* cptr);
- void destroyWrapper(SbkBaseWrapper* wrapper);
+ void destroyWrapper(SbkObject* wrapper);
std::set<PyObject*> getAllPyObjects();
private:
~BindingManager();