aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken6/ApiExtractor/abstractmetalang.h
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2021-02-18 13:48:25 +0100
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2021-02-19 07:29:31 +0000
commit74e99ea75d4394d7e2fb3b2551369dedc7bd5a7c (patch)
treeefd8fd0cdc22f53f9e32e012ad6d7ba06d3c6882 /sources/shiboken6/ApiExtractor/abstractmetalang.h
parenta7c7c729a388b0a4e0e104fac1130feb6e03151b (diff)
shiboken6: Remove AbstractMetaAttributes
Remove AbstractMetaAttributes as a base class of AbstractMetaFunction and AbstractMetaClass. Split the Attributes enumerations into those applying to classes and functions, respectively and add them to AbstractMetaFunction and AbstractMetaClass. Change-Id: Ie60517876af4096fd6234479ee7dc7fbcca1eda6 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Diffstat (limited to 'sources/shiboken6/ApiExtractor/abstractmetalang.h')
-rw-r--r--sources/shiboken6/ApiExtractor/abstractmetalang.h39
1 files changed, 37 insertions, 2 deletions
diff --git a/sources/shiboken6/ApiExtractor/abstractmetalang.h b/sources/shiboken6/ApiExtractor/abstractmetalang.h
index 31a470667..b599a82cd 100644
--- a/sources/shiboken6/ApiExtractor/abstractmetalang.h
+++ b/sources/shiboken6/ApiExtractor/abstractmetalang.h
@@ -31,7 +31,6 @@
#include "abstractmetalang_enums.h"
#include "abstractmetalang_typedefs.h"
-#include "abstractmetaattributes.h"
#include "enclosingclassmixin.h"
#include "typesystem_enums.h"
#include "typesystem_typedefs.h"
@@ -49,7 +48,7 @@ class EnumTypeEntry;
class QPropertySpec;
class SourceLocation;
-class AbstractMetaClass : public AbstractMetaAttributes, public EnclosingClassMixin
+class AbstractMetaClass : public EnclosingClassMixin
{
Q_GADGET
public:
@@ -62,6 +61,30 @@ public:
};
Q_DECLARE_FLAGS(CppWrapper, CppWrapperFlag)
+ enum Attribute {
+ None = 0x00000000,
+
+ Abstract = 0x00000001,
+ FinalInTargetLang = 0x00000002,
+
+ HasRejectedConstructor = 0x00000010,
+ HasRejectedDefaultConstructor = 0x00000020,
+
+ FinalCppClass = 0x00000100,
+ Deprecated = 0x00000200
+ };
+ Q_DECLARE_FLAGS(Attributes, Attribute)
+ Q_FLAG(Attribute)
+
+ Attributes attributes() const;
+ void setAttributes(Attributes attributes);
+
+ void operator+=(Attribute attribute);
+ void operator-=(Attribute attribute);
+
+ bool isFinalInTargetLang() const;
+ bool isAbstract() const;
+
AbstractMetaClass();
~AbstractMetaClass();
@@ -347,6 +370,16 @@ private:
QScopedPointer<AbstractMetaClassPrivate> d;
};
+inline bool AbstractMetaClass::isFinalInTargetLang() const
+{
+ return attributes().testFlag(FinalInTargetLang);
+}
+
+inline bool AbstractMetaClass::isAbstract() const
+{
+ return attributes().testFlag(Abstract);
+}
+
template <class Function>
void AbstractMetaClass::invisibleNamespaceRecursion(Function f) const
{
@@ -360,4 +393,6 @@ void AbstractMetaClass::invisibleNamespaceRecursion(Function f) const
Q_DECLARE_OPERATORS_FOR_FLAGS(AbstractMetaClass::CppWrapper);
+Q_DECLARE_OPERATORS_FOR_FLAGS(AbstractMetaClass::Attributes);
+
#endif // ABSTRACTMETALANG_H