File indexing completed on 2024-06-23 04:34:44

0001 /*
0002     SPDX-FileCopyrightText: 2002-2005 Roberto Raggi <roberto@kdevelop.org>
0003     SPDX-FileCopyrightText: 2006 Adam Treat <treat@kde.org>
0004     SPDX-FileCopyrightText: 2006-2008 Hamish Rodda <rodda@kde.org>
0005     SPDX-FileCopyrightText: 2007-2008 David Nolden <david.nolden.kdevelop@art-master.de>
0006 
0007     SPDX-License-Identifier: LGPL-2.0-only
0008 */
0009 
0010 #ifndef KDEVPLATFORM_ENUMERATIONTYPE_H
0011 #define KDEVPLATFORM_ENUMERATIONTYPE_H
0012 
0013 #include "integraltype.h"
0014 #include "identifiedtype.h"
0015 #include "typesystemdata.h" // for IntegralTypeData (used in EnumerationTypeBase)
0016 
0017 namespace KDevelop {
0018 using EnumerationTypeBase = KDevelop::MergeIdentifiedType<IntegralType>;
0019 
0020 using EnumerationTypeData = EnumerationTypeBase::Data;
0021 
0022 class KDEVPLATFORMLANGUAGE_EXPORT EnumerationType
0023     : public EnumerationTypeBase
0024 {
0025 public:
0026     EnumerationType();
0027 
0028     EnumerationType(const EnumerationType& rhs);
0029 
0030     explicit EnumerationType(EnumerationTypeData& data);
0031 
0032     EnumerationType& operator=(const EnumerationType& rhs) = delete;
0033 
0034     using Ptr = TypePtr<EnumerationType>;
0035 
0036     uint hash() const override;
0037 
0038     KDevelop::AbstractType* clone() const override;
0039 
0040     bool equals(const KDevelop::AbstractType* rhs) const override;
0041 
0042     QString toString() const override;
0043 
0044     WhichType whichType() const override;
0045 
0046     enum {
0047         Identity = 21
0048     };
0049 
0050     using Data = EnumerationTypeData;
0051 
0052 protected:
0053     TYPE_DECLARE_DATA(EnumerationType);
0054 };
0055 }
0056 
0057 #endif // KDEVPLATFORM_ENUMERATIONTYPE_H