aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken6/ApiExtractor/abstractmetalang.h
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2020-11-05 16:41:23 +0100
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2020-11-06 08:11:57 +0000
commit562edc619787d83b2d4418fa7a69c597a7b6945c (patch)
tree959812de4b3fc30b24a0e7637c5d917c53f1c676 /sources/shiboken6/ApiExtractor/abstractmetalang.h
parente21b3c5f6201c97a89b736cec17a1855870409e8 (diff)
shiboken6: Split the abstractmetalang headers and sources
Split out enums, fields and functions. Only AbstractMetaClass remains in abstractmetalang.h. Change-Id: I49846f92fafc5969d83aa4a1767eb4ac23f39d1c Reviewed-by: Christian Tismer <tismer@stackless.com>
Diffstat (limited to 'sources/shiboken6/ApiExtractor/abstractmetalang.h')
-rw-r--r--sources/shiboken6/ApiExtractor/abstractmetalang.h1026
1 files changed, 42 insertions, 984 deletions
diff --git a/sources/shiboken6/ApiExtractor/abstractmetalang.h b/sources/shiboken6/ApiExtractor/abstractmetalang.h
index 1fd2eb3ff..d41c0f976 100644
--- a/sources/shiboken6/ApiExtractor/abstractmetalang.h
+++ b/sources/shiboken6/ApiExtractor/abstractmetalang.h
@@ -30,826 +30,20 @@
#define ABSTRACTMETALANG_H
#include "abstractmetalang_typedefs.h"
-#include "abstractmetaargument.h"
-#include "abstractmetatype.h"
-#include "documentation.h"
+#include "abstractmetaattributes.h"
+#include "enclosingclassmixin.h"
#include "sourcelocation.h"
#include "typesystem_enums.h"
#include "typesystem_typedefs.h"
-#include "parser/codemodel_enums.h"
-#include "parser/enumvalue.h"
-
#include <QtCore/qobjectdefs.h>
#include <QtCore/QStringList>
-#include <QtCore/QSharedDataPointer>
QT_FORWARD_DECLARE_CLASS(QDebug)
-class AbstractMeta;
-class AbstractMetaClass;
-class AbstractMetaField;
-class AbstractMetaFunction;
-class AbstractMetaVariable;
-class AbstractMetaArgument;
-class AbstractMetaEnumValue;
-class AbstractMetaEnum;
class QPropertySpec;
-
-class CodeSnip;
class ComplexTypeEntry;
class EnumTypeEntry;
-class FlagsTypeEntry;
-class FunctionTypeEntry;
-class TypeEntry;
-
-struct ArgumentOwner;
-struct FieldModification;
-struct FunctionModification;
-struct ReferenceCount;
-
-class AbstractMetaAttributes
-{
- Q_GADGET
-public:
- Q_DISABLE_COPY(AbstractMetaAttributes)
-
- AbstractMetaAttributes();
- virtual ~AbstractMetaAttributes();
-
- enum Attribute {
- None = 0x00000000,
-
- Private = 0x00000001,
- Protected = 0x00000002,
- Public = 0x00000004,
- Friendly = 0x00000008,
- Visibility = 0x0000000f,
-
- Abstract = 0x00000020,
- Static = 0x00000040,
-
- FinalInTargetLang = 0x00000080,
-
- GetterFunction = 0x00000400,
- SetterFunction = 0x00000800,
-
- PropertyReader = 0x00004000,
- PropertyWriter = 0x00008000,
- PropertyResetter = 0x00010000,
-
- Invokable = 0x00040000,
-
- HasRejectedConstructor = 0x00080000,
- HasRejectedDefaultConstructor = 0x00100000,
-
- FinalCppClass = 0x00200000,
- VirtualCppMethod = 0x00400000,
- OverriddenCppMethod = 0x00800000,
- FinalCppMethod = 0x01000000,
- // Add by meta builder (implicit constructors, inherited methods, etc)
- AddedMethod = 0x02000000,
- Deprecated = 0x04000000
- };
- Q_DECLARE_FLAGS(Attributes, Attribute)
- Q_FLAG(Attribute)
-
- Attributes attributes() const
- {
- return m_attributes;
- }
-
- void setAttributes(Attributes attributes)
- {
- m_attributes = attributes;
- }
-
- Attributes originalAttributes() const
- {
- return m_originalAttributes;
- }
-
- void setOriginalAttributes(Attributes attributes)
- {
- m_originalAttributes = attributes;
- }
-
- Attributes visibility() const
- {
- return m_attributes & Visibility;
- }
-
- void setVisibility(Attributes visi)
- {
- m_attributes = (m_attributes & ~Visibility) | visi;
- }
-
- void operator+=(Attribute attribute)
- {
- m_attributes |= attribute;
- }
-
- void operator-=(Attribute attribute)
- {
- m_attributes &= ~attribute;
- }
-
- bool isFinalInTargetLang() const
- {
- return m_attributes & FinalInTargetLang;
- }
-
- bool isAbstract() const
- {
- return m_attributes & Abstract;
- }
-
- bool isStatic() const
- {
- return m_attributes & Static;
- }
-
- bool isInvokable() const
- {
- return m_attributes & Invokable;
- }
-
- bool isPropertyReader() const
- {
- return m_attributes & PropertyReader;
- }
-
- bool isPropertyWriter() const
- {
- return m_attributes & PropertyWriter;
- }
-
- bool isPropertyResetter() const
- {
- return m_attributes & PropertyResetter;
- }
-
- bool isPrivate() const
- {
- return m_attributes & Private;
- }
-
- bool isProtected() const
- {
- return m_attributes & Protected;
- }
-
- bool isPublic() const
- {
- return m_attributes & Public;
- }
-
- bool isFriendly() const
- {
- return m_attributes & Friendly;
- }
-
- bool wasPrivate() const
- {
- return m_originalAttributes & Private;
- }
-
- bool wasPublic() const
- {
- return m_originalAttributes & Public;
- }
-
- void setDocumentation(const Documentation& doc)
- {
- m_doc = doc;
- }
-
- Documentation documentation() const
- {
- return m_doc;
- }
-
-protected:
- void assignMetaAttributes(const AbstractMetaAttributes &other);
-
-private:
- Attributes m_attributes;
- Attributes m_originalAttributes;
- Documentation m_doc;
-};
-
-Q_DECLARE_OPERATORS_FOR_FLAGS(AbstractMetaAttributes::Attributes)
-
-#ifndef QT_NO_DEBUG_STREAM
-QDebug operator<<(QDebug d, const AbstractMetaAttributes *aa);
-#endif
-
-class AbstractMetaVariable
-{
- Q_DISABLE_COPY(AbstractMetaVariable)
-public:
- AbstractMetaVariable();
-
- virtual ~AbstractMetaVariable();
-
- const AbstractMetaType &type() const
- {
- return m_type;
- }
- void setType(const AbstractMetaType &type)
- {
- m_type = type;
- }
-
- QString name() const
- {
- return m_name;
- }
- void setName(const QString &name, bool realName = true)
- {
- m_name = name;
- m_hasName = realName;
- }
- bool hasName() const
- {
- return m_hasName;
- }
- QString originalName() const
- {
- return m_originalName;
- }
- void setOriginalName(const QString& name)
- {
- m_originalName = name;
- }
- void setDocumentation(const Documentation& doc)
- {
- m_doc = doc;
- }
- Documentation documentation() const
- {
- return m_doc;
- }
-
-protected:
- void assignMetaVariable(const AbstractMetaVariable &other);
-
-private:
- QString m_originalName;
- QString m_name;
- AbstractMetaType m_type;
- bool m_hasName = false;
-
- Documentation m_doc;
-};
-
-#ifndef QT_NO_DEBUG_STREAM
-QDebug operator<<(QDebug d, const AbstractMetaVariable *av);
-#endif
-
-class EnclosingClassMixin {
-public:
- const AbstractMetaClass *enclosingClass() const { return m_enclosingClass; }
- void setEnclosingClass(const AbstractMetaClass *cls) { m_enclosingClass = cls; }
- const AbstractMetaClass *targetLangEnclosingClass() const;
-
-private:
- const AbstractMetaClass *m_enclosingClass = nullptr;
-};
-
-class AbstractMetaField : public AbstractMetaVariable, public AbstractMetaAttributes, public EnclosingClassMixin
-{
-public:
- AbstractMetaField();
-
- FieldModificationList modifications() const;
-
- bool isModifiedRemoved(int types = TypeSystem::All) const;
-
- using AbstractMetaVariable::setDocumentation;
- using AbstractMetaVariable::documentation;
-
- AbstractMetaField *copy() const;
-
- static AbstractMetaField *
- find(const AbstractMetaFieldList &haystack, const QString &needle);
-};
-
-#ifndef QT_NO_DEBUG_STREAM
-QDebug operator<<(QDebug d, const AbstractMetaField *af);
-#endif
-
-class AbstractMetaFunction : public AbstractMetaAttributes
-{
- Q_GADGET
-public:
- enum FunctionType {
- ConstructorFunction,
- CopyConstructorFunction,
- MoveConstructorFunction,
- AssignmentOperatorFunction,
- MoveAssignmentOperatorFunction,
- DestructorFunction,
- NormalFunction,
- SignalFunction,
- EmptyFunction,
- SlotFunction,
- GlobalScopeFunction,
- GetAttroFunction,
- SetAttroFunction
- };
- Q_ENUM(FunctionType)
-
- enum CompareResultFlag {
- EqualName = 0x00000001,
- EqualArguments = 0x00000002,
- EqualAttributes = 0x00000004,
- EqualImplementor = 0x00000008,
- EqualReturnType = 0x00000010,
- EqualDefaultValueOverload = 0x00000020,
- EqualModifiedName = 0x00000040,
-
- NameLessThan = 0x00001000,
-
- PrettySimilar = EqualName | EqualArguments,
- Equal = 0x0000001f,
- NotEqual = 0x00001000
- };
- Q_DECLARE_FLAGS(CompareResult, CompareResultFlag)
- Q_FLAG(CompareResultFlag)
-
- AbstractMetaFunction();
- explicit AbstractMetaFunction(const AddedFunctionPtr &addedFunc);
- ~AbstractMetaFunction();
-
- QString name() const
- {
- return m_name;
- }
-
- void setName(const QString &name)
- {
- m_name = name;
- }
-
- QString originalName() const
- {
- return m_originalName.isEmpty() ? name() : m_originalName;
- }
-
- void setOriginalName(const QString &name)
- {
- m_originalName = name;
- }
-
- void setReverseOperator(bool reverse)
- {
- m_reverse = reverse;
- }
-
- bool isReverseOperator() const
- {
- return m_reverse;
- }
-
- /**
- * Returns true if this is a operator and the "self" operand is a pointer.
- * e.g. class Foo {}; operator+(SomeEnum, Foo*);
- */
- bool isPointerOperator() const
- {
- return m_pointerOperator;
- }
-
- void setPointerOperator(bool value)
- {
- m_pointerOperator = value;
- }
-
- void setExplicit(bool isExplicit)
- {
- m_explicit = isExplicit;
- }
- /**
- * Says if the function (a constructor) was declared as explicit in C++.
- * \return true if the function was declared as explicit in C++
- */
- bool isExplicit() const
- {
- return m_explicit;
- }
-
- static bool isConversionOperator(const QString& funcName);
-
- ExceptionSpecification exceptionSpecification() const;
- void setExceptionSpecification(ExceptionSpecification e);
-
- bool generateExceptionHandling() const;
-
- bool isConversionOperator() const
- {
- return isConversionOperator(originalName());
- }
-
- static bool isOperatorOverload(const QString& funcName);
- bool isOperatorOverload() const
- {
- return isOperatorOverload(originalName());
- }
- bool isCastOperator() const;
-
- bool isArithmeticOperator() const;
- bool isBitwiseOperator() const;
- bool isComparisonOperator() const;
- bool isLogicalOperator() const;
- bool isSubscriptOperator() const;
- bool isAssignmentOperator() const; // Assignment or move assignment
- bool isOtherOperator() const;
-
- /**
- * Informs the arity of the operator or -1 if the function is not
- * an operator overload.
- * /return the arity of the operator or -1
- */
- int arityOfOperator() const;
- bool isUnaryOperator() const { return arityOfOperator() == 1; }
- bool isBinaryOperator() const { return arityOfOperator() == 2; }
- bool isInplaceOperator() const;
-
- bool isVirtual() const;
- bool allowThread() const;
- QString modifiedName() const;
-
- QString minimalSignature() const;
- QString debugSignature() const; // including virtual/override/final, etc., for debugging only.
-
- bool isModifiedRemoved(int types = TypeSystem::All) const;
-
- bool isVoid() const { return m_type.isVoid(); }
- const AbstractMetaType &type() const
- {
- return m_type;
- }
- void setType(const AbstractMetaType &type)
- {
- m_type = type;
- }
-
- // The class that has this function as a member.
- const AbstractMetaClass *ownerClass() const
- {
- return m_class;
- }
- void setOwnerClass(const AbstractMetaClass *cls)
- {
- m_class = cls;
- }
-
- // Owner excluding invisible namespaces
- const AbstractMetaClass *targetLangOwner() const;
-
- // The first class in a hierarchy that declares the function
- const AbstractMetaClass *declaringClass() const
- {
- return m_declaringClass;
- }
- void setDeclaringClass(const AbstractMetaClass *cls)
- {
- m_declaringClass = cls;
- }
-
- // The class that actually implements this function
- const AbstractMetaClass *implementingClass() const
- {
- return m_implementingClass;
- }
- void setImplementingClass(const AbstractMetaClass *cls)
- {
- m_implementingClass = cls;
- }
-
- const AbstractMetaArgumentList &arguments() const
- {
- return m_arguments;
- }
- AbstractMetaArgumentList &arguments()
- {
- return m_arguments;
- }
- void setArguments(const AbstractMetaArgumentList &arguments)
- {
- m_arguments = arguments;
- }
- void addArgument(const AbstractMetaArgument &argument)
- {
- m_arguments << argument;
- }
- int actualMinimumArgumentCount() const;
-
- bool isDeprecated() const;
- bool isDestructor() const
- {
- return functionType() == DestructorFunction;
- }
- bool isConstructor() const
- {
- return m_functionType == ConstructorFunction || m_functionType == CopyConstructorFunction
- || m_functionType == MoveConstructorFunction;
- }
- bool isNormal() const
- {
- return functionType() == NormalFunction || isSlot() || isInGlobalScope();
- }
- bool isInGlobalScope() const
- {
- return functionType() == GlobalScopeFunction;
- }
- bool isSignal() const
- {
- return functionType() == SignalFunction;
- }
- bool isSlot() const
- {
- return functionType() == SlotFunction;
- }
- bool isEmptyFunction() const
- {
- return functionType() == EmptyFunction;
- }
- FunctionType functionType() const
- {
- return m_functionType;
- }
- void setFunctionType(FunctionType type)
- {
- m_functionType = type;
- }
-
- bool usesRValueReferences() const;
- QStringList introspectionCompatibleSignatures(const QStringList &resolvedArguments = QStringList()) const;
- QString signature() const;
-
- bool isConstant() const
- {
- return m_constant;
- }
- void setConstant(bool constant)
- {
- m_constant = constant;
- }
-
- /// Returns true if the AbstractMetaFunction was added by the user via the type system description.
- bool isUserAdded() const;
-
- QString toString() const
- {
- return m_name;
- }
-
- CompareResult compareTo(const AbstractMetaFunction *other) const;
-
- bool operator <(const AbstractMetaFunction &a) const;
-
- AbstractMetaFunction *copy() const;
-
- QString conversionRule(TypeSystem::Language language, int idx) const;
- QVector<ReferenceCount> referenceCounts(const AbstractMetaClass *cls, int idx = -2) const;
- ArgumentOwner argumentOwner(const AbstractMetaClass *cls, int idx) const;
-
- // Returns the ownership rules for the given argument in the given context
- TypeSystem::Ownership ownership(const AbstractMetaClass *cls, TypeSystem::Language language, int idx) const;
-
- QString typeReplaced(int argument_index) const;
- bool isModifiedToArray(int argumentIndex) const;
- bool isRemovedFromAllLanguages(const AbstractMetaClass *) const;
- bool isRemovedFrom(const AbstractMetaClass *, TypeSystem::Language language) const;
- bool argumentRemoved(int) const;
- /**
- * Verifies if any modification to the function is an inject code.
- * \return true if there is inject code modifications to the function.
- */
- bool hasInjectedCode() const;
- /**
- * Returns a list of code snips for this function.
- * The code snips can be filtered by position and language.
- * \return list of code snips
- */
- CodeSnipList injectedCodeSnips(TypeSystem::CodeSnipPosition position = TypeSystem::CodeSnipPositionAny,
- TypeSystem::Language language = TypeSystem::All) const;
-
- /**
- * Verifies if any modification to the function alters/removes its
- * arguments types or default values.
- * \return true if there is some modification to function signature
- */
- bool hasSignatureModifications() const;
- FunctionModificationList modifications(const AbstractMetaClass* implementor = nullptr) const;
-
- /**
- * Return the argument name if there is a modification the renamed value will be returned
- */
- QString argumentName(int index, bool create = true, const AbstractMetaClass *cl = nullptr) const;
-
- void setPropertySpec(QPropertySpec *spec)
- {
- m_propertySpec = spec;
- }
-
- QPropertySpec *propertySpec() const
- {
- return m_propertySpec;
- }
-
- FunctionTypeEntry* typeEntry() const
- {
- return m_typeEntry;
- }
-
- void setTypeEntry(FunctionTypeEntry* typeEntry)
- {
- m_typeEntry = typeEntry;
- }
-
- bool isCallOperator() const;
-
- static AbstractMetaFunction *
- find(const AbstractMetaFunctionList &haystack, const QString &needle);
-
- // for the meta builder only
- void setAllowThreadModification(TypeSystem::AllowThread am)
- { m_allowThreadModification = am; }
- void setExceptionHandlingModification(TypeSystem::ExceptionHandling em)
- { m_exceptionHandlingModification = em; }
-
- int overloadNumber() const;
-
-#ifndef QT_NO_DEBUG_STREAM
- void formatDebugVerbose(QDebug &d) const;
-#endif
-
- SourceLocation sourceLocation() const;
- void setSourceLocation(const SourceLocation &sourceLocation);
-
-private:
- bool autoDetectAllowThread() const;
-
- QString m_name;
- QString m_originalName;
- mutable QString m_cachedMinimalSignature;
- mutable QString m_cachedSignature;
- mutable QString m_cachedModifiedName;
-
- FunctionTypeEntry* m_typeEntry = nullptr;
- FunctionType m_functionType = NormalFunction;
- AbstractMetaType m_type;
- const AbstractMetaClass *m_class = nullptr;
- const AbstractMetaClass *m_implementingClass = nullptr;
- const AbstractMetaClass *m_declaringClass = nullptr;
- QPropertySpec *m_propertySpec = nullptr;
- AbstractMetaArgumentList m_arguments;
- AddedFunctionPtr m_addedFunction;
- SourceLocation m_sourceLocation;
- uint m_constant : 1;
- uint m_reverse : 1;
- uint m_explicit : 1;
- uint m_pointerOperator : 1;
- uint m_isCallOperator : 1;
- mutable int m_cachedOverloadNumber = TypeSystem::OverloadNumberUnset;
- ExceptionSpecification m_exceptionSpecification = ExceptionSpecification::Unknown;
- TypeSystem::AllowThread m_allowThreadModification = TypeSystem::AllowThread::Unspecified;
- TypeSystem::ExceptionHandling m_exceptionHandlingModification = TypeSystem::ExceptionHandling::Unspecified;
-};
-
-Q_DECLARE_OPERATORS_FOR_FLAGS(AbstractMetaFunction::CompareResult)
-
-#ifndef QT_NO_DEBUG_STREAM
-QDebug operator<<(QDebug d, const AbstractMetaFunction *af);
-#endif
-
-class AbstractMetaEnumValue
-{
-public:
- AbstractMetaEnumValue() = default;
-
- EnumValue value() const
- {
- return m_value;
- }
-
- void setValue(EnumValue value)
- {
- m_value = value;
- }
-
- QString stringValue() const
- {
- return m_stringValue;
- }
-
- void setStringValue(const QString &v)
- {
- m_stringValue = v;
- }
-
- QString name() const
- {
- return m_name;
- }
-
- void setName(const QString &name)
- {
- m_name = name;
- }
-
- void setDocumentation(const Documentation& doc)
- {
- m_doc = doc;
- }
-
- Documentation documentation() const
- {
- return m_doc;
- }
-
-private:
- QString m_name;
- QString m_stringValue;
-
- EnumValue m_value;
-
- Documentation m_doc;
-};
-
-class AbstractMetaEnum : public AbstractMetaAttributes, public EnclosingClassMixin
-{
-public:
- AbstractMetaEnum();
- ~AbstractMetaEnum();
-
- AbstractMetaEnumValueList values() const
- {
- return m_enumValues;
- }
-
- void addEnumValue(AbstractMetaEnumValue *enumValue)
- {
- m_enumValues << enumValue;
- }
-
- AbstractMetaEnumValue *findEnumValue(const QString &value) const;
-
- QString name() const;
-
- QString qualifier() const;
-
- QString package() const;
-
- QString fullName() const
- {
- return package() + QLatin1Char('.') + qualifier() + QLatin1Char('.') + name();
- }
-
- EnumKind enumKind() const { return m_enumKind; }
- void setEnumKind(EnumKind kind) { m_enumKind = kind; }
-
- bool isAnonymous() const { return m_enumKind == AnonymousEnum; }
-
- // Has the enum been declared inside a Q_ENUMS() macro in its enclosing class?
- void setHasQEnumsDeclaration(bool on)
- {
- m_hasQenumsDeclaration = on;
- }
-
- bool hasQEnumsDeclaration() const
- {
- return m_hasQenumsDeclaration;
- }
-
- EnumTypeEntry *typeEntry() const
- {
- return m_typeEntry;
- }
-
- void setTypeEntry(EnumTypeEntry *entry)
- {
- m_typeEntry = entry;
- }
-
- bool isSigned() const { return m_signed; }
- void setSigned(bool s) { m_signed = s; }
-
-private:
- AbstractMetaEnumValueList m_enumValues;
- EnumTypeEntry *m_typeEntry = nullptr;
-
- EnumKind m_enumKind = CEnum;
- uint m_hasQenumsDeclaration : 1;
- uint m_signed : 1;
-};
-
-#ifndef QT_NO_DEBUG_STREAM
-QDebug operator<<(QDebug d, const AbstractMetaEnum *ae);
-#endif
class AbstractMetaClass : public AbstractMetaAttributes, public EnclosingClassMixin
{
@@ -900,10 +94,7 @@ public:
void fixFunctions();
- AbstractMetaFunctionList functions() const
- {
- return m_functions;
- }
+ const AbstractMetaFunctionList &functions() const { return m_functions; }
void setFunctions(const AbstractMetaFunctionList &functions);
void addFunction(AbstractMetaFunction *function);
@@ -920,51 +111,19 @@ public:
void addDefaultConstructor();
void addDefaultCopyConstructor(bool isPrivate = false);
- bool hasNonPrivateConstructor() const
- {
- return m_hasNonPrivateConstructor;
- }
-
- void setHasNonPrivateConstructor(bool value)
- {
- m_hasNonPrivateConstructor = value;
- }
-
- bool hasPrivateConstructor() const
- {
- return m_hasPrivateConstructor;
- }
-
- void setHasPrivateConstructor(bool value)
- {
- m_hasPrivateConstructor = value;
- }
+ bool hasNonPrivateConstructor() const { return m_hasNonPrivateConstructor; }
+ void setHasNonPrivateConstructor(bool value) { m_hasNonPrivateConstructor = value; }
- bool hasPrivateDestructor() const
- {
- return m_hasPrivateDestructor;
- }
+ bool hasPrivateConstructor() const { return m_hasPrivateConstructor; }
+ void setHasPrivateConstructor(bool value) { m_hasPrivateConstructor = value; }
- void setHasPrivateDestructor(bool value)
- {
- m_hasPrivateDestructor = value;
- }
-
- bool hasProtectedDestructor() const
- {
- return m_hasProtectedDestructor;
- }
-
- void setHasProtectedDestructor(bool value)
- {
- m_hasProtectedDestructor = value;
- }
+ bool hasPrivateDestructor() const { return m_hasPrivateDestructor; }
+ void setHasPrivateDestructor(bool value) { m_hasPrivateDestructor = value; }
- bool hasVirtualDestructor() const
- {
- return m_hasVirtualDestructor;
- }
+ bool hasProtectedDestructor() const { return m_hasProtectedDestructor; }
+ void setHasProtectedDestructor(bool value) { m_hasProtectedDestructor = value; }
+ bool hasVirtualDestructor() const { return m_hasVirtualDestructor; }
void setHasVirtualDestructor(bool value);
bool isConstructible() const
@@ -1001,33 +160,15 @@ public:
bool hasComparisonOperatorOverload() const;
bool hasLogicalOperatorOverload() const;
- AbstractMetaFieldList fields() const
- {
- return m_fields;
- }
-
- void setFields(const AbstractMetaFieldList &fields)
- {
- m_fields = fields;
- }
-
- void addField(AbstractMetaField *field)
- {
- m_fields << field;
- }
+ const AbstractMetaFieldList &fields() const { return m_fields; }
+ void setFields(const AbstractMetaFieldList &fields) { m_fields = fields; }
+ void addField(AbstractMetaField *field) { m_fields << field; }
AbstractMetaField *findField(const QString &name) const;
const AbstractMetaEnumList &enums() const { return m_enums; }
- void setEnums(const AbstractMetaEnumList &enums)
- {
- m_enums = enums;
- }
-
- void addEnum(AbstractMetaEnum *e)
- {
- m_enums << e;
- }
+ void setEnums(const AbstractMetaEnumList &enums) { m_enums = enums; }
+ void addEnum(AbstractMetaEnum *e) { m_enums << e; }
AbstractMetaEnum *findEnum(const QString &enumName);
AbstractMetaEnumValue *findEnumValue(const QString &enumName);
@@ -1067,20 +208,9 @@ public:
AbstractMetaClass *extendedNamespace() const { return m_extendedNamespace; }
void setExtendedNamespace(AbstractMetaClass *e) { m_extendedNamespace = e; }
- const AbstractMetaClassList& innerClasses() const
- {
- return m_innerClasses;
- }
-
- void addInnerClass(AbstractMetaClass* cl)
- {
- m_innerClasses << cl;
- }
-
- void setInnerClasses(const AbstractMetaClassList &innerClasses)
- {
- m_innerClasses = innerClasses;
- }
+ const AbstractMetaClassList& innerClasses() const { return m_innerClasses; }
+ void addInnerClass(AbstractMetaClass* cl) { m_innerClasses << cl; }
+ void setInnerClasses(const AbstractMetaClassList &innerClasses) { m_innerClasses = innerClasses; }
QString package() const;
@@ -1103,10 +233,7 @@ public:
* Says if the class that declares or inherits a virtual function.
* \return true if the class implements or inherits any virtual methods
*/
- bool isPolymorphic() const
- {
- return m_isPolymorphic;
- }
+ bool isPolymorphic() const { return m_isPolymorphic; }
/**
* Tells if this class has one or more functions that are protected.
@@ -1127,79 +254,31 @@ public:
bool hasProtectedMembers() const;
- QVector<TypeEntry *> templateArguments() const
- {
- return m_templateArgs;
- }
-
- void setTemplateArguments(const QVector<TypeEntry *> &args)
- {
- m_templateArgs = args;
- }
+ const QVector<TypeEntry *> &templateArguments() const { return m_templateArgs; }
+ void setTemplateArguments(const QVector<TypeEntry *> &args) { m_templateArgs = args; }
// only valid during metabuilder's run
- QStringList baseClassNames() const
- {
- return m_baseClassNames;
- }
+ const QStringList &baseClassNames() const { return m_baseClassNames; }
+ void setBaseClassNames(const QStringList &names) { m_baseClassNames = names; }
- void setBaseClassNames(const QStringList &names)
- {
- m_baseClassNames = names;
- }
+ const ComplexTypeEntry *typeEntry() const { return m_typeEntry; }
+ ComplexTypeEntry *typeEntry() { return m_typeEntry; }
+ void setTypeEntry(ComplexTypeEntry *type) { m_typeEntry = type; }
- const ComplexTypeEntry *typeEntry() const
- {
- return m_typeEntry;
- }
+ void setHasHashFunction(bool on) { m_hasHashFunction = on; }
- ComplexTypeEntry *typeEntry()
- {
- return m_typeEntry;
- }
+ bool hasHashFunction() const { return m_hasHashFunction; }
- void setTypeEntry(ComplexTypeEntry *type)
- {
- m_typeEntry = type;
- }
+ bool hasDefaultToStringFunction() const;
- void setHasHashFunction(bool on)
- {
- m_hasHashFunction = on;
- }
+ bool hasEqualsOperator() const { return m_hasEqualsOperator; }
+ void setHasEqualsOperator(bool on) { m_hasEqualsOperator = on; }
- bool hasHashFunction() const
- {
- return m_hasHashFunction;
- }
- virtual bool hasDefaultToStringFunction() const;
-
- void setHasEqualsOperator(bool on)
- {
- m_hasEqualsOperator = on;
- }
-
- bool hasEqualsOperator() const
- {
- return m_hasEqualsOperator;
- }
-
- void setHasCloneOperator(bool on)
- {
- m_hasCloneOperator = on;
- }
-
- bool hasCloneOperator() const
- {
- return m_hasCloneOperator;
- }
-
- void addPropertySpec(QPropertySpec *spec)
- {
- m_propertySpecs << spec;
- }
+ bool hasCloneOperator() const { return m_hasCloneOperator; }
+ void setHasCloneOperator(bool on) { m_hasCloneOperator = on; }
const QVector<QPropertySpec *> &propertySpecs() const { return m_propertySpecs; }
+ void addPropertySpec(QPropertySpec *spec) { m_propertySpecs << spec; }
QPropertySpec *propertySpecByName(const QString &name) const;
QPropertySpec *propertySpecForRead(const QString &name) const;
@@ -1225,15 +304,8 @@ public:
void sortFunctions();
- const AbstractMetaClass *templateBaseClass() const
- {
- return m_templateBaseClass;
- }
-
- void setTemplateBaseClass(const AbstractMetaClass *cls)
- {
- m_templateBaseClass = cls;
- }
+ const AbstractMetaClass *templateBaseClass() const { return m_templateBaseClass; }
+ void setTemplateBaseClass(const AbstractMetaClass *cls) { m_templateBaseClass = cls; }
bool hasTemplateBaseClassInstantiations() const;
const AbstractMetaTypeList &templateBaseClassInstantiations() const;
@@ -1242,31 +314,17 @@ public:
void setTypeDef(bool typeDef) { m_isTypeDef = typeDef; }
bool isTypeDef() const { return m_isTypeDef; }
- void setStream(bool stream)
- {
- m_stream = stream;
- }
-
- bool isStream() const
- {
- return m_stream;
- }
+ bool isStream() const { return m_stream; }
+ void setStream(bool stream) { m_stream = stream; }
+ bool hasToStringCapability() const { return m_hasToStringCapability; }
void setToStringCapability(bool value, uint indirections = 0)
{
m_hasToStringCapability = value;
m_toStringCapabilityIndirections = indirections;
}
- bool hasToStringCapability() const
- {
- return m_hasToStringCapability;
- }
-
- uint toStringCapabilityIndirections() const
- {
- return m_toStringCapabilityIndirections;
- }
+ uint toStringCapabilityIndirections() const { return m_toStringCapabilityIndirections; }
bool deleteInMainThread() const;