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

language/duchain

functiontype.h

00001 /* This file is part of KDevelop
00002     Copyright 2006 Roberto Raggi <roberto@kdevelop.org>
00003     Copyright 2006-2008 Hamish Rodda <rodda@kde.org>
00004     Copyright 2007-2008 David Nolden <david.nolden.kdevelop@art-master.de>
00005 
00006    This library is free software; you can redistribute it and/or
00007    modify it under the terms of the GNU Library General Public
00008    License version 2 as published by the Free Software Foundation.
00009 
00010    This library is distributed in the hope that it will be useful,
00011    but WITHOUT ANY WARRANTY; without even the implied warranty of
00012    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013    Library General Public License for more details.
00014 
00015    You should have received a copy of the GNU Library General Public License
00016    along with this library; see the file COPYING.LIB.  If not, write to
00017    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00018    Boston, MA 02110-1301, USA.
00019 */
00020 
00021 #ifndef FUNCTIONTYPE_H
00022 #define FUNCTIONTYPE_H
00023 
00024 #include "abstracttype.h"
00025 
00026 namespace KDevelop
00027 {
00028 class FunctionTypeData;
00029 
00036 class KDEVPLATFORMLANGUAGE_EXPORT FunctionType : public AbstractType
00037 {
00038 public:
00039   typedef TypePtr<FunctionType> Ptr;
00040 
00042   enum SignaturePart {
00043     SignatureWhole ,
00044     SignatureReturn ,
00045     SignatureArguments 
00047   };
00048 
00050   FunctionType();
00052   FunctionType(const FunctionType& rhs);
00054   FunctionType(FunctionTypeData& data);
00056   ~FunctionType();
00057 
00063   AbstractType::Ptr returnType () const;
00064 
00070   void setReturnType(AbstractType::Ptr returnType);
00071 
00077   QList<AbstractType::Ptr> arguments () const;
00078 
00084   const IndexedType* indexedArguments() const;
00085   
00089   uint indexedArgumentsSize() const;
00090   
00096   void addArgument(AbstractType::Ptr argument);
00097 
00104   void removeArgument(AbstractType::Ptr argument);
00105 
00106   virtual AbstractType* clone() const;
00107 
00108   virtual bool equals(const AbstractType* rhs) const;
00109 
00110   virtual QString toString() const;
00111 
00119   virtual QString partToString( SignaturePart sigPart ) const;
00120 
00121   virtual uint hash() const;
00122 
00123   virtual WhichType whichType() const;
00124 
00125   virtual void exchangeTypes( TypeExchanger* exchanger );
00126 
00127   enum {
00128     Identity = 5
00129   };
00130 
00131   typedef FunctionTypeData Data;
00132 
00133 protected:
00134   virtual void accept0 (TypeVisitor *v) const;
00135 
00136   TYPE_DECLARE_DATA(FunctionType)
00137 };
00138 
00139 template<>
00140 inline FunctionType* fastCast<FunctionType*>(AbstractType* from) {
00141   if(!from || from->whichType() != AbstractType::TypeFunction)
00142     return 0;
00143   else
00144     return static_cast<FunctionType*>(from);
00145 }
00146 
00147 }
00148 
00149 #endif
00150 
00151 // 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