summaryrefslogtreecommitdiffstats
path: root/libshiboken
diff options
context:
space:
mode:
authorHugo Parente Lima <hugo.pl@gmail.com>2011-10-17 20:06:04 -0200
committerMarcelo Lira <marcelo.lira@openbossa.org>2011-12-09 20:28:07 -0300
commitc392df67c0a668148294b0ac0a7c026d29da9112 (patch)
treec38ae3bc7190072e82e20950b21f269ba93a266c /libshiboken
parent1588c124fb818a6edd54491bcfbecebbb9b7869b (diff)
downloadshiboken-c392df67c0a668148294b0ac0a7c026d29da9112.tar.gz
shiboken-c392df67c0a668148294b0ac0a7c026d29da9112.tar.xz
shiboken-c392df67c0a668148294b0ac0a7c026d29da9112.zip
Added SBK_CONVERTER, a macro to get the type converter whatever the type, but primitive types.
Diffstat (limited to 'libshiboken')
-rw-r--r--libshiboken/basewrapper.cpp6
-rw-r--r--libshiboken/basewrapper.h3
-rw-r--r--libshiboken/sbkconverter.h4
3 files changed, 3 insertions, 10 deletions
diff --git a/libshiboken/basewrapper.cpp b/libshiboken/basewrapper.cpp
index fc83d44c..43ce1de8 100644
--- a/libshiboken/basewrapper.cpp
+++ b/libshiboken/basewrapper.cpp
@@ -727,12 +727,6 @@ void setTypeUserData(SbkObjectType* self, void* userData, DeleteUserDataFunc d_f
self->d->d_func = d_func;
}
-
-SbkConverter* getTypeConverter(SbkObjectType* type)
-{
- return type->d->converter;
-}
-
} // namespace ObjectType
diff --git a/libshiboken/basewrapper.h b/libshiboken/basewrapper.h
index c2539027..e9a94a36 100644
--- a/libshiboken/basewrapper.h
+++ b/libshiboken/basewrapper.h
@@ -210,9 +210,6 @@ LIBSHIBOKEN_API void setSubTypeInitHook(SbkObjectType* self, SubTypeInitH
LIBSHIBOKEN_API void* getTypeUserData(SbkObjectType* self);
LIBSHIBOKEN_API void setTypeUserData(SbkObjectType* self, void* userData, DeleteUserDataFunc d_func);
-/// Returns the converter assigned to the wrapper \p type.
-LIBSHIBOKEN_API SbkConverter* getTypeConverter(SbkObjectType* type);
-
}
namespace Object {
diff --git a/libshiboken/sbkconverter.h b/libshiboken/sbkconverter.h
index a91d14e6..0edd5abb 100644
--- a/libshiboken/sbkconverter.h
+++ b/libshiboken/sbkconverter.h
@@ -242,7 +242,6 @@ LIBSHIBOKEN_API bool checkDictTypes(PyTypeObject* keyType, PyTypeObject* valueTy
/// Returns true if a Python dictionary can be converted to a C++ hash or map.
LIBSHIBOKEN_API bool convertibleDictTypes(SbkConverter* keyConverter, bool keyCheckExact, SbkConverter* valueConverter, bool valueCheckExact, PyObject* pyIn);
-
#define SBK_PY_LONG_LONG_IDX 0
#define SBK_BOOL_IDX 1
#define SBK_CHAR_IDX 2
@@ -283,4 +282,7 @@ template<> inline SbkConverter* PrimitiveTypeConverter<void*>() { return primiti
} } // namespace Shiboken::Conversions
+struct _SbkGenericType { PyHeapTypeObject super; SbkConverter* converter; };
+#define SBK_CONVERTER(objType) (reinterpret_cast<_SbkGenericType*>(objType)->converter)
+
#endif // SBK_CONVERTER_H