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

language/duchain

identifiedtype.h

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 #ifndef IDENTIFIEDTYPE_H
00023 #define IDENTIFIEDTYPE_H
00024 
00025 #include "../identifier.h"
00026 #include "../declarationid.h"
00027 
00028 namespace KDevelop
00029 {
00030 class DUContext;
00031 class Declaration;
00032 class DeclarationId;
00033 class TopDUContext;
00034 class AbstractType;
00035 
00039 class IdentifiedTypeData
00040 {
00041 public:
00042   DeclarationId m_id;
00043 };
00044 
00055 class KDEVPLATFORMLANGUAGE_EXPORT IdentifiedType
00056 {
00057 public:
00059   virtual ~IdentifiedType();
00060 
00067   bool equals(const IdentifiedType* rhs) const;
00068 
00070   void clear();
00071 
00078   QualifiedIdentifier qualifiedIdentifier() const;
00079 
00081   uint hash() const;
00082 
00091   DeclarationId declarationId() const;
00092 
00097   void setDeclarationId(const DeclarationId& id);
00098 
00105   Declaration* declaration(const TopDUContext* top) const;
00106 
00112   DUContext* internalContext(const TopDUContext* top) const;
00113   
00125   void setDeclaration(Declaration* declaration);
00126 
00128   virtual IdentifiedTypeData* idData() = 0;
00130   virtual const IdentifiedTypeData* idData() const = 0;
00131 };
00132 
00135 template<class Parent>
00136 class KDEVPLATFORMLANGUAGE_EXPORT MergeIdentifiedType : public Parent, public IdentifiedType {
00137   public:
00138 
00139     class Data : public Parent::Data, public IdentifiedTypeData {
00140     };
00141 
00142     MergeIdentifiedType() {
00143     }
00144 
00145 
00146     MergeIdentifiedType(Data& data) : Parent(data) {
00147     }
00148 
00149     virtual IdentifiedTypeData* idData() {
00150       return static_cast<Data*>(this->d_func_dynamic());
00151     }
00152 
00153     virtual const IdentifiedTypeData* idData() const {
00154       return static_cast<const Data*>(this->d_func());
00155     }
00156 
00157     virtual bool equals(const KDevelop::AbstractType* rhs) const
00158     {
00159       if (!Parent::equals(rhs))
00160         return false;
00161 
00162       const IdentifiedType* rhsId = dynamic_cast<const IdentifiedType*>(rhs);
00163       Q_ASSERT(rhsId);
00164 
00165       return IdentifiedType::equals(static_cast<const IdentifiedType*>(rhsId));
00166     }
00167 
00168   private:
00169     MergeIdentifiedType(const MergeIdentifiedType& rhs);
00170 };
00171 
00172 }
00173 
00174 #endif
00175 
00176 // kate: space-indent on; indent-width 2; tab-width 4; replace-tabs on; auto-insert-doxygen on

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