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

language/duchain

abstractfunctiondeclaration.h

00001 /* This file is part of KDevelop
00002     Copyright 2007 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 ABSTRACTFUNCTIONDECLARATION_H
00021 #define ABSTRACTFUNCTIONDECLARATION_H
00022 
00023 #include <QtCore/QString>
00024 #include "../languageexport.h"
00025 #include "indexedstring.h"
00026 
00027 namespace KDevelop
00028 {
00029 class DUContext;
00030 
00031 class AbstractFunctionDeclarationData
00032 {
00033 public:
00034   AbstractFunctionDeclarationData() : m_isVirtual(false), m_isInline(false), m_isExplicit(false) {
00035   }
00036   bool m_isVirtual: 1; 
00037   bool m_isInline: 1;
00038   bool m_isExplicit: 1; 
00039 };
00040 
00045 class KDEVPLATFORMLANGUAGE_EXPORT AbstractFunctionDeclaration
00046 {
00047 public:
00048   virtual ~AbstractFunctionDeclaration();
00049 
00050   enum FunctionSpecifier {
00051     VirtualSpecifier  = 0x1 ,
00052     InlineSpecifier   = 0x2 ,
00053     ExplicitSpecifier = 0x4 
00054   };
00055   Q_DECLARE_FLAGS(FunctionSpecifiers, FunctionSpecifier)
00056 
00057   void setFunctionSpecifiers(FunctionSpecifiers specifiers);
00058 
00059   bool isInline() const;
00060   void setInline(bool isInline);
00061 
00063   bool isVirtual() const;
00064   void setVirtual(bool isVirtual);
00065 
00067   bool isExplicit() const;
00068   void setExplicit(bool isExplicit);
00069   
00073   DUContext* internalFunctionContext() const;
00074   
00082   virtual const IndexedString* defaultParameters() const = 0;
00083   virtual unsigned int defaultParametersSize() const = 0;
00084   virtual void addDefaultParameter(const IndexedString& str) = 0;
00085   virtual void clearDefaultParameters()  = 0;
00088   IndexedString defaultParameterForArgument(int index) const;
00089   
00090 private:
00091   //Must be implemented by sub-classes to provide a pointer to the data
00092   virtual const AbstractFunctionDeclarationData* data() const = 0;
00093   virtual AbstractFunctionDeclarationData* dynamicData() = 0;
00094 };
00095 
00096 Q_DECLARE_OPERATORS_FOR_FLAGS(KDevelop::AbstractFunctionDeclaration::FunctionSpecifiers)
00097 
00101 template<class Base, class _Data>
00102 class MergeAbstractFunctionDeclaration : public Base, public AbstractFunctionDeclaration {
00103   public:
00104   template<class BaseData>
00105   MergeAbstractFunctionDeclaration(BaseData& data) : Base(data) {
00106   }
00107   template<class BaseData, class Arg2>
00108   MergeAbstractFunctionDeclaration(BaseData& data, const Arg2& arg2) : Base(data, arg2) {
00109   }
00110   template<class BaseData, class Arg2, class Arg3>
00111   MergeAbstractFunctionDeclaration(BaseData& data, const Arg2& arg2, const Arg3& arg3) : Base(data, arg2, arg3) {
00112   }
00113   
00114   private:
00115   virtual const AbstractFunctionDeclarationData* data() const {
00116     return static_cast<const _Data*>(Base::d_func());
00117   }
00118   virtual AbstractFunctionDeclarationData* dynamicData() {
00119     return static_cast<_Data*>(Base::d_func_dynamic());
00120   }
00121 };
00122 
00123 }
00124 
00125 #endif // ABSTRACTFUNCTIONDECLARATION_H
00126 
00127 // 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