From 665d9bd5ee341614c22dacf487c840b09b123c6b Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Thu, 10 Nov 2022 13:10:41 +0100 Subject: shiboken6: Reorder headers containing typedefs - Split out Modifications/CustomConversions-related typedefs to separate headers customconversion_typedefs.h, modifications_typedefs.h - Move forward declarations of TypeEntries from typedatabase_typedefs.h to typesystem_typedefs.h - Rename TypeEntries to TypeEntryCList and add "C" to other lists containing const pointers following the shiboken convention. Change-Id: Ic31872405778d794d85694386990b50edf42beec Reviewed-by: Qt CI Bot Reviewed-by: Christian Tismer (cherry picked from commit 4ac568f20ed5821e34f3c98b7eeea1077f560f6b) Reviewed-by: Cristian Maureira-Fredes --- .../shiboken6/ApiExtractor/abstractmetabuilder.cpp | 24 +++++++-------- .../shiboken6/ApiExtractor/abstractmetabuilder_p.h | 16 +++++----- sources/shiboken6/ApiExtractor/abstractmetafield.h | 1 + .../shiboken6/ApiExtractor/abstractmetafunction.h | 1 + .../shiboken6/ApiExtractor/abstractmetalang.cpp | 6 ++-- sources/shiboken6/ApiExtractor/abstractmetalang.h | 4 +-- sources/shiboken6/ApiExtractor/apiextractor.cpp | 4 +-- sources/shiboken6/ApiExtractor/complextypeentry.h | 2 +- .../shiboken6/ApiExtractor/containertypeentry.h | 1 + sources/shiboken6/ApiExtractor/customconversion.h | 1 + .../ApiExtractor/customconversion_typedefs.h | 13 ++++++++ sources/shiboken6/ApiExtractor/docparser.h | 2 +- sources/shiboken6/ApiExtractor/messages.cpp | 4 +-- sources/shiboken6/ApiExtractor/messages.h | 5 ++-- sources/shiboken6/ApiExtractor/modifications.h | 2 +- .../ApiExtractor/modifications_typedefs.h | 24 +++++++++++++++ .../shiboken6/ApiExtractor/primitivetypeentry.h | 2 +- sources/shiboken6/ApiExtractor/typedatabase.cpp | 20 ++++++------- sources/shiboken6/ApiExtractor/typedatabase.h | 23 ++++---------- .../shiboken6/ApiExtractor/typedatabase_typedefs.h | 17 ++--------- .../shiboken6/ApiExtractor/typesystem_typedefs.h | 35 ++++++++++++---------- sources/shiboken6/ApiExtractor/valuetypeentry.h | 1 + sources/shiboken6/generator/generator.cpp | 4 +-- sources/shiboken6/generator/generator.h | 4 +-- sources/shiboken6/generator/qtdoc/qtdocgenerator.h | 2 +- .../shiboken6/generator/shiboken/cppgenerator.cpp | 2 +- .../shiboken6/generator/shiboken/cppgenerator.h | 2 +- .../generator/shiboken/headergenerator.cpp | 6 ++-- .../generator/shiboken/shibokengenerator.cpp | 2 +- .../generator/shiboken/shibokengenerator.h | 1 + 30 files changed, 127 insertions(+), 104 deletions(-) create mode 100644 sources/shiboken6/ApiExtractor/customconversion_typedefs.h create mode 100644 sources/shiboken6/ApiExtractor/modifications_typedefs.h diff --git a/sources/shiboken6/ApiExtractor/abstractmetabuilder.cpp b/sources/shiboken6/ApiExtractor/abstractmetabuilder.cpp index f87ba105a..6ceb9ad3a 100644 --- a/sources/shiboken6/ApiExtractor/abstractmetabuilder.cpp +++ b/sources/shiboken6/ApiExtractor/abstractmetabuilder.cpp @@ -1090,7 +1090,7 @@ AbstractMetaClass *AbstractMetaBuilderPrivate::traverseClass(const FileModelItem } TemplateParameterList template_parameters = classItem->templateParameters(); - TypeEntries template_args; + TypeEntryCList template_args; template_args.clear(); auto argumentParent = metaClass->typeEntry()->typeSystemTypeEntry(); for (int i = 0; i < template_parameters.size(); ++i) { @@ -2195,10 +2195,10 @@ static const TypeEntry *findTypeEntryUsingContext(const AbstractMetaClass *metaC } // Helper for findTypeEntries/translateTypeStatic() -TypeEntries AbstractMetaBuilderPrivate::findTypeEntriesHelper(const QString &qualifiedName, - const QString &name, - const AbstractMetaClass *currentClass, - AbstractMetaBuilderPrivate *d) +TypeEntryCList AbstractMetaBuilderPrivate::findTypeEntriesHelper(const QString &qualifiedName, + const QString &name, + const AbstractMetaClass *currentClass, + AbstractMetaBuilderPrivate *d) { // 5.1 - Try first using the current scope if (currentClass) { @@ -2242,13 +2242,13 @@ TypeEntries AbstractMetaBuilderPrivate::findTypeEntriesHelper(const QString &qua // Helper for translateTypeStatic() that calls findTypeEntriesHelper() // and does some error checking. -TypeEntries AbstractMetaBuilderPrivate::findTypeEntries(const QString &qualifiedName, - const QString &name, - const AbstractMetaClass *currentClass, - AbstractMetaBuilderPrivate *d, - QString *errorMessage) +TypeEntryCList AbstractMetaBuilderPrivate::findTypeEntries(const QString &qualifiedName, + const QString &name, + const AbstractMetaClass *currentClass, + AbstractMetaBuilderPrivate *d, + QString *errorMessage) { - TypeEntries types = findTypeEntriesHelper(qualifiedName, name, currentClass, d); + TypeEntryCList types = findTypeEntriesHelper(qualifiedName, name, currentClass, d); if (types.isEmpty()) { if (errorMessage != nullptr) *errorMessage = msgCannotFindTypeEntry(qualifiedName); @@ -2626,7 +2626,7 @@ std::optional typeInfo.clearInstantiations(); } - const TypeEntries types = findTypeEntries(qualifiedName, name, currentClass, d, errorMessageIn); + const TypeEntryCList types = findTypeEntries(qualifiedName, name, currentClass, d, errorMessageIn); if (types.isEmpty()) { if (errorMessageIn != nullptr) *errorMessageIn = msgUnableToTranslateType(_typei, *errorMessageIn); diff --git a/sources/shiboken6/ApiExtractor/abstractmetabuilder_p.h b/sources/shiboken6/ApiExtractor/abstractmetabuilder_p.h index 33047a82a..3593094f8 100644 --- a/sources/shiboken6/ApiExtractor/abstractmetabuilder_p.h +++ b/sources/shiboken6/ApiExtractor/abstractmetabuilder_p.h @@ -11,6 +11,8 @@ #include "abstractmetatype.h" #include "include.h" #include "typeparser.h" +#include "modifications_typedefs.h" +#include "typesystem_typedefs.h" #include #include @@ -144,13 +146,13 @@ public: translateTypeStatic(const TypeInfo &type, const AbstractMetaClass *current, AbstractMetaBuilderPrivate *d = nullptr, TranslateTypeFlags flags = {}, QString *errorMessageIn = nullptr); - static TypeEntries findTypeEntriesHelper(const QString &qualifiedName, const QString &name, - const AbstractMetaClass *currentClass = nullptr, - AbstractMetaBuilderPrivate *d = nullptr); - static TypeEntries findTypeEntries(const QString &qualifiedName, const QString &name, - const AbstractMetaClass *currentClass = nullptr, - AbstractMetaBuilderPrivate *d = nullptr, - QString *errorMessage = nullptr); + static TypeEntryCList findTypeEntriesHelper(const QString &qualifiedName, const QString &name, + const AbstractMetaClass *currentClass = nullptr, + AbstractMetaBuilderPrivate *d = nullptr); + static TypeEntryCList findTypeEntries(const QString &qualifiedName, const QString &name, + const AbstractMetaClass *currentClass = nullptr, + AbstractMetaBuilderPrivate *d = nullptr, + QString *errorMessage = nullptr); qint64 findOutValueFromString(const QString &stringValue, bool &ok); diff --git a/sources/shiboken6/ApiExtractor/abstractmetafield.h b/sources/shiboken6/ApiExtractor/abstractmetafield.h index 7e832d4e2..7de1298f3 100644 --- a/sources/shiboken6/ApiExtractor/abstractmetafield.h +++ b/sources/shiboken6/ApiExtractor/abstractmetafield.h @@ -7,6 +7,7 @@ #include "abstractmetalang_typedefs.h" #include "parser/codemodel_enums.h" #include "typesystem_enums.h" +#include "modifications_typedefs.h" #include "typesystem_typedefs.h" #include "enclosingclassmixin.h" diff --git a/sources/shiboken6/ApiExtractor/abstractmetafunction.h b/sources/shiboken6/ApiExtractor/abstractmetafunction.h index 9613db92a..888d52b66 100644 --- a/sources/shiboken6/ApiExtractor/abstractmetafunction.h +++ b/sources/shiboken6/ApiExtractor/abstractmetafunction.h @@ -7,6 +7,7 @@ #include "abstractmetalang_enums.h" #include "abstractmetalang_typedefs.h" #include "typesystem_enums.h" +#include "modifications_typedefs.h" #include "typesystem_typedefs.h" #include "parser/codemodel_enums.h" diff --git a/sources/shiboken6/ApiExtractor/abstractmetalang.cpp b/sources/shiboken6/ApiExtractor/abstractmetalang.cpp index 531f7e65a..064b1fe5c 100644 --- a/sources/shiboken6/ApiExtractor/abstractmetalang.cpp +++ b/sources/shiboken6/ApiExtractor/abstractmetalang.cpp @@ -111,7 +111,7 @@ public: AbstractMetaFunctionCList m_externalConversionOperators; QStringList m_baseClassNames; // Base class names from C++, including rejected - TypeEntries m_templateArgs; + TypeEntryCList m_templateArgs; ComplexTypeEntry *m_typeEntry = nullptr; SourceLocation m_sourceLocation; UsingMembers m_usingMembers; @@ -601,12 +601,12 @@ bool AbstractMetaClass::hasProtectedFields() const return false; } -const TypeEntries &AbstractMetaClass::templateArguments() const +const TypeEntryCList &AbstractMetaClass::templateArguments() const { return d->m_templateArgs; } -void AbstractMetaClass::setTemplateArguments(const TypeEntries &args) +void AbstractMetaClass::setTemplateArguments(const TypeEntryCList &args) { d->m_templateArgs = args; } diff --git a/sources/shiboken6/ApiExtractor/abstractmetalang.h b/sources/shiboken6/ApiExtractor/abstractmetalang.h index 9b10585e2..a8fc186ab 100644 --- a/sources/shiboken6/ApiExtractor/abstractmetalang.h +++ b/sources/shiboken6/ApiExtractor/abstractmetalang.h @@ -241,8 +241,8 @@ public: bool hasProtectedFields() const; - const TypeEntries &templateArguments() const; - void setTemplateArguments(const TypeEntries &); + const TypeEntryCList &templateArguments() const; + void setTemplateArguments(const TypeEntryCList &); // only valid during metabuilder's run const QStringList &baseClassNames() const; diff --git a/sources/shiboken6/ApiExtractor/apiextractor.cpp b/sources/shiboken6/ApiExtractor/apiextractor.cpp index 9899a9bf8..3545f5c37 100644 --- a/sources/shiboken6/ApiExtractor/apiextractor.cpp +++ b/sources/shiboken6/ApiExtractor/apiextractor.cpp @@ -630,10 +630,10 @@ void ApiExtractorPrivate::collectContainerTypesFromSnippets(InstantiationCollect { QStringList snips; auto *td = TypeDatabase::instance(); - const PrimitiveTypeEntryList &primitiveTypeList = td->primitiveTypes(); + const PrimitiveTypeEntryCList &primitiveTypeList = td->primitiveTypes(); for (const PrimitiveTypeEntry *type : primitiveTypeList) getCode(snips, type); - const ContainerTypeEntryList &containerTypeList = td->containerTypes(); + const ContainerTypeEntryCList &containerTypeList = td->containerTypes(); for (const ContainerTypeEntry *type : containerTypeList) getCode(snips, type); for (auto metaClass : m_builder->classes()) diff --git a/sources/shiboken6/ApiExtractor/complextypeentry.h b/sources/shiboken6/ApiExtractor/complextypeentry.h index d21ec3ab8..9e46634bc 100644 --- a/sources/shiboken6/ApiExtractor/complextypeentry.h +++ b/sources/shiboken6/ApiExtractor/complextypeentry.h @@ -6,7 +6,7 @@ #include "typesystem.h" #include "typesystem_enums.h" -#include "typesystem_typedefs.h" +#include "modifications_typedefs.h" #include "pymethoddefentry.h" #include diff --git a/sources/shiboken6/ApiExtractor/containertypeentry.h b/sources/shiboken6/ApiExtractor/containertypeentry.h index 50c3c91c9..b8b01cf68 100644 --- a/sources/shiboken6/ApiExtractor/containertypeentry.h +++ b/sources/shiboken6/ApiExtractor/containertypeentry.h @@ -5,6 +5,7 @@ #define CONTAINERTYPEENTRY_H #include "complextypeentry.h" +#include "customconversion_typedefs.h" class ContainerTypeEntryPrivate; diff --git a/sources/shiboken6/ApiExtractor/customconversion.h b/sources/shiboken6/ApiExtractor/customconversion.h index 3968eb0f8..ed085bdce 100644 --- a/sources/shiboken6/ApiExtractor/customconversion.h +++ b/sources/shiboken6/ApiExtractor/customconversion.h @@ -4,6 +4,7 @@ #ifndef CUSTOMCONVERSION_H #define CUSTOMCONVERSION_H +#include "customconversion_typedefs.h" #include "typesystem_typedefs.h" #include diff --git a/sources/shiboken6/ApiExtractor/customconversion_typedefs.h b/sources/shiboken6/ApiExtractor/customconversion_typedefs.h new file mode 100644 index 000000000..a928378b7 --- /dev/null +++ b/sources/shiboken6/ApiExtractor/customconversion_typedefs.h @@ -0,0 +1,13 @@ +// Copyright (C) 2022 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + +#ifndef CUSTOMCONVERSION_TYPEDEFS_H +#define CUSTOMCONVERSION_TYPEDEFS_H + +#include +#include + +class CustomConversion; +using CustomConversionPtr = QSharedPointer; + +#endif // CUSTOMCONVERSION_TYPEDEFS_H diff --git a/sources/shiboken6/ApiExtractor/docparser.h b/sources/shiboken6/ApiExtractor/docparser.h index 1dc420c3c..88643b7bf 100644 --- a/sources/shiboken6/ApiExtractor/docparser.h +++ b/sources/shiboken6/ApiExtractor/docparser.h @@ -3,8 +3,8 @@ #ifndef DOCPARSER_H #define DOCPARSER_H -#include "typesystem_typedefs.h" #include "abstractmetalang_typedefs.h" +#include "modifications_typedefs.h" #include #include diff --git a/sources/shiboken6/ApiExtractor/messages.cpp b/sources/shiboken6/ApiExtractor/messages.cpp index caa4606db..3da27bfa2 100644 --- a/sources/shiboken6/ApiExtractor/messages.cpp +++ b/sources/shiboken6/ApiExtractor/messages.cpp @@ -255,7 +255,7 @@ QString msgNamespaceNoTypeEntry(const NamespaceModelItem &item, return result; } -QString msgAmbiguousVaryingTypesFound(const QString &qualifiedName, const TypeEntries &te) +QString msgAmbiguousVaryingTypesFound(const QString &qualifiedName, const TypeEntryCList &te) { QString result = u"Ambiguous types of varying types found for \""_s + qualifiedName + u"\": "_s; @@ -263,7 +263,7 @@ QString msgAmbiguousVaryingTypesFound(const QString &qualifiedName, const TypeEn return result; } -QString msgAmbiguousTypesFound(const QString &qualifiedName, const TypeEntries &te) +QString msgAmbiguousTypesFound(const QString &qualifiedName, const TypeEntryCList &te) { QString result = u"Ambiguous types found for \""_s + qualifiedName + u"\": "_s; diff --git a/sources/shiboken6/ApiExtractor/messages.h b/sources/shiboken6/ApiExtractor/messages.h index d5320fc3c..dcdae69cb 100644 --- a/sources/shiboken6/ApiExtractor/messages.h +++ b/sources/shiboken6/ApiExtractor/messages.h @@ -6,6 +6,7 @@ #include "abstractmetalang_typedefs.h" #include "parser/codemodel_fwd.h" +#include "modifications_typedefs.h" #include "typesystem_typedefs.h" #include @@ -67,8 +68,8 @@ QString msgNoEnumTypeConflict(const EnumModelItem &enumItem, QString msgNamespaceNoTypeEntry(const NamespaceModelItem &item, const QString &fullName); -QString msgAmbiguousVaryingTypesFound(const QString &qualifiedName, const TypeEntries &te); -QString msgAmbiguousTypesFound(const QString &qualifiedName, const TypeEntries &te); +QString msgAmbiguousVaryingTypesFound(const QString &qualifiedName, const TypeEntryCList &te); +QString msgAmbiguousTypesFound(const QString &qualifiedName, const TypeEntryCList &te); QString msgUnmatchedParameterType(const ArgumentModelItem &arg, int n, const QString &why); diff --git a/sources/shiboken6/ApiExtractor/modifications.h b/sources/shiboken6/ApiExtractor/modifications.h index c49966cc2..65ed81ff8 100644 --- a/sources/shiboken6/ApiExtractor/modifications.h +++ b/sources/shiboken6/ApiExtractor/modifications.h @@ -5,7 +5,7 @@ #define MODIFICATIONS_H #include "typesystem_enums.h" -#include "typesystem_typedefs.h" +#include "modifications_typedefs.h" #include #include diff --git a/sources/shiboken6/ApiExtractor/modifications_typedefs.h b/sources/shiboken6/ApiExtractor/modifications_typedefs.h new file mode 100644 index 000000000..c827335ab --- /dev/null +++ b/sources/shiboken6/ApiExtractor/modifications_typedefs.h @@ -0,0 +1,24 @@ +// Copyright (C) 2022 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + +#ifndef MODIFICATIONS_TYPEDEFS_H +#define MODIFICATIONS_TYPEDEFS_H + +#include +#include + +class CodeSnip; +class DocModification; + +struct AddedFunction; +class FieldModification; +class FunctionModification; + +using AddedFunctionPtr = QSharedPointer; +using AddedFunctionList = QList; +using CodeSnipList = QList; +using DocModificationList = QList; +using FieldModificationList = QList; +using FunctionModificationList = QList; + +#endif // MODIFICATIONS_TYPEDEFS_H diff --git a/sources/shiboken6/ApiExtractor/primitivetypeentry.h b/sources/shiboken6/ApiExtractor/primitivetypeentry.h index 13b60f1ca..f9864eb66 100644 --- a/sources/shiboken6/ApiExtractor/primitivetypeentry.h +++ b/sources/shiboken6/ApiExtractor/primitivetypeentry.h @@ -5,7 +5,7 @@ #define PRIMITIVETYPEENTRY_H #include "typesystem.h" -#include "typesystem_typedefs.h" +#include "customconversion_typedefs.h" class PrimitiveTypeEntryPrivate; diff --git a/sources/shiboken6/ApiExtractor/typedatabase.cpp b/sources/shiboken6/ApiExtractor/typedatabase.cpp index 359aab6b6..34a225c14 100644 --- a/sources/shiboken6/ApiExtractor/typedatabase.cpp +++ b/sources/shiboken6/ApiExtractor/typedatabase.cpp @@ -104,7 +104,7 @@ struct TypeDatabasePrivate { const TypeSystemTypeEntry *defaultTypeSystemType() const; TypeEntry *findType(const QString &name) const; - TypeEntries findCppTypes(const QString &name) const; + TypeEntryCList findCppTypes(const QString &name) const; bool addType(TypeEntry *e, QString *errorMessage = nullptr); bool parseFile(QIODevice *device, TypeDatabase *db, bool generate = true); static bool parseFile(const TypeDatabaseParserContextPtr &context, @@ -130,7 +130,7 @@ struct TypeDatabasePrivate void addBuiltInContainerTypes(const TypeDatabaseParserContextPtr &context); TypeEntryMultiMapConstIteratorRange findTypeRange(const QString &name) const; template - TypeEntries findTypesHelper(const QString &name, Predicate pred) const; + TypeEntryCList findTypesHelper(const QString &name, Predicate pred) const; template QList findTypesByTypeHelper(Predicate pred) const; TypeEntry *resolveTypeDefEntry(TypedefEntry *typedefEntry, QString *errorMessage); @@ -442,9 +442,9 @@ TypeEntry *TypeDatabasePrivate::findType(const QString &name) const } template -TypeEntries TypeDatabasePrivate::findTypesHelper(const QString &name, Predicate pred) const +TypeEntryCList TypeDatabasePrivate::findTypesHelper(const QString &name, Predicate pred) const { - TypeEntries result; + TypeEntryCList result; const auto entries = findTypeRange(name); for (TypeEntry *entry : entries) { if (pred(entry)) @@ -464,7 +464,7 @@ QList TypeDatabasePrivate::findTypesByTypeHelper(Predicate pred) c return result; } -TypeEntries TypeDatabase::findTypes(const QString &name) const +TypeEntryCList TypeDatabase::findTypes(const QString &name) const { return d->findTypesHelper(name, useType); } @@ -493,12 +493,12 @@ static bool useCppType(const TypeEntry *t) return result; } -TypeEntries TypeDatabase::findCppTypes(const QString &name) const +TypeEntryCList TypeDatabase::findCppTypes(const QString &name) const { return d->findCppTypes(name); } -TypeEntries TypeDatabasePrivate::findCppTypes(const QString &name) const +TypeEntryCList TypeDatabasePrivate::findCppTypes(const QString &name) const { return findTypesHelper(name, useCppType); } @@ -519,13 +519,13 @@ TypeEntryMultiMapConstIteratorRange TypeDatabasePrivate::findTypeRange(const QSt return {range.first, range.second}; } -PrimitiveTypeEntryList TypeDatabase::primitiveTypes() const +PrimitiveTypeEntryCList TypeDatabase::primitiveTypes() const { auto pred = [](const TypeEntry *t) { return t->isPrimitive(); }; return d->findTypesByTypeHelper(pred); } -ContainerTypeEntryList TypeDatabase::containerTypes() const +ContainerTypeEntryCList TypeDatabase::containerTypes() const { auto pred = [](const TypeEntry *t) { return t->isContainer(); }; return d->findTypesByTypeHelper(pred); @@ -1333,7 +1333,7 @@ QDebug operator<<(QDebug debug, const formatPrimitiveEntry &fe) struct PrimitiveFormatListEntry { const PrimitiveTypeEntry *baseType; - PrimitiveTypeEntryList typedefs; + PrimitiveTypeEntryCList typedefs; }; static bool operator<(const PrimitiveFormatListEntry &e1, const PrimitiveFormatListEntry &e2) diff --git a/sources/shiboken6/ApiExtractor/typedatabase.h b/sources/shiboken6/ApiExtractor/typedatabase.h index 2cf0070a1..2c2914e43 100644 --- a/sources/shiboken6/ApiExtractor/typedatabase.h +++ b/sources/shiboken6/ApiExtractor/typedatabase.h @@ -5,8 +5,8 @@ #define TYPEDATABASE_H #include "include.h" +#include "modifications_typedefs.h" #include "typedatabase_typedefs.h" -#include "typesystem_typedefs.h" #include #include @@ -15,15 +15,6 @@ QT_FORWARD_DECLARE_CLASS(QIODevice) -class ComplexTypeEntry; -class ContainerTypeEntry; -class FlagsTypeEntry; -class FunctionTypeEntry; -class NamespaceTypeEntry; -class ObjectTypeEntry; -class TemplateEntry; -class TypeEntry; - struct TypeDatabasePrivate; struct TypeDatabaseParserContext; @@ -31,10 +22,6 @@ QT_FORWARD_DECLARE_CLASS(QDebug) int getMaxTypeIndex(); -class ContainerTypeEntry; -class PrimitiveTypeEntry; -class TypeSystemTypeEntry; - struct VersionRange { bool isNull() const @@ -113,15 +100,15 @@ public: QString defaultPackageName() const; TypeEntry *findType(const QString &name) const; - TypeEntries findTypes(const QString &name) const; - TypeEntries findCppTypes(const QString &name) const; + TypeEntryCList findTypes(const QString &name) const; + TypeEntryCList findCppTypes(const QString &name) const; const TypeEntryMultiMap &entries() const; const TypedefEntryMap &typedefEntries() const; - PrimitiveTypeEntryList primitiveTypes() const; + PrimitiveTypeEntryCList primitiveTypes() const; - ContainerTypeEntryList containerTypes() const; + ContainerTypeEntryCList containerTypes() const; SmartPointerTypeEntryList smartPointerTypes() const; diff --git a/sources/shiboken6/ApiExtractor/typedatabase_typedefs.h b/sources/shiboken6/ApiExtractor/typedatabase_typedefs.h index bc964eee2..6821076cc 100644 --- a/sources/shiboken6/ApiExtractor/typedatabase_typedefs.h +++ b/sources/shiboken6/ApiExtractor/typedatabase_typedefs.h @@ -4,20 +4,12 @@ #ifndef TYPEDATABASE_TYPEDEFS_H #define TYPEDATABASE_TYPEDEFS_H +#include "typesystem_typedefs.h" + #include #include #include -class ConstantValueTypeEntry; -class ContainerTypeEntry; -class NamespaceTypeEntry; -class PrimitiveTypeEntry; -class SmartPointerTypeEntry; -class TemplateEntry; -class TypeEntry; -class TypedefEntry; - -using TypeEntryList = QList; using TemplateEntryMap =QMap; template @@ -38,9 +30,4 @@ using TypeEntryMultiMapConstIteratorRange = QMultiMapConstIteratorRange; using TypedefEntryMap = QMap; -using ContainerTypeEntryList = QList; -using NamespaceTypeEntryList = QList; -using PrimitiveTypeEntryList = QList; -using SmartPointerTypeEntryList = QList; - #endif // TYPEDATABASE_TYPEDEFS_H diff --git a/sources/shiboken6/ApiExtractor/typesystem_typedefs.h b/sources/shiboken6/ApiExtractor/typesystem_typedefs.h index f09b76d69..25003938f 100644 --- a/sources/shiboken6/ApiExtractor/typesystem_typedefs.h +++ b/sources/shiboken6/ApiExtractor/typesystem_typedefs.h @@ -5,23 +5,26 @@ #define TYPESYSTEM_TYPEDEFS_H #include -#include -class CodeSnip; -class DocModification; - -struct AddedFunction; -class CustomConversion; -class FieldModification; -class FunctionModification; +class ComplexTypeEntry; +class ConstantValueTypeEntry; +class ContainerTypeEntry; +class FlagsTypeEntry; +class FunctionTypeEntry; +class NamespaceTypeEntry; +class ObjectTypeEntry; +class PrimitiveTypeEntry; +class SmartPointerTypeEntry; +class TemplateEntry; class TypeEntry; +class TypedefEntry; +class TypeSystemTypeEntry; + +using ContainerTypeEntryCList = QList; +using NamespaceTypeEntryList = QList; +using PrimitiveTypeEntryCList = QList; +using SmartPointerTypeEntryList = QList; +using TypeEntryList = QList; +using TypeEntryCList = QList; -using AddedFunctionPtr = QSharedPointer; -using AddedFunctionList = QList; -using CodeSnipList = QList; -using CustomConversionPtr = QSharedPointer; -using DocModificationList = QList; -using FieldModificationList = QList; -using FunctionModificationList = QList; -using TypeEntries = QList; #endif // TYPESYSTEM_TYPEDEFS_H diff --git a/sources/shiboken6/ApiExtractor/valuetypeentry.h b/sources/shiboken6/ApiExtractor/valuetypeentry.h index af181a24f..5ad060d4c 100644 --- a/sources/shiboken6/ApiExtractor/valuetypeentry.h +++ b/sources/shiboken6/ApiExtractor/valuetypeentry.h @@ -5,6 +5,7 @@ #define VALUETYPEENTRY_H #include "complextypeentry.h" +#include "customconversion_typedefs.h" class ValueTypeEntry : public ComplexTypeEntry { diff --git a/sources/shiboken6/generator/generator.cpp b/sources/shiboken6/generator/generator.cpp index 6cfcf6c86..e27cc7429 100644 --- a/sources/shiboken6/generator/generator.cpp +++ b/sources/shiboken6/generator/generator.cpp @@ -126,12 +126,12 @@ const AbstractMetaClassCList &Generator::invisibleTopNamespaces() const return m_d->m_invisibleTopNamespaces; } -PrimitiveTypeEntryList Generator::primitiveTypes() +PrimitiveTypeEntryCList Generator::primitiveTypes() { return TypeDatabase::instance()->primitiveTypes(); } -ContainerTypeEntryList Generator::containerTypes() +ContainerTypeEntryCList Generator::containerTypes() { return TypeDatabase::instance()->containerTypes(); } diff --git a/sources/shiboken6/generator/generator.h b/sources/shiboken6/generator/generator.h index fbb4c7091..34ab84a37 100644 --- a/sources/shiboken6/generator/generator.h +++ b/sources/shiboken6/generator/generator.h @@ -113,10 +113,10 @@ protected: FileNameFlags flags = {}); /// Returns all primitive types found by APIExtractor - static PrimitiveTypeEntryList primitiveTypes(); + static PrimitiveTypeEntryCList primitiveTypes(); /// Returns all container types found by APIExtractor - static ContainerTypeEntryList containerTypes(); + static ContainerTypeEntryCList containerTypes(); virtual GeneratorContext contextForClass(const AbstractMetaClass *c) const; static GeneratorContext contextForSmartPointer(const AbstractMetaClass *c, diff --git a/sources/shiboken6/generator/qtdoc/qtdocgenerator.h b/sources/shiboken6/generator/qtdoc/qtdocgenerator.h index 2f181a40f..08a359322 100644 --- a/sources/shiboken6/generator/qtdoc/qtdocgenerator.h +++ b/sources/shiboken6/generator/qtdoc/qtdocgenerator.h @@ -10,7 +10,7 @@ #include "generator.h" #include "documentation.h" #include "typesystem_enums.h" -#include "typesystem_typedefs.h" +#include "modifications_typedefs.h" #include "qtxmltosphinxinterface.h" class DocParser; diff --git a/sources/shiboken6/generator/shiboken/cppgenerator.cpp b/sources/shiboken6/generator/shiboken/cppgenerator.cpp index 54b44893d..dcde84f83 100644 --- a/sources/shiboken6/generator/shiboken/cppgenerator.cpp +++ b/sources/shiboken6/generator/shiboken/cppgenerator.cpp @@ -6861,7 +6861,7 @@ bool CppGenerator::finishGeneration() writeEnumsInitialization(s, globalEnums, ErrorReturn::Default); s << "// Register primitive types converters.\n"; - const PrimitiveTypeEntryList &primitiveTypeList = primitiveTypes(); + const PrimitiveTypeEntryCList &primitiveTypeList = primitiveTypes(); for (const PrimitiveTypeEntry *pte : primitiveTypeList) { if (!pte->generateCode() || !pte->isCppPrimitive()) continue; diff --git a/sources/shiboken6/generator/shiboken/cppgenerator.h b/sources/shiboken6/generator/shiboken/cppgenerator.h index e20d09d77..c95f861a1 100644 --- a/sources/shiboken6/generator/shiboken/cppgenerator.h +++ b/sources/shiboken6/generator/shiboken/cppgenerator.h @@ -7,7 +7,7 @@ #include "shibokengenerator.h" #include "abstractmetalang_enums.h" #include "include.h" -#include "typesystem_typedefs.h" +#include "modifications_typedefs.h" #include #include diff --git a/sources/shiboken6/generator/shiboken/headergenerator.cpp b/sources/shiboken6/generator/shiboken/headergenerator.cpp index be71def6d..c3216b00f 100644 --- a/sources/shiboken6/generator/shiboken/headergenerator.cpp +++ b/sources/shiboken6/generator/shiboken/headergenerator.cpp @@ -584,7 +584,7 @@ bool HeaderGenerator::finishGeneration() // TODO-CONVERTER ------------------------------------------------------------------------------ // Using a counter would not do, a fix must be made to APIExtractor's getTypeIndex(). macrosStream << "// Converter indices\nenum : int {\n"; - const PrimitiveTypeEntryList &primitives = primitiveTypes(); + const auto &primitives = primitiveTypes(); int pCount = 0; for (const PrimitiveTypeEntry *ptype : primitives) { /* Note: do not generate indices for typedef'd primitive types @@ -707,7 +707,7 @@ bool HeaderGenerator::finishGeneration() } else { if (!primitiveTypes().isEmpty()) { s << "// Conversion Includes - Primitive Types\n"; - const PrimitiveTypeEntryList &primitiveTypeList = primitiveTypes(); + const auto &primitiveTypeList = primitiveTypes(); for (const PrimitiveTypeEntry *ptype : primitiveTypeList) s << ptype->include(); s<< '\n'; @@ -715,7 +715,7 @@ bool HeaderGenerator::finishGeneration() if (!containerTypes().isEmpty()) { s << "// Conversion Includes - Container Types\n"; - const ContainerTypeEntryList &containerTypeList = containerTypes(); + const ContainerTypeEntryCList &containerTypeList = containerTypes(); for (const ContainerTypeEntry *ctype : containerTypeList) s << ctype->include(); s<< '\n'; diff --git a/sources/shiboken6/generator/shiboken/shibokengenerator.cpp b/sources/shiboken6/generator/shiboken/shibokengenerator.cpp index ebc84f8a7..0e6043b77 100644 --- a/sources/shiboken6/generator/shiboken/shibokengenerator.cpp +++ b/sources/shiboken6/generator/shiboken/shibokengenerator.cpp @@ -1178,7 +1178,7 @@ ShibokenGenerator::ExtendedConverterData ShibokenGenerator::getExtendedConverter QList ShibokenGenerator::getPrimitiveCustomConversions() { QList conversions; - const PrimitiveTypeEntryList &primitiveTypeList = primitiveTypes(); + const auto &primitiveTypeList = primitiveTypes(); for (const PrimitiveTypeEntry *type : primitiveTypeList) { if (type->shouldGenerate() && type->isUserPrimitive() && type->hasCustomConversion()) conversions << type->customConversion(); diff --git a/sources/shiboken6/generator/shiboken/shibokengenerator.h b/sources/shiboken6/generator/shiboken/shibokengenerator.h index af18d2f17..1b7168e31 100644 --- a/sources/shiboken6/generator/shiboken/shibokengenerator.h +++ b/sources/shiboken6/generator/shiboken/shibokengenerator.h @@ -6,6 +6,7 @@ #include +#include "customconversion_typedefs.h" #include "typesystem_typedefs.h" #include "typesystem_enums.h" -- cgit v1.2.3