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

language/duchain

enumerationtype.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 "enumerationtype.h"
00023 
00024 #include "typesystemdata.h"
00025 #include "typeregister.h"
00026 
00027 namespace KDevelop {
00028 
00029 //Because all these classes have no d-pointers, shallow copies are perfectly fine
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   // Nothing enumeration type-specific to compare
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 }

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