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