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

language/duchain

instantiationinformation.h

00001 /* This file is part of KDevelop
00002     Copyright 2007-2009 David Nolden <david.nolden.kdevelop@art-master.de>
00003 
00004    This library is free software; you can redistribute it and/or
00005    modify it under the terms of the GNU Library General Public
00006    License version 2 as published by the Free Software Foundation.
00007 
00008    This library is distributed in the hope that it will be useful,
00009    but WITHOUT ANY WARRANTY; without even the implied warranty of
00010    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00011    Library General Public License for more details.
00012 
00013    You should have received a copy of the GNU Library General Public License
00014    along with this library; see the file COPYING.LIB.  If not, write to
00015    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00016    Boston, MA 02110-1301, USA.
00017 */
00018 
00019 #ifndef INSTANTIATIONINFORMATION_H
00020 #define INSTANTIATIONINFORMATION_H
00021 
00022 #include "../languageexport.h"
00023 #include "types/abstracttype.h"
00024 #include "types/indexedtype.h"
00025 #include "appendedlist.h"
00026 #include "referencecounting.h"
00027 
00028 namespace KDevelop {
00029   class IndexedInstantiationInformation;
00030   class InstantiationInformation;
00031   class QualifiedIdentifier;
00032   
00033   KDEVPLATFORMLANGUAGE_EXPORT DECLARE_LIST_MEMBER_HASH(InstantiationInformation, templateParameters, IndexedType)
00034   
00035   class KDEVPLATFORMLANGUAGE_EXPORT IndexedInstantiationInformation : public ReferenceCountManager {
00036     public:
00037       IndexedInstantiationInformation();
00038       explicit IndexedInstantiationInformation(uint index);
00039       IndexedInstantiationInformation(const IndexedInstantiationInformation& rhs);
00040       IndexedInstantiationInformation& operator=(const IndexedInstantiationInformation& rhs);
00041       ~IndexedInstantiationInformation();
00042       
00043       const InstantiationInformation& information() const;
00044       
00045       uint hash() const {
00046         return m_index * 73;
00047       }
00048       
00049       //Is always zero for the empty information
00050       uint index() const {
00051         return m_index;
00052       }
00053       
00054       bool operator==(const IndexedInstantiationInformation& rhs) const {
00055         return m_index == rhs.m_index;
00056       }
00057       
00058       //Returns true if one of the values represented by this information is non-default
00059       bool isValid() const;
00060     
00061     private:
00062       uint m_index;
00063   };  
00064   
00065   class KDEVPLATFORMLANGUAGE_EXPORT InstantiationInformation {
00066   public:
00067 
00068     InstantiationInformation();
00070     InstantiationInformation(const InstantiationInformation& rhs, bool dynamic = true);
00071     
00072     ~InstantiationInformation();
00073     
00074     InstantiationInformation& operator=(const InstantiationInformation& rhs);
00075 
00076     bool operator==(const InstantiationInformation& rhs) const;
00077     
00078     uint hash() const;
00079     
00080     bool isValid() const {
00081       return previousInstantiationInformation.index() || templateParametersSize();
00082     }
00083     
00084     bool persistent() const {
00085       return (bool)m_refCount;
00086     }
00087     
00092     QualifiedIdentifier applyToIdentifier(const QualifiedIdentifier& id) const;
00093     
00095     QString toString(bool local = false) const;
00096     
00098     void addTemplateParameter(AbstractType::Ptr type);
00099     
00101     IndexedInstantiationInformation previousInstantiationInformation;
00102     
00103     START_APPENDED_LISTS(InstantiationInformation)
00104     
00105     static size_t classSize() {
00106       return sizeof(InstantiationInformation);
00107     }
00108     
00109     short unsigned int itemSize() const {
00110       return dynamicSize();
00111     }
00112     
00114     APPENDED_LIST_FIRST(InstantiationInformation, IndexedType, templateParameters);
00115     
00116     END_APPENDED_LISTS(InstantiationInformation, templateParameters);
00117     
00118     IndexedInstantiationInformation indexed() const;
00119     private:
00120       friend class IndexedInstantiationInformation;
00121       uint m_refCount;
00122   };
00123   
00124   inline uint qHash(const IndexedInstantiationInformation& info) {
00125     return info.hash();
00126   }
00127   inline uint qHash(const InstantiationInformation& info) {
00128     return info.hash();
00129   }
00130 }
00131 
00132 #endif // INSTANTIATIONINFORMATION_H

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