• Skip to content
  • Skip to link menu
KDE 4.4 API Reference
  • KDE API Reference
  • KDevelop Platform Libraries
  • Sitemap
  • Contact Us
 

language/duchain

enumeratortype.cpp

00001 /* This file is part of KDevelop
00002     Copyright 2002-2005 Roberto Raggi <roberto@kdevelop.org>
00003     Copyright 2006 Adam Treat <treat@kde.org>
00004     Copyright 2006-2008 Hamish Rodda <rodda@kde.org>
00005     Copyright 2007-2008 David Nolden <david.nolden.kdevelop@art-master.de>
00006 
00007    This library is free software; you can redistribute it and/or
00008    modify it under the terms of the GNU Library General Public
00009    License version 2 as published by the Free Software Foundation.
00010 
00011    This library is distributed in the hope that it will be useful,
00012    but WITHOUT ANY WARRANTY; without even the implied warranty of
00013    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014    Library General Public License for more details.
00015 
00016    You should have received a copy of the GNU Library General Public License
00017    along with this library; see the file COPYING.LIB.  If not, write to
00018    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00019    Boston, MA 02110-1301, USA.
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   // Nothing Enumerator-type specific to compare
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 }

language/duchain

Skip menu "language/duchain"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

KDevelop Platform Libraries

Skip menu "KDevelop Platform Libraries"
  • interfaces
  • language
  •   codegen
  •   duchain
  •   editor
  • outputview
  • project
  • shell
  • sublime
  • util
  • vcs
Generated for KDevelop Platform Libraries by doxygen 1.5.9-20090814
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal