summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHugo Parente Lima <hugo.pl@gmail.com>2010-12-01 21:16:40 -0200
committerHugo Parente Lima <hugo.pl@gmail.com>2010-12-02 17:26:02 -0200
commita5146ad246af19703671451451564e613e509463 (patch)
tree9b83014e1bac8a285ba555b5db8fbf1427edd426
parent4954a2e8c95df27168b65519a8b61ce30b8ab0d6 (diff)
downloadshiboken-a5146ad246af19703671451451564e613e509463.tar.gz
shiboken-a5146ad246af19703671451451564e613e509463.tar.xz
shiboken-a5146ad246af19703671451451564e613e509463.zip
Remove cpp object copier as it was used by anyone and nobody missed him.
Reviewer: Luciano Wolf <luciano.wolf@openbossa.org> Lauro Moura <lauro.neto@openbossa.org>
-rw-r--r--generator/cppgenerator.cpp16
-rw-r--r--generator/cppgenerator.h1
-rw-r--r--libshiboken/basewrapper.cpp12
-rw-r--r--libshiboken/basewrapper.h7
-rw-r--r--libshiboken/basewrapper_p.h1
5 files changed, 0 insertions, 37 deletions
diff --git a/generator/cppgenerator.cpp b/generator/cppgenerator.cpp
index 11135c82..199489dc 100644
--- a/generator/cppgenerator.cpp
+++ b/generator/cppgenerator.cpp
@@ -410,7 +410,6 @@ void CppGenerator::generateClass(QTextStream &s, const AbstractMetaClass *metaCl
if (!metaClass->typeEntry()->hashFunction().isEmpty())
writeHashFunction(s, metaClass);
- writeObjCopierFunction(s, metaClass);
writeClassDefinition(s, metaClass);
s << endl;
@@ -3265,10 +3264,6 @@ void CppGenerator::writeClassRegister(QTextStream& s, const AbstractMetaClass* m
s << INDENT << "Shiboken::ObjectType::setDestructorFunction(&" << cpythonTypeName(metaClass) << ", &Shiboken::callCppDestructor<" << dtorClassName << " >);" << endl;
}
- // Fill copy function
- if (metaClass->typeEntry()->isValue() && shouldGenerateCppWrapper(metaClass))
- s << INDENT << "Shiboken::ObjectType::setCopyFunction(&" << cpythonTypeName(metaClass) << ", &" << cpythonBaseName(metaClass) + "_ObjCopierFunc);" << endl;
-
s << INDENT << "if (PyType_Ready((PyTypeObject*)&" << pyTypeName << ") < 0)" << endl;
s << INDENT << INDENT << "return;" << endl << endl;
@@ -3869,17 +3864,6 @@ void CppGenerator::writeHashFunction(QTextStream& s, const AbstractMetaClass* me
s << '}' << endl << endl;
}
-void CppGenerator::writeObjCopierFunction(QTextStream& s, const AbstractMetaClass* metaClass)
-{
- if (!(metaClass->typeEntry()->isValue() && shouldGenerateCppWrapper(metaClass)))
- return;
- s << "static void* " << cpythonBaseName(metaClass) << "_ObjCopierFunc(const void* ptr)";
- s << '{' << endl;
- s << INDENT << "return new " << wrapperName(metaClass) << "(*reinterpret_cast<const " << metaClass->qualifiedCppName() << "*>(ptr));\n";
- s << '}' << endl << endl;
-
-}
-
void CppGenerator::writeStdListWrapperMethods(QTextStream& s, const AbstractMetaClass* metaClass)
{
//len
diff --git a/generator/cppgenerator.h b/generator/cppgenerator.h
index 4374eb5e..6e064dd4 100644
--- a/generator/cppgenerator.h
+++ b/generator/cppgenerator.h
@@ -187,7 +187,6 @@ private:
bool shouldGenerateGetSetList(const AbstractMetaClass* metaClass);
void writeHashFunction(QTextStream& s, const AbstractMetaClass* metaClass);
- void writeObjCopierFunction(QTextStream& s, const AbstractMetaClass* metaClass);
// Write default implementations for sequence protocol
void writeStdListWrapperMethods(QTextStream& s, const AbstractMetaClass* metaClass);
diff --git a/libshiboken/basewrapper.cpp b/libshiboken/basewrapper.cpp
index eb01116c..09c47bda 100644
--- a/libshiboken/basewrapper.cpp
+++ b/libshiboken/basewrapper.cpp
@@ -218,7 +218,6 @@ PyObject* SbkObjectTypeTpNew(PyTypeObject* metatype, PyObject* args, PyObject* k
d->ext_isconvertible = parentType->ext_isconvertible;
d->ext_tocpp = parentType->ext_tocpp;
d->type_discovery = parentType->type_discovery;
- d->obj_copier = parentType->obj_copier;
d->cpp_dtor = parentType->cpp_dtor;
d->is_multicpp = 0;
} else {
@@ -228,7 +227,6 @@ PyObject* SbkObjectTypeTpNew(PyTypeObject* metatype, PyObject* args, PyObject* k
d->ext_isconvertible = 0;
d->ext_tocpp = 0;
d->type_discovery = 0;
- d->obj_copier = 0;
d->cpp_dtor = 0;
d->is_multicpp = 1;
}
@@ -460,16 +458,6 @@ bool canCallConstructor(PyTypeObject* myType, PyTypeObject* ctorType)
return true;
}
-void* copy(SbkObjectType* self, const void* obj)
-{
- return self->d->obj_copier(obj);
-}
-
-void setCopyFunction(SbkObjectType* self, ObjectCopierFunction func)
-{
- self->d->obj_copier = func;
-}
-
bool hasExternalCppConversions(SbkObjectType* self)
{
return self->d->ext_tocpp;
diff --git a/libshiboken/basewrapper.h b/libshiboken/basewrapper.h
index 1ddd40af..0f836079 100644
--- a/libshiboken/basewrapper.h
+++ b/libshiboken/basewrapper.h
@@ -62,7 +62,6 @@ typedef int* (*MultipleInheritanceInitFunction)(const void*);
* The implementation of this function is auto generated by the generator and you don't need to care about it.
*/
typedef void* (*SpecialCastFunction)(void*, SbkObjectType*);
-typedef void* (*ObjectCopierFunction)(const void*);
typedef SbkObjectType* (*TypeDiscoveryFunc)(void*, SbkObjectType*);
typedef void* (*ExtendedToCppFunc)(PyObject*);
@@ -126,12 +125,6 @@ LIBSHIBOKEN_API bool isUserType(PyTypeObject* pyObj);
*/
LIBSHIBOKEN_API bool canCallConstructor(PyTypeObject* myType, PyTypeObject* ctorType);
-/**
- * Call copy function for the object type
- **/
-LIBSHIBOKEN_API void* copy(SbkObjectType* self, const void* obj);
-LIBSHIBOKEN_API void setCopyFunction(SbkObjectType* self, ObjectCopierFunction func);
-
LIBSHIBOKEN_API void setExternalCppConversionFunction(SbkObjectType* self, ExtendedToCppFunc func);
LIBSHIBOKEN_API void setExternalIsConvertibleFunction(SbkObjectType* self, ExtendedIsConvertibleFunc func);
LIBSHIBOKEN_API bool hasExternalCppConversions(SbkObjectType* self);
diff --git a/libshiboken/basewrapper_p.h b/libshiboken/basewrapper_p.h
index b90aaa45..05208848 100644
--- a/libshiboken/basewrapper_p.h
+++ b/libshiboken/basewrapper_p.h
@@ -89,7 +89,6 @@ struct SbkObjectTypePrivate
/// Special cast function, null if this class doesn't have multiple inheritance.
SpecialCastFunction mi_specialcast;
TypeDiscoveryFunc type_discovery;
- ObjectCopierFunction obj_copier;
/// Extended "isConvertible" function to be used when a conversion operator is defined in another module.
ExtendedIsConvertibleFunc ext_isconvertible;
/// Extended "toCpp" function to be used when a conversion operator is defined in another module.