language/duchain
enumerationtype.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef ENUMERATIONTYPE_H
00023 #define ENUMERATIONTYPE_H
00024
00025 #include "integraltype.h"
00026 #include "identifiedtype.h"
00027
00028 namespace KDevelop
00029 {
00030
00031 typedef KDevelop::MergeIdentifiedType<IntegralType> EnumerationTypeBase;
00032
00033 typedef EnumerationTypeBase::Data EnumerationTypeData;
00034
00035 class KDEVPLATFORMLANGUAGE_EXPORT EnumerationType : public EnumerationTypeBase
00036 {
00037 public:
00038 EnumerationType();
00039
00040 EnumerationType(const EnumerationType& rhs);
00041
00042 EnumerationType(EnumerationTypeData& data);
00043 typedef TypePtr<EnumerationType> Ptr;
00044
00045 virtual uint hash() const;
00046
00047 virtual KDevelop::AbstractType* clone() const;
00048
00049 virtual bool equals(const KDevelop::AbstractType* rhs) const;
00050
00051 virtual QString toString() const;
00052
00053 virtual WhichType whichType() const;
00054
00055 enum {
00056 Identity = 21
00057 };
00058
00059 typedef EnumerationTypeData Data;
00060
00061 protected:
00062 TYPE_DECLARE_DATA(EnumerationType);
00063 };
00064
00065 template<>
00066 inline EnumerationType* fastCast<EnumerationType*>(AbstractType* from) {
00067 if(!from || from->whichType() != KDevelop::AbstractType::TypeEnumeration)
00068 return 0;
00069 else
00070 return static_cast<EnumerationType*>(from);
00071 }
00072
00073 }
00074
00075
00076 #endif // CPPTYPES_H
00077