aboutsummaryrefslogtreecommitdiffstats
path: root/libshiboken/conversions.h
diff options
context:
space:
mode:
authorHugo Parente Lima <hugo.pl@gmail.com>2010-12-01 14:27:39 -0200
committerHugo Parente Lima <hugo.pl@gmail.com>2012-03-08 16:12:07 -0300
commit3cfac85d50b8f891a8230513a4b5a0f6aea67b3e (patch)
tree546bff5ad1910b6bdb0d54becc950a9bf8f218d1 /libshiboken/conversions.h
parent96488c9cfd16c6ef9800c678c83d271343c2a813 (diff)
Remove SbkTypeInfo and CppObjectCopier structs, they aren't needed after the fix on qt_metacall.
Diffstat (limited to 'libshiboken/conversions.h')
-rw-r--r--libshiboken/conversions.h37
1 files changed, 1 insertions, 36 deletions
diff --git a/libshiboken/conversions.h b/libshiboken/conversions.h
index ed7dcc017..8b312dfe1 100644
--- a/libshiboken/conversions.h
+++ b/libshiboken/conversions.h
@@ -69,41 +69,6 @@ template<> inline PyTypeObject* SbkType<char>() { return &PyInt_Type; }
template<> inline PyTypeObject* SbkType<signed char>() { return &PyInt_Type; }
template<> inline PyTypeObject* SbkType<unsigned char>() { return &PyInt_Type; }
-template<typename T>
-struct SbkTypeInfo {
- static const bool isCppWrapper = false;
-};
-
-/**
- * This struct template is used to copy a C++ object using the proper
- * constructor, which could be the same type as used on the wrapped library
- * or a C++ wrapper type provided by the binding.
- */
-template <typename T, bool hasWrapper = SbkTypeInfo<T>::isCppWrapper>
-struct CppObjectCopier
-{
- static inline T* copy(const T& obj);
-};
-
-template<typename T>
-struct CppObjectCopier<T, false>
-{
- static inline T* copy(const T& obj)
- {
- return new T(obj);
- }
-};
-
-template<typename T>
-struct CppObjectCopier<T, true>
-{
- static inline T* copy(const T& obj)
- {
- return reinterpret_cast<T*>(ObjectType::copy(reinterpret_cast<SbkObjectType*>(SbkType<T>()), &obj));
- }
-};
-
-
/**
* Convenience template to create wrappers using the proper Python type for a given C++ class instance.
*/
@@ -152,7 +117,7 @@ struct Converter<T*>
if (PyObject_TypeCheck(pyobj, SbkType<T>()))
return (T*) Object::cppPointer(reinterpret_cast<SbkObject*>(pyobj), SbkType<T>());
else if (Converter<T>::isConvertible(pyobj))
- return CppObjectCopier<T>::copy(Converter<T>::toCpp(pyobj));
+ return new T(Converter<T>::toCpp(pyobj));
else if (pyobj == Py_None)
return 0;