summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHugo Parente Lima <hugo.pl@gmail.com>2010-11-10 14:19:44 -0200
committerHugo Parente Lima <hugo.pl@gmail.com>2010-11-10 15:36:29 -0200
commit5bd16e14f8cfe735762cf7b38f7488af6e36e94d (patch)
treec2d0359a755fad19483f3d065b54caf7275bc061
parent0316703e8960c6b548e38ad243bdb4fd155b2460 (diff)
downloadshiboken-5bd16e14f8cfe735762cf7b38f7488af6e36e94d.tar.gz
shiboken-5bd16e14f8cfe735762cf7b38f7488af6e36e94d.tar.xz
shiboken-5bd16e14f8cfe735762cf7b38f7488af6e36e94d.zip
SbkBaseWrapperType renamed to SbkObjectType.
-rw-r--r--generator/cppgenerator.cpp24
-rw-r--r--generator/headergenerator.cpp6
-rw-r--r--libshiboken/basewrapper.cpp38
-rw-r--r--libshiboken/basewrapper.h14
-rw-r--r--libshiboken/basewrapper_p.h18
-rw-r--r--libshiboken/bindingmanager.cpp22
-rw-r--r--libshiboken/bindingmanager.h6
-rw-r--r--libshiboken/conversions.h12
-rw-r--r--libshiboken/typeresolver.h2
9 files changed, 71 insertions, 71 deletions
diff --git a/generator/cppgenerator.cpp b/generator/cppgenerator.cpp
index 3936d03f..29435231 100644
--- a/generator/cppgenerator.cpp
+++ b/generator/cppgenerator.cpp
@@ -857,8 +857,8 @@ void CppGenerator::writeConstructorWrapper(QTextStream& s, const AbstractMetaFun
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;
- s << INDENT << "SbkBaseWrapperType* myType = reinterpret_cast<SbkBaseWrapperType*>(" << cpythonTypeNameExt(metaClass->typeEntry()) << ");" << endl;
+ s << INDENT << "SbkObjectType* type = reinterpret_cast<SbkObjectType*>(self->ob_type);" << endl;
+ s << INDENT << "SbkObjectType* myType = reinterpret_cast<SbkObjectType*>(" << cpythonTypeNameExt(metaClass->typeEntry()) << ");" << endl;
}
if (metaClass->isAbstract()) {
@@ -2217,12 +2217,12 @@ void CppGenerator::writeMultipleInheritanceInitializerFunction(QTextStream& s, c
void CppGenerator::writeSpecialCastFunction(QTextStream& s, const AbstractMetaClass* metaClass)
{
QString className = metaClass->qualifiedCppName();
- s << "static void* " << cpythonSpecialCastFunctionName(metaClass) << "(void* obj, SbkBaseWrapperType* desiredType)\n";
+ s << "static void* " << cpythonSpecialCastFunctionName(metaClass) << "(void* obj, SbkObjectType* desiredType)\n";
s << "{\n";
s << INDENT << className << "* me = reinterpret_cast<" << className << "*>(obj);\n";
bool firstClass = true;
foreach (const AbstractMetaClass* baseClass, getAllAncestors(metaClass)) {
- s << INDENT << (!firstClass ? "else " : "") << "if (desiredType == reinterpret_cast<SbkBaseWrapperType*>(" << cpythonTypeNameExt(baseClass->typeEntry()) << "))\n";
+ s << INDENT << (!firstClass ? "else " : "") << "if (desiredType == reinterpret_cast<SbkObjectType*>(" << cpythonTypeNameExt(baseClass->typeEntry()) << "))\n";
Indentation indent(INDENT);
s << INDENT << "return static_cast<" << baseClass->qualifiedCppName() << "*>(me);\n";
firstClass = false;
@@ -2274,7 +2274,7 @@ void CppGenerator::writeExtendedToCppFunction(QTextStream& s, const TypeEntry* e
void CppGenerator::writeExtendedConverterInitialization(QTextStream& s, const TypeEntry* externalType, const QList<const AbstractMetaClass*>& conversions)
{
s << INDENT << "// Extended implicit conversions for " << externalType->targetLangPackage() << '.' << externalType->name() << endl;
- s << INDENT << "shiboType = reinterpret_cast<SbkBaseWrapperType*>(";
+ s << INDENT << "shiboType = reinterpret_cast<SbkObjectType*>(";
s << cppApiVariableName(externalType->targetLangPackage()) << '[';
s << getTypeIndexVariableName(externalType) << "]);" << endl;
s << INDENT << "shiboType->ext_isconvertible = " << extendedIsConvertibleFunctionName(externalType) << ';' << endl;
@@ -2425,7 +2425,7 @@ void CppGenerator::writeClassDefinition(QTextStream& s, const AbstractMetaClass*
s << "// Class Definition -----------------------------------------------" << endl;
s << "extern \"C\" {" << endl;
- s << "static SbkBaseWrapperType " << className + "_Type" << " = { { {" << endl;
+ s << "static SbkObjectType " << className + "_Type" << " = { { {" << endl;
s << INDENT << "PyObject_HEAD_INIT(&SbkBaseWrapperType_Type)" << endl;
s << INDENT << "/*ob_size*/ 0," << endl;
s << INDENT << "/*tp_name*/ \"" << metaClass->fullName() << "\"," << endl;
@@ -3248,7 +3248,7 @@ void CppGenerator::writeClassRegister(QTextStream& s, const AbstractMetaClass* m
const AbstractMetaClass* miClass = getMultipleInheritingClass(metaClass);
if (miClass && miClass != metaClass) {
s << INDENT << cpythonTypeName(metaClass) << ".mi_init = ";
- s << "reinterpret_cast<SbkBaseWrapperType*>(" + cpythonTypeNameExt(miClass->typeEntry()) + ")->mi_init;" << endl << endl;
+ s << "reinterpret_cast<SbkObjectType*>(" + cpythonTypeNameExt(miClass->typeEntry()) + ")->mi_init;" << endl << endl;
}
// Set typediscovery struct or fill the struct of another one
@@ -3258,7 +3258,7 @@ void CppGenerator::writeClassRegister(QTextStream& s, const AbstractMetaClass* m
s << INDENT << cpythonTypeName(metaClass) << ".type_discovery = &" << cpythonBaseName(metaClass) << "_typeDiscovery;" << endl;
s << INDENT << "Shiboken::BindingManager& bm = Shiboken::BindingManager::instance();" << endl;
foreach (const AbstractMetaClass* base, baseClasses) {
- s << INDENT << "bm.addClassInheritance(reinterpret_cast<SbkBaseWrapperType*>(" << cpythonTypeNameExt(base->typeEntry()) << "), &" << cpythonTypeName(metaClass) << ");" << endl;
+ s << INDENT << "bm.addClassInheritance(reinterpret_cast<SbkObjectType*>(" << cpythonTypeNameExt(base->typeEntry()) << "), &" << cpythonTypeName(metaClass) << ");" << endl;
}
}
s << endl;
@@ -3336,7 +3336,7 @@ void CppGenerator::writeTypeDiscoveryFunction(QTextStream& s, const AbstractMeta
{
QString polymorphicExpr = metaClass->typeEntry()->polymorphicIdValue();
- s << "static SbkBaseWrapperType* " << cpythonBaseName(metaClass) << "_typeDiscovery(void* cptr, SbkBaseWrapperType* instanceType)\n{" << endl;
+ s << "static SbkObjectType* " << cpythonBaseName(metaClass) << "_typeDiscovery(void* cptr, SbkObjectType* instanceType)\n{" << endl;
if (!metaClass->baseClass()) {
s << INDENT << "TypeResolver* typeResolver = TypeResolver::get(typeid(*reinterpret_cast<"
@@ -3344,7 +3344,7 @@ void CppGenerator::writeTypeDiscoveryFunction(QTextStream& s, const AbstractMeta
s << INDENT << "if (typeResolver)" << endl;
{
Indentation indent(INDENT);
- s << INDENT << "return reinterpret_cast<SbkBaseWrapperType*>(typeResolver->pythonType());" << endl;
+ s << INDENT << "return reinterpret_cast<SbkObjectType*>(typeResolver->pythonType());" << endl;
}
} else if (!polymorphicExpr.isEmpty()) {
polymorphicExpr = polymorphicExpr.replace("%1", " reinterpret_cast<"+metaClass->qualifiedCppName()+"*>(cptr)");
@@ -3359,7 +3359,7 @@ void CppGenerator::writeTypeDiscoveryFunction(QTextStream& s, const AbstractMeta
if (ancestor->baseClass())
continue;
if (ancestor->isPolymorphic()) {
- s << INDENT << "if (instanceType == reinterpret_cast<SbkBaseWrapperType*>(Shiboken::SbkType<"
+ s << INDENT << "if (instanceType == reinterpret_cast<SbkObjectType*>(Shiboken::SbkType<"
<< ancestor->qualifiedCppName() << " >()) && dynamic_cast<" << metaClass->qualifiedCppName()
<< "*>(reinterpret_cast<"<< ancestor->qualifiedCppName() << "*>(cptr)))" << endl;
Indentation indent(INDENT);
@@ -3680,7 +3680,7 @@ void CppGenerator::finishGeneration()
if (!extendedConverters.isEmpty()) {
s << INDENT << "// Initialize extended Converters" << endl;
- s << INDENT << "SbkBaseWrapperType* shiboType;" << endl << endl;
+ s << INDENT << "SbkObjectType* shiboType;" << endl << endl;
}
foreach (const TypeEntry* externalType, extendedConverters.keys()) {
writeExtendedConverterInitialization(s, externalType, extendedConverters[externalType]);
diff --git a/generator/headergenerator.cpp b/generator/headergenerator.cpp
index 5a9721c9..4afbc1d7 100644
--- a/generator/headergenerator.cpp
+++ b/generator/headergenerator.cpp
@@ -434,7 +434,7 @@ void HeaderGenerator::finishGeneration()
s << INDENT << metaClass->qualifiedCppName() << "* value = const_cast<" << metaClass->qualifiedCppName() << "* >(cppobj);" << endl;
s << INDENT << "if (!isExactType)" << endl;
s << INDENT << INDENT << "typeName = typeid(*value).name();" << endl;
- s << INDENT << "PyObject* pyObj = Shiboken::SbkBaseWrapper_New(reinterpret_cast<SbkBaseWrapperType*>(SbkType<" << metaClass->qualifiedCppName() << " >()),"
+ s << INDENT << "PyObject* pyObj = Shiboken::Wrapper::newObject(reinterpret_cast<SbkObjectType*>(SbkType<" << metaClass->qualifiedCppName() << " >()),"
<< "value, hasOwnership, isExactType, typeName);" << endl;
s << INDENT << "PySide::Signal::updateSourceObject(pyObj);" << endl;
s << INDENT << "return pyObj;" << endl;
@@ -531,7 +531,7 @@ void HeaderGenerator::writeTypeConverterImpl(QTextStream& s, const TypeEntry* ty
}
- s << INDENT << "SbkBaseWrapperType* shiboType = reinterpret_cast<SbkBaseWrapperType*>(SbkType<";
+ s << INDENT << "SbkObjectType* shiboType = reinterpret_cast<SbkObjectType*>(SbkType<";
s << type->name() << " >());" << endl;
s << INDENT << "return ";
bool isFirst = true;
@@ -561,7 +561,7 @@ void HeaderGenerator::writeTypeConverterImpl(QTextStream& s, const TypeEntry* ty
s << INDENT << "if (!Shiboken_TypeCheck(pyobj, " << type->name() << ")) {" << endl;
{
Indentation indent(INDENT);
- s << INDENT << "SbkBaseWrapperType* shiboType = reinterpret_cast<SbkBaseWrapperType*>(SbkType<";
+ s << INDENT << "SbkObjectType* shiboType = reinterpret_cast<SbkObjectType*>(SbkType<";
s << type->name() << " >());" << endl;
}
bool firstImplicitIf = true;
diff --git a/libshiboken/basewrapper.cpp b/libshiboken/basewrapper.cpp
index 3337a4d2..26652548 100644
--- a/libshiboken/basewrapper.cpp
+++ b/libshiboken/basewrapper.cpp
@@ -39,8 +39,8 @@ static PyObject* SbkBaseWrapperType_TpNew(PyTypeObject* metatype, PyObject* args
PyTypeObject SbkBaseWrapperType_Type = {
PyObject_HEAD_INIT(0)
/*ob_size*/ 0,
- /*tp_name*/ "Shiboken.BaseWrapperType",
- /*tp_basicsize*/ sizeof(SbkBaseWrapperType),
+ /*tp_name*/ "Shiboken.ObjectType",
+ /*tp_basicsize*/ sizeof(SbkObjectType),
/*tp_itemsize*/ 0,
/*tp_dealloc*/ SbkBaseWrapperType_dealloc,
/*tp_print*/ 0,
@@ -100,10 +100,10 @@ static PyGetSetDef SbkBaseWrapper_getsetlist[] = {
{0} // Sentinel
};
-SbkBaseWrapperType SbkBaseWrapper_Type = { { {
+SbkObjectType SbkBaseWrapper_Type = { { {
PyObject_HEAD_INIT(&SbkBaseWrapperType_Type)
/*ob_size*/ 0,
- /*tp_name*/ "Shiboken.BaseWrapper",
+ /*tp_name*/ "Shiboken.Object",
/*tp_basicsize*/ sizeof(SbkObject),
/*tp_itemsize*/ 0,
/*tp_dealloc*/ SbkDeallocWrapperWithPrivateDtor,
@@ -165,7 +165,7 @@ void SbkDeallocWrapper(PyObject* pyObj)
Shiboken::BindingManager::instance().releaseWrapper(sbkObj);
if (sbkObj->d->hasOwnership) {
- SbkBaseWrapperType* sbkType = reinterpret_cast<SbkBaseWrapperType*>(pyObj->ob_type);
+ SbkObjectType* sbkType = reinterpret_cast<SbkObjectType*>(pyObj->ob_type);
if (sbkType->is_multicpp) {
Shiboken::DtorCallerVisitor visitor(sbkObj);
Shiboken::walkThroughClassHierarchy(pyObj->ob_type, &visitor);
@@ -198,7 +198,7 @@ void SbkDeallocWrapperWithPrivateDtor(PyObject* self)
void SbkBaseWrapperType_dealloc(PyObject* pyObj)
{
- SbkBaseWrapperType *sbkType = reinterpret_cast<SbkBaseWrapperType*>(pyObj->ob_type);
+ SbkObjectType *sbkType = reinterpret_cast<SbkObjectType*>(pyObj->ob_type);
if(sbkType->user_data && sbkType->d_func) {
sbkType->d_func(sbkType->user_data);
@@ -209,14 +209,14 @@ void SbkBaseWrapperType_dealloc(PyObject* pyObj)
PyObject* SbkBaseWrapperType_TpNew(PyTypeObject* metatype, PyObject* args, PyObject* kwds)
{
// The meta type creates a new type when the Python programmer extends a wrapped C++ class.
- SbkBaseWrapperType* newType = reinterpret_cast<SbkBaseWrapperType*>(PyType_Type.tp_new(metatype, args, kwds));
+ SbkObjectType* newType = reinterpret_cast<SbkObjectType*>(PyType_Type.tp_new(metatype, args, kwds));
if (!newType)
return 0;
- std::list<SbkBaseWrapperType*> bases = Shiboken::getCppBaseClasses(reinterpret_cast<PyTypeObject*>(newType));
+ std::list<SbkObjectType*> bases = Shiboken::getCppBaseClasses(reinterpret_cast<PyTypeObject*>(newType));
if (bases.size() == 1) {
- SbkBaseWrapperType* parentType = bases.front();
+ SbkObjectType* parentType = bases.front();
newType->mi_offsets = parentType->mi_offsets;
newType->mi_init = parentType->mi_init;
newType->mi_specialcast = parentType->mi_specialcast;
@@ -252,7 +252,7 @@ PyObject* SbkObjectTpNew(PyTypeObject* subtype, PyObject*, PyObject*)
SbkObject* self = reinterpret_cast<SbkObject*>(subtype->tp_alloc(subtype, 0));
self->d = new SbkBaseWrapperPrivate;
- SbkBaseWrapperType* sbkType = reinterpret_cast<SbkBaseWrapperType*>(subtype);
+ SbkObjectType* sbkType = reinterpret_cast<SbkObjectType*>(subtype);
int numBases = sbkType->is_multicpp ? Shiboken::getNumberOfCppBaseClasses(subtype) : 1;
self->d->cptr = new void*[numBases];
std::memset(self->d->cptr, 0, sizeof(void*)*numBases);
@@ -390,7 +390,7 @@ void walkThroughClassHierarchy(PyTypeObject* currentType, HierarchyVisitor* visi
if (type->ob_type != &SbkBaseWrapperType_Type) {
continue;
} else {
- SbkBaseWrapperType* sbkType = reinterpret_cast<SbkBaseWrapperType*>(type);
+ SbkObjectType* sbkType = reinterpret_cast<SbkObjectType*>(type);
if (sbkType->is_user_type)
walkThroughClassHierarchy(type, visitor);
else
@@ -403,7 +403,7 @@ void walkThroughClassHierarchy(PyTypeObject* currentType, HierarchyVisitor* visi
void setTypeUserData(SbkObject* wrapper, void *user_data, DeleteUserDataFunc d_func)
{
- SbkBaseWrapperType* ob_type = reinterpret_cast<SbkBaseWrapperType*>(wrapper->ob_type);
+ SbkObjectType* ob_type = reinterpret_cast<SbkObjectType*>(wrapper->ob_type);
if (ob_type->user_data)
ob_type->d_func(ob_type->user_data);
@@ -413,7 +413,7 @@ void setTypeUserData(SbkObject* wrapper, void *user_data, DeleteUserDataFunc d_f
void* getTypeUserData(SbkObject* wrapper)
{
- return reinterpret_cast<SbkBaseWrapperType*>(wrapper->ob_type)->user_data;
+ return reinterpret_cast<SbkObjectType*>(wrapper->ob_type)->user_data;
}
void keepReference(SbkObject* self, const char* key, PyObject* referredObject, bool append)
@@ -474,7 +474,7 @@ bool importModule(const char* moduleName, PyTypeObject*** cppApiPtr)
// Wrapper metatype and base type ----------------------------------------------------------
-void DtorCallerVisitor::visit(SbkBaseWrapperType* node)
+void DtorCallerVisitor::visit(SbkObjectType* node)
{
node->cpp_dtor(m_pyObj->d->cptr[m_count]);
m_count++;
@@ -548,7 +548,7 @@ class FindBaseTypeVisitor : public HierarchyVisitor
{
public:
FindBaseTypeVisitor(PyTypeObject* typeToFind) : m_found(false), m_typeToFind(typeToFind) {}
- virtual void visit(SbkBaseWrapperType* node)
+ virtual void visit(SbkObjectType* node)
{
if (reinterpret_cast<PyTypeObject*>(node) == m_typeToFind) {
m_found = true;
@@ -666,7 +666,7 @@ void* cppPointer(PyObject* pyObj, PyTypeObject* desiredType)
assert(isShibokenType(pyObj));
PyTypeObject* type = pyObj->ob_type;
int idx = 0;
- if (reinterpret_cast<SbkBaseWrapperType*>(type)->is_multicpp)
+ if (reinterpret_cast<SbkObjectType*>(type)->is_multicpp)
idx = getTypeIndexOnHierarchy(type, desiredType);
return reinterpret_cast<SbkObject*>(pyObj)->d->cptr[idx];
}
@@ -674,7 +674,7 @@ void* cppPointer(PyObject* pyObj, PyTypeObject* desiredType)
bool setCppPointer(SbkObject* sbkObj, PyTypeObject* desiredType, void* cptr)
{
int idx = 0;
- if (reinterpret_cast<SbkBaseWrapperType*>(sbkObj->ob_type)->is_multicpp)
+ if (reinterpret_cast<SbkObjectType*>(sbkObj->ob_type)->is_multicpp)
idx = getTypeIndexOnHierarchy(sbkObj->ob_type, desiredType);
bool alreadyInitialized = sbkObj->d->cptr[idx];
@@ -697,7 +697,7 @@ bool isValid(PyObject* pyObj)
return false;
}
-PyObject* newObject(SbkBaseWrapperType* instanceType,
+PyObject* newObject(SbkObjectType* instanceType,
void* cptr,
bool hasOwnership,
bool isExactType,
@@ -709,7 +709,7 @@ PyObject* newObject(SbkBaseWrapperType* instanceType,
if (typeName) {
tr = TypeResolver::get(typeName);
if (tr)
- instanceType = reinterpret_cast<SbkBaseWrapperType*>(tr->pythonType());
+ instanceType = reinterpret_cast<SbkObjectType*>(tr->pythonType());
}
if (!tr)
instanceType = BindingManager::instance().resolveType(cptr, instanceType);
diff --git a/libshiboken/basewrapper.h b/libshiboken/basewrapper.h
index df5f8e35..fbb558f7 100644
--- a/libshiboken/basewrapper.h
+++ b/libshiboken/basewrapper.h
@@ -51,7 +51,7 @@ struct LIBSHIBOKEN_API SbkObject
LIBSHIBOKEN_API void SbkDeallocWrapper(PyObject* pyObj);
LIBSHIBOKEN_API void SbkDeallocWrapperWithPrivateDtor(PyObject* self);
-struct SbkBaseWrapperType;
+struct SbkObjectType;
/// Function signature for the multiple inheritance information initializers that should be provided by classes with multiple inheritance.
typedef int* (*MultipleInheritanceInitFunction)(const void*);
@@ -61,9 +61,9 @@ typedef int* (*MultipleInheritanceInitFunction)(const void*);
* part of a multiple inheritance hierarchy.
* The implementation of this function is auto generated by the generator and you don't need to care about it.
*/
-typedef void* (*SpecialCastFunction)(void*, SbkBaseWrapperType*);
+typedef void* (*SpecialCastFunction)(void*, SbkObjectType*);
typedef void* (*ObjectCopierFunction)(const void*);
-typedef SbkBaseWrapperType* (*TypeDiscoveryFunc)(void*, SbkBaseWrapperType*);
+typedef SbkObjectType* (*TypeDiscoveryFunc)(void*, SbkObjectType*);
typedef void* (*ExtendedToCppFunc)(PyObject*);
typedef bool (*ExtendedIsConvertibleFunc)(PyObject*);
@@ -72,10 +72,10 @@ typedef bool (*ExtendedIsConvertibleFunc)(PyObject*);
typedef void (*DeleteUserDataFunc)(void*);
extern LIBSHIBOKEN_API PyTypeObject SbkBaseWrapperType_Type;
-extern LIBSHIBOKEN_API SbkBaseWrapperType SbkBaseWrapper_Type;
+extern LIBSHIBOKEN_API SbkObjectType SbkBaseWrapper_Type;
/// PyTypeObject extended with C++ multiple inheritance information.
-struct LIBSHIBOKEN_API SbkBaseWrapperType
+struct LIBSHIBOKEN_API SbkObjectType
{
PyHeapTypeObject super;
int* mi_offsets;
@@ -146,7 +146,7 @@ inline bool isShibokenType(PyObject*& pyObj)
*/
inline bool isUserType(PyObject*& pyObj)
{
- return isShibokenType(pyObj) && reinterpret_cast<SbkBaseWrapperType*>(pyObj->ob_type)->is_user_type;
+ return isShibokenType(pyObj) && reinterpret_cast<SbkObjectType*>(pyObj->ob_type)->is_user_type;
}
/**
@@ -195,7 +195,7 @@ LIBSHIBOKEN_API void setErrorAboutWrongArguments(PyObject* args, const char* fun
namespace Wrapper {
-LIBSHIBOKEN_API PyObject* newObject(SbkBaseWrapperType* instanceType,
+LIBSHIBOKEN_API PyObject* newObject(SbkObjectType* instanceType,
void* cptr,
bool hasOwnership = true,
bool isExactType = false,
diff --git a/libshiboken/basewrapper_p.h b/libshiboken/basewrapper_p.h
index 6b8b9ab3..3e0757f2 100644
--- a/libshiboken/basewrapper_p.h
+++ b/libshiboken/basewrapper_p.h
@@ -28,7 +28,7 @@
#include <map>
struct SbkObject;
-struct SbkBaseWrapperType;
+struct SbkObjectType;
namespace Shiboken
{
@@ -97,7 +97,7 @@ class HierarchyVisitor
public:
HierarchyVisitor() : m_wasFinished(false) {}
virtual ~HierarchyVisitor() {}
- virtual void visit(SbkBaseWrapperType* node) = 0;
+ virtual void visit(SbkObjectType* node) = 0;
void finish() { m_wasFinished = true; };
bool wasFinished() const { return m_wasFinished; }
private:
@@ -109,7 +109,7 @@ class BaseCountVisitor : public HierarchyVisitor
public:
BaseCountVisitor() : m_count(0) {}
- void visit(SbkBaseWrapperType*)
+ void visit(SbkObjectType*)
{
m_count++;
}
@@ -124,21 +124,21 @@ class BaseAccumulatorVisitor : public HierarchyVisitor
public:
BaseAccumulatorVisitor() {}
- void visit(SbkBaseWrapperType* node)
+ void visit(SbkObjectType* node)
{
m_bases.push_back(node);
}
- std::list<SbkBaseWrapperType*> bases() const { return m_bases; }
+ std::list<SbkObjectType*> bases() const { return m_bases; }
private:
- std::list<SbkBaseWrapperType*> m_bases;
+ std::list<SbkObjectType*> m_bases;
};
class GetIndexVisitor : public HierarchyVisitor
{
public:
GetIndexVisitor(PyTypeObject* desiredType) : m_index(-1), m_desiredType(desiredType) {}
- virtual void visit(SbkBaseWrapperType* node)
+ virtual void visit(SbkObjectType* node)
{
m_index++;
if (PyType_IsSubtype(reinterpret_cast<PyTypeObject*>(node), m_desiredType))
@@ -155,7 +155,7 @@ class DtorCallerVisitor : public HierarchyVisitor
{
public:
DtorCallerVisitor(SbkObject* pyObj) : m_count(0), m_pyObj(pyObj) {}
- void visit(SbkBaseWrapperType* node);
+ void visit(SbkObjectType* node);
private:
int m_count;
SbkObject* m_pyObj;
@@ -183,7 +183,7 @@ inline int getNumberOfCppBaseClasses(PyTypeObject* baseType)
return visitor.count();
}
-inline std::list<SbkBaseWrapperType*> getCppBaseClasses(PyTypeObject* baseType)
+inline std::list<SbkObjectType*> getCppBaseClasses(PyTypeObject* baseType)
{
BaseAccumulatorVisitor visitor;
walkThroughClassHierarchy(baseType, &visitor);
diff --git a/libshiboken/bindingmanager.cpp b/libshiboken/bindingmanager.cpp
index 5e0cbf3d..183c0c05 100644
--- a/libshiboken/bindingmanager.cpp
+++ b/libshiboken/bindingmanager.cpp
@@ -37,8 +37,8 @@ typedef google::dense_hash_map<const void*, SbkObject*> WrapperMap;
class Graph
{
public:
- typedef std::list<SbkBaseWrapperType*> NodeList;
- typedef google::dense_hash_map<SbkBaseWrapperType*, NodeList> Edges;
+ typedef std::list<SbkObjectType*> NodeList;
+ typedef google::dense_hash_map<SbkObjectType*, NodeList> Edges;
Edges m_edges;
@@ -47,7 +47,7 @@ public:
m_edges.set_empty_key(0);
}
- void addEdge(SbkBaseWrapperType* from, SbkBaseWrapperType* to)
+ void addEdge(SbkObjectType* from, SbkObjectType* to)
{
m_edges[from].push_back(to);
}
@@ -61,7 +61,7 @@ public:
Edges::const_iterator i = m_edges.begin();
for (; i != m_edges.end(); ++i) {
- SbkBaseWrapperType* node1 = i->first;
+ SbkObjectType* node1 = i->first;
const NodeList& nodeList = i->second;
NodeList::const_iterator j = nodeList.begin();
for (; j != nodeList.end(); ++j)
@@ -71,14 +71,14 @@ public:
}
#endif
- SbkBaseWrapperType* identifyType(void* cptr, SbkBaseWrapperType* type, SbkBaseWrapperType* baseType) const
+ SbkObjectType* identifyType(void* cptr, SbkObjectType* type, SbkObjectType* baseType) const
{
Edges::const_iterator edgesIt = m_edges.find(type);
if (edgesIt != m_edges.end()) {
const NodeList& adjNodes = m_edges.find(type)->second;
NodeList::const_iterator i = adjNodes.begin();
for (; i != adjNodes.end(); ++i) {
- SbkBaseWrapperType* newType = identifyType(cptr, *i, baseType);
+ SbkObjectType* newType = identifyType(cptr, *i, baseType);
if (newType)
return newType;
}
@@ -164,7 +164,7 @@ bool BindingManager::hasWrapper(const void* cptr)
}
void BindingManager::registerWrapper(SbkObject* pyObj, void* cptr)
{
- SbkBaseWrapperType* instanceType = reinterpret_cast<SbkBaseWrapperType*>(pyObj->ob_type);
+ SbkObjectType* instanceType = reinterpret_cast<SbkObjectType*>(pyObj->ob_type);
if (instanceType->mi_init && !instanceType->mi_offsets)
instanceType->mi_offsets = instanceType->mi_init(cptr);
@@ -181,7 +181,7 @@ void BindingManager::registerWrapper(SbkObject* pyObj, void* cptr)
void BindingManager::releaseWrapper(SbkObject* sbkObj)
{
- SbkBaseWrapperType* sbkType = reinterpret_cast<SbkBaseWrapperType*>(sbkObj->ob_type);
+ SbkObjectType* sbkType = reinterpret_cast<SbkObjectType*>(sbkObj->ob_type);
int numBases = sbkType->is_multicpp ? getNumberOfCppBaseClasses(sbkObj->ob_type) : 1;
void** cptrs = reinterpret_cast<SbkObject*>(sbkObj)->d->cptr;
@@ -333,14 +333,14 @@ void BindingManager::transferOwnershipToCpp(SbkObject* wrapper)
invalidateWrapper(wrapper);
}
-void BindingManager::addClassInheritance(SbkBaseWrapperType* parent, SbkBaseWrapperType* child)
+void BindingManager::addClassInheritance(SbkObjectType* parent, SbkObjectType* child)
{
m_d->classHierarchy.addEdge(parent, child);
}
-SbkBaseWrapperType* BindingManager::resolveType(void* cptr, SbkBaseWrapperType* type)
+SbkObjectType* BindingManager::resolveType(void* cptr, SbkObjectType* type)
{
- SbkBaseWrapperType* identifiedType = m_d->classHierarchy.identifyType(cptr, type, type);
+ SbkObjectType* identifiedType = m_d->classHierarchy.identifyType(cptr, type, type);
return identifiedType ? identifiedType : type;
}
diff --git a/libshiboken/bindingmanager.h b/libshiboken/bindingmanager.h
index 8a6607fd..c1926e5e 100644
--- a/libshiboken/bindingmanager.h
+++ b/libshiboken/bindingmanager.h
@@ -28,7 +28,7 @@
#include "shibokenmacros.h"
struct SbkObject;
-struct SbkBaseWrapperType;
+struct SbkObjectType;
namespace Shiboken
{
@@ -56,8 +56,8 @@ public:
void transferOwnershipToCpp(SbkObject* wrapper);
/// Convenience method to call transferOwnershipToCpp with a properly cast SbkBaseWrapper.
void transferOwnershipToCpp(PyObject* wrapper);
- void addClassInheritance(SbkBaseWrapperType* parent, SbkBaseWrapperType* child);
- SbkBaseWrapperType* resolveType(void* cptr, SbkBaseWrapperType* type);
+ void addClassInheritance(SbkObjectType* parent, SbkObjectType* child);
+ SbkObjectType* resolveType(void* cptr, SbkObjectType* type);
/// Called by wrapper destructor
void destroyWrapper(const void* cptr);
diff --git a/libshiboken/conversions.h b/libshiboken/conversions.h
index a590ea19..dff14478 100644
--- a/libshiboken/conversions.h
+++ b/libshiboken/conversions.h
@@ -99,7 +99,7 @@ struct CppObjectCopier<T, true>
{
static inline T* copy(const T& obj)
{
- return reinterpret_cast<T*>(reinterpret_cast<SbkBaseWrapperType*>(SbkType<T>())->obj_copier(&obj));
+ return reinterpret_cast<T*>(reinterpret_cast<SbkObjectType*>(SbkType<T>())->obj_copier(&obj));
}
};
@@ -113,7 +113,7 @@ inline PyObject* createWrapper(const T* cppobj, bool hasOwnership = false, bool
const char* typeName = 0;
if (!isExactType)
typeName = typeid(*const_cast<T*>(cppobj)).name();
- return Wrapper::newObject(reinterpret_cast<SbkBaseWrapperType*>(SbkType<T>()),
+ return Wrapper::newObject(reinterpret_cast<SbkObjectType*>(SbkType<T>()),
const_cast<T*>(cppobj), hasOwnership, isExactType, typeName);
}
@@ -215,7 +215,7 @@ struct ValueTypeConverter
{
if (PyObject_TypeCheck(pyobj, SbkType<T>()))
return true;
- SbkBaseWrapperType* shiboType = reinterpret_cast<SbkBaseWrapperType*>(SbkType<T>());
+ SbkObjectType* shiboType = reinterpret_cast<SbkObjectType*>(SbkType<T>());
if (shiboType->ext_isconvertible)
return shiboType->ext_isconvertible(pyobj);
return false;
@@ -235,7 +235,7 @@ struct ValueTypeConverter
static inline T toCpp(PyObject* pyobj)
{
if (!PyObject_TypeCheck(pyobj, SbkType<T>())) {
- SbkBaseWrapperType* shiboType = reinterpret_cast<SbkBaseWrapperType*>(SbkType<T>());
+ SbkObjectType* shiboType = reinterpret_cast<SbkObjectType*>(SbkType<T>());
if (shiboType->ext_tocpp && isConvertible(pyobj)) {
T* cptr = reinterpret_cast<T*>(shiboType->ext_tocpp(pyobj));
std::auto_ptr<T> cptr_auto_ptr(cptr);
@@ -275,9 +275,9 @@ struct ObjectTypeConverter
{
if (pyobj == Py_None)
return 0;
- SbkBaseWrapperType* shiboType = reinterpret_cast<SbkBaseWrapperType*>(pyobj->ob_type);
+ SbkObjectType* shiboType = reinterpret_cast<SbkObjectType*>(pyobj->ob_type);
if (shiboType->mi_specialcast)
- return (T*) shiboType->mi_specialcast(Wrapper::cppPointer(pyobj, SbkType<T>()), reinterpret_cast<SbkBaseWrapperType*>(SbkType<T>()));
+ return (T*) shiboType->mi_specialcast(Wrapper::cppPointer(pyobj, SbkType<T>()), reinterpret_cast<SbkObjectType*>(SbkType<T>()));
return (T*) Wrapper::cppPointer(pyobj, SbkType<T>());
}
};
diff --git a/libshiboken/typeresolver.h b/libshiboken/typeresolver.h
index 4e23b970..bec99090 100644
--- a/libshiboken/typeresolver.h
+++ b/libshiboken/typeresolver.h
@@ -26,7 +26,7 @@
#include "shibokenmacros.h"
#include "conversions.h"
-class SbkBaseWrapperType;
+class SbkObjectType;
namespace Shiboken
{