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