language/duchain
enumeratortype.cpp
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #include "enumeratortype.h"
00023
00024 #include "typesystemdata.h"
00025 #include "typeregister.h"
00026
00027 namespace KDevelop {
00028
00029 REGISTER_TYPE(EnumeratorType);
00030
00031 EnumeratorType::EnumeratorType(const EnumeratorType& rhs)
00032 : EnumeratorTypeBase(copyData<EnumeratorType>(*rhs.d_func()))
00033 {
00034 }
00035
00036 EnumeratorType::EnumeratorType(EnumeratorTypeData& data)
00037 : EnumeratorTypeBase(data)
00038 {
00039 }
00040
00041 EnumeratorType::EnumeratorType()
00042 : EnumeratorTypeBase(createData<EnumeratorType>())
00043 {
00044 IntegralType::setDataType(TypeInt);
00045 setModifiers(ConstModifier);
00046 }
00047
00048 AbstractType* EnumeratorType::clone() const
00049 {
00050 return new EnumeratorType(*this);
00051 }
00052
00053 bool EnumeratorType::equals(const AbstractType* _rhs) const
00054 {
00055 if( this == _rhs )
00056 return true;
00057
00058 if (!EnumeratorTypeBase::equals(_rhs))
00059 return false;
00060
00061 Q_ASSERT(fastCast<const EnumeratorType*>(_rhs));
00062
00063
00064 return true;
00065 }
00066
00067 uint EnumeratorType::hash() const
00068 {
00069 return 27*(IdentifiedType::hash() + 13*ConstantIntegralType::hash());
00070 }
00071
00072 AbstractType::WhichType EnumeratorType::whichType() const
00073 {
00074 return TypeEnumerator;
00075 }
00076
00077 QString EnumeratorType::toString() const
00078 {
00079 return IdentifiedType::qualifiedIdentifier().toString();
00080 }
00081
00082 }