aboutsummaryrefslogtreecommitdiffstats
path: root/ApiExtractor
diff options
context:
space:
mode:
authorMatthew Woehlke <matthew.woehlke@kitware.com>2013-08-28 12:18:22 -0400
committerJohn Cummings <jcummings2@users.sf.net>2013-09-24 19:19:38 +0200
commit22aa9ced0d6b167ee835b4b184511c5df3f79591 (patch)
tree907354d65004a7c4434a5ae2b0b88deb6d530370 /ApiExtractor
parent8287ee801965f2fbeea573e1eb652cc851920f86 (diff)
Write inititializations in topological order
Add methods to various places in the hierarchy so that the generator can access the topologically ordered class list (in addition to the unordered class list). Modify CppGenerator::finishGeneration to use this. This fixes a failure to correctly create Python wrapper classes due to subclass wrappers being initialized before their base class (with the result that the looked-up type object for the base class is null, causing the derived class to be created without referencing the base). Also change one of the test cases to test that we correctly wrap a typedef of a template class derived from a non-template base (which was failing before this change for the aforementioned reason). Change-Id: Ib4dc2626a41cb7bb905ff4a302c2613ea12d026b Reviewed-by: John Cummings <jcummings2@users.sf.net>
Diffstat (limited to 'ApiExtractor')
-rw-r--r--ApiExtractor/apiextractor.cpp6
-rw-r--r--ApiExtractor/apiextractor.h1
2 files changed, 7 insertions, 0 deletions
diff --git a/ApiExtractor/apiextractor.cpp b/ApiExtractor/apiextractor.cpp
index 7a3a4a0d0..c3c9e4a22 100644
--- a/ApiExtractor/apiextractor.cpp
+++ b/ApiExtractor/apiextractor.cpp
@@ -141,6 +141,12 @@ AbstractMetaClassList ApiExtractor::classes() const
return m_builder->classes();
}
+AbstractMetaClassList ApiExtractor::classesTopologicalSorted() const
+{
+ Q_ASSERT(m_builder);
+ return m_builder->classesTopologicalSorted();
+}
+
PrimitiveTypeEntryList ApiExtractor::primitiveTypes() const
{
return TypeDatabase::instance()->primitiveTypes();
diff --git a/ApiExtractor/apiextractor.h b/ApiExtractor/apiextractor.h
index ba253274f..f43c2c591 100644
--- a/ApiExtractor/apiextractor.h
+++ b/ApiExtractor/apiextractor.h
@@ -55,6 +55,7 @@ public:
AbstractMetaEnumList globalEnums() const;
AbstractMetaFunctionList globalFunctions() const;
AbstractMetaClassList classes() const;
+ AbstractMetaClassList classesTopologicalSorted() const;
PrimitiveTypeEntryList primitiveTypes() const;
ContainerTypeEntryList containerTypes() const;
QSet<QString> qtMetaTypeDeclaredTypeNames() const;