File indexing completed on 2024-06-23 04:34:45
0001 /* 0002 SPDX-FileCopyrightText: 2006 Roberto Raggi <roberto@kdevelop.org> 0003 SPDX-FileCopyrightText: 2006-2008 Hamish Rodda <rodda@kde.org> 0004 0005 SPDX-License-Identifier: LGPL-2.0-only 0006 */ 0007 0008 #ifndef KDEVPLATFORM_STRUCTURETYPE_H 0009 #define KDEVPLATFORM_STRUCTURETYPE_H 0010 0011 #include "abstracttype.h" 0012 #include "identifiedtype.h" 0013 #include "typesystemdata.h" 0014 0015 namespace KDevelop { 0016 class StructureTypeData; 0017 0018 using StructureTypeBase = MergeIdentifiedType<AbstractType>; 0019 0020 /** 0021 * \short A type representing structure types. 0022 * 0023 * StructureType represents all structures, including classes, 0024 * interfaces, etc. 0025 */ 0026 class KDEVPLATFORMLANGUAGE_EXPORT StructureType 0027 : public StructureTypeBase 0028 { 0029 public: 0030 using Ptr = TypePtr<StructureType>; 0031 0032 /// Default constructor 0033 StructureType(); 0034 /// Copy constructor. \param rhs type to copy 0035 StructureType(const StructureType& rhs); 0036 /// Constructor using raw data. \param data internal data. 0037 explicit StructureType(StructureTypeData& data); 0038 /// Destructor 0039 ~StructureType() override; 0040 0041 StructureType& operator=(const StructureType& rhs) = delete; 0042 0043 AbstractType* clone() const override; 0044 0045 bool equals(const AbstractType* rhs) const override; 0046 0047 QString toString() const override; 0048 0049 uint hash() const override; 0050 0051 WhichType whichType() const override; 0052 0053 //virtual void exchangeTypes(KDevelop::TypeExchanger*); 0054 0055 enum { 0056 Identity = 6 0057 }; 0058 0059 using Data = StructureTypeData; 0060 0061 protected: 0062 void accept0 (TypeVisitor* v) const override; 0063 0064 TYPE_DECLARE_DATA(StructureType) 0065 }; 0066 } 0067 0068 #endif