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

language/duchain

duchainbase.h

00001 /* This file is part of KDevelop
00002     Copyright 2006 Hamish Rodda <rodda@kde.org>
00003     Copyright 2007/2008 David Nolden <david.nolden.kdevelop@art-master.de>
00004 
00005    This library is free software; you can redistribute it and/or
00006    modify it under the terms of the GNU Library General Public
00007    License version 2 as published by the Free Software Foundation.
00008 
00009    This library is distributed in the hope that it will be useful,
00010    but WITHOUT ANY WARRANTY; without even the implied warranty of
00011    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012    Library General Public License for more details.
00013 
00014    You should have received a copy of the GNU Library General Public License
00015    along with this library; see the file COPYING.LIB.  If not, write to
00016    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00017    Boston, MA 02110-1301, USA.
00018 */
00019 
00020 #ifndef DUCHAINBASE_H
00021 #define DUCHAINBASE_H
00022 
00023 #include "../editor/documentrangeobject.h"
00024 #include "../editor/hashedstring.h"
00025 #include "../languageexport.h"
00026 #include "appendedlist.h"
00027 #include "duchainpointer.h"
00028 
00029 namespace KDevelop
00030 {
00031 
00032 class DUContext;
00033 class TopDUContext;
00034 class DUChainBase;
00035 class IndexedString;
00036 
00038 #define DUCHAIN_DECLARE_DATA(Class) \
00039     inline class Class##Data* d_func_dynamic() { makeDynamic(); return reinterpret_cast<Class##Data *>(d_ptr); } \
00040     inline const class Class##Data* d_func() const { return reinterpret_cast<const Class##Data *>(d_ptr); } \
00041     public: typedef Class ## Data Data; private:
00042 
00043 #define DUCHAIN_D(Class) const Class##Data * const d = d_func()
00044 #define DUCHAIN_D_DYNAMIC(Class) Class##Data * const d = d_func_dynamic()
00045 
00055 class KDEVPLATFORMLANGUAGE_EXPORT DUChainBaseData : public DocumentRangeObjectData {
00056 public:
00057 
00058     DUChainBaseData() : classId(0) {
00059     }
00060     DUChainBaseData(const DUChainBaseData& rhs) : DocumentRangeObjectData(rhs), classId(rhs.classId) {
00061     }
00062     
00063     uint classId;
00064 
00071     template<class T>
00072     void setClassId(T*) {
00073       classId = T::Identity;
00074     }
00075       
00076     uint classSize() const;
00077 
00080     void freeDynamicData() {
00081     }
00082     
00086   static bool shouldCreateConstantData();
00087   static void setShouldCreateConstantData(bool);
00088 };
00089 
00097 class KDEVPLATFORMLANGUAGE_EXPORT DUChainBase : public KDevelop::DocumentRangeObject
00098 {
00099 public:
00106   DUChainBase(const SimpleRange& range);
00108   virtual ~DUChainBase();
00109 
00113   virtual TopDUContext* topContext() const;
00114 
00119   const KSharedPtr<DUChainPointerData>& weakPointer() const;
00120 
00121   virtual IndexedString url() const;
00122   
00123   enum {
00124     Identity = 1
00125   };
00126   
00128   void makeDynamic();
00129   
00130   DUChainBase( DUChainBaseData& dd );
00131   
00134   virtual void setData(DocumentRangeObjectData*, bool constructorCalled = true);
00135   
00136 protected:
00141   DUChainBase( DUChainBase& rhs );
00142 
00150   DUChainBase( DUChainBaseData& dd, const SimpleRange& range );
00151 
00153   virtual void rebuildDynamicData(DUContext* parent, uint ownIndex);
00154   
00155   void aboutToWriteData();
00156   
00157   //Reimplemented to make prevent DocumentRangeObject from writing the data when it is un-writable
00158   virtual bool canWriteData() const;
00159 private:
00160   
00161   mutable KSharedPtr<DUChainPointerData> m_ptr;
00162 public:
00163   DUCHAIN_DECLARE_DATA(DUChainBase)
00164 };
00165 }
00166 
00167 #endif // DUCHAINBASE_H
00168 
00169 // 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