aboutsummaryrefslogtreecommitdiffstats
path: root/cppgenerator.cpp
diff options
context:
space:
mode:
authorMarcelo Lira <marcelo.lira@openbossa.org>2010-03-02 11:34:11 -0300
committerMarcelo Lira <marcelo.lira@openbossa.org>2010-03-02 14:44:59 -0300
commitddc5bef058932584f5da644b606fad74707a63c7 (patch)
treec8b507a09031b17408eb25785fc7ab651e20c44d /cppgenerator.cpp
parentaeb0fe66f39b46ddb2e963067c91b426f9a013d0 (diff)
Generator now writes code to support extended conversions.
Removed "new_ctor_operator" test from black list.
Diffstat (limited to 'cppgenerator.cpp')
-rw-r--r--cppgenerator.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/cppgenerator.cpp b/cppgenerator.cpp
index 84e7e9e25..915d0ef79 100644
--- a/cppgenerator.cpp
+++ b/cppgenerator.cpp
@@ -2862,6 +2862,16 @@ void CppGenerator::finishGeneration()
s << "// Module initialization ";
s << "------------------------------------------------------------" << endl;
+ ExtendedConverterData extendedConverters = getExtendedConverters();
+ if (!extendedConverters.isEmpty())
+ s << "// Extended Converters" << endl;
+ foreach (const TypeEntry* externalType, extendedConverters.keys()) {
+ writeExtendedIsConvertibleFunction(s, externalType, extendedConverters[externalType]);
+ writeExtendedToCppFunction(s, externalType, extendedConverters[externalType]);
+ s << endl;
+ }
+ s << endl;
+
s << "extern \"C\" {" << endl << endl;
s << getApiExportMacro() << " PyMODINIT_FUNC" << endl << "init" << moduleName() << "()" << endl;
@@ -2892,6 +2902,16 @@ void CppGenerator::finishGeneration()
s << INDENT << "// Initialize classes in the type system" << endl;
s << classPythonDefines << endl;
+ if (!extendedConverters.isEmpty()) {
+ s << INDENT << "// Initialize extended Converters" << endl;
+ s << INDENT << "Shiboken::SbkBaseWrapperType* shiboType;" << endl << endl;
+ }
+ foreach (const TypeEntry* externalType, extendedConverters.keys()) {
+ writeExtendedConverterInitialization(s, externalType, extendedConverters[externalType]);
+ s << endl;
+ }
+ s << endl;
+
s << INDENT << "// Initialize namespaces as uninstantiable classes in the type system" << endl;
s << namespaceDefines << endl;