• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdevelop API Reference
  • KDE Home
  • Contact Us
 

kdevplatform/language/duchain

  • sources
  • kfour-appscomplete
  • kdevelop
  • kdevplatform
  • language
  • duchain
classfunctiondeclaration.h
Go to the documentation of this file.
1 /* This file is part of KDevelop
2  Copyright 2002-2005 Roberto Raggi <[email protected]>
3  Copyright 2006 Adam Treat <[email protected]>
4  Copyright 2006 Hamish Rodda <[email protected]>
5  Copyright 2007-2008 David Nolden <[email protected]>
6 
7  This library is free software; you can redistribute it and/or
8  modify it under the terms of the GNU Library General Public
9  License version 2 as published by the Free Software Foundation.
10 
11  This library is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  Library General Public License for more details.
15 
16  You should have received a copy of the GNU Library General Public License
17  along with this library; see the file COPYING.LIB. If not, write to
18  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19  Boston, MA 02110-1301, USA.
20  */
21 
22 #ifndef KDEVPLATFORM_CLASSFUNCTIONDECLARATION_H
23 #define KDEVPLATFORM_CLASSFUNCTIONDECLARATION_H
24 
25 #include "classmemberdeclaration.h"
26 #include "abstractfunctiondeclaration.h"
27 #include "classmemberdeclarationdata.h"
28 
29 namespace KDevelop {
30 enum ClassFunctionFlag
31 {
32  FunctionFlagNormal = 0,
33  FunctionSignalFlag = 1 << 1,
34  FunctionSlotFlag = 1 << 2,
35  AbstractFunctionFlag = 1 << 3,
36  FinalFunctionFlag = 1 << 4
37 };
38 Q_DECLARE_FLAGS(ClassFunctionFlags, ClassFunctionFlag)
39 
40 KDEVPLATFORMLANGUAGE_EXPORT DECLARE_LIST_MEMBER_HASH(ClassFunctionDeclarationData, m_defaultParameters, IndexedString)
41 
42 class KDEVPLATFORMLANGUAGE_EXPORT ClassFunctionDeclarationData
43  : public ClassMemberDeclarationData
44  , public AbstractFunctionDeclarationData
45 {
46 public:
47  ClassFunctionDeclarationData()
48  {
49  initializeAppendedLists();
50  m_functionFlags = FunctionFlagNormal;
51  }
52  ClassFunctionDeclarationData(const ClassFunctionDeclarationData& rhs)
53  : ClassMemberDeclarationData(rhs)
54  , AbstractFunctionDeclarationData(rhs)
55  {
56  initializeAppendedLists();
57  copyListsFrom(rhs);
58  m_functionFlags = rhs.m_functionFlags;
59  }
60  ~ClassFunctionDeclarationData()
61  {
62  freeAppendedLists();
63  }
64  ClassFunctionDeclarationData& operator=(const ClassFunctionDeclarationData& rhs) = delete;
65  ClassFunctionFlags m_functionFlags;
66  START_APPENDED_LISTS_BASE(ClassFunctionDeclarationData, ClassMemberDeclarationData);
67  APPENDED_LIST_FIRST(ClassFunctionDeclarationData, IndexedString, m_defaultParameters);
68  END_APPENDED_LISTS(ClassFunctionDeclarationData, m_defaultParameters);
69 };
73 using ClassFunctionDeclarationBase = MergeAbstractFunctionDeclaration<ClassMemberDeclaration, ClassFunctionDeclarationData>;
74 class KDEVPLATFORMLANGUAGE_EXPORT ClassFunctionDeclaration
75  : public ClassFunctionDeclarationBase
76 {
77 public:
78  ClassFunctionDeclaration(const RangeInRevision& range, DUContext* context);
79  ClassFunctionDeclaration(ClassFunctionDeclarationData& data, const RangeInRevision& range, DUContext* context);
80  explicit ClassFunctionDeclaration(ClassFunctionDeclarationData& data);
81  ~ClassFunctionDeclaration() override;
82 
84  bool isSignal() const;
85  void setIsSignal(bool);
86 
88  bool isSlot() const;
89  void setIsSlot(bool);
90 
92  bool isAbstract() const;
93  void setIsAbstract(bool);
94 
96  bool isFinal() const;
97  void setIsFinal(bool);
98 
99  virtual bool isConstructor() const;
100  virtual bool isDestructor() const;
101 
102  bool isConversionFunction() const;
103 
104  bool isFunctionDeclaration() const override;
105 
106  QString toString() const override;
107 
108  void setAbstractType(AbstractType::Ptr type) override;
109 
110  Declaration* clonePrivate() const override;
111 
112  uint additionalIdentity() const override;
113 
114  const IndexedString* defaultParameters() const override;
115  unsigned int defaultParametersSize() const override;
116  void addDefaultParameter(const IndexedString& str) override;
117  void clearDefaultParameters() override;
118 
119  enum {
120  Identity = 14
121  };
122 
123 protected:
124  ClassFunctionDeclaration(const ClassFunctionDeclaration& rhs);
125 
126 private:
127  DUCHAIN_DECLARE_DATA(ClassFunctionDeclaration)
128 };
129 }
130 
131 #endif // KDEVPLATFORM_CLASSFUNCTIONDECLARATION_H
APPENDED_LIST_FIRST
#define APPENDED_LIST_FIRST(container, type, name)
Definition: appendedlist.h:321
KDevelop::ClassFunctionFlag
ClassFunctionFlag
Definition: classfunctiondeclaration.h:30
KDevelop::FunctionSlotFlag
Definition: classfunctiondeclaration.h:34
START_APPENDED_LISTS_BASE
#define START_APPENDED_LISTS_BASE(container, base)
Use this if one of the base-classes of the container also has the appended lists interfaces implement...
Definition: appendedlist.h:257
KDevelop::TypePtr< AbstractType >
KDevelop::ClassFunctionDeclaration
Definition: classfunctiondeclaration.h:74
classmemberdeclaration.h
DUCHAIN_DECLARE_DATA
#define DUCHAIN_DECLARE_DATA(Class)
Use this to declare the data functions in your DUChainBase based class.
Definition: duchainbase.h:41
KDevelop::Declaration
Represents a single declaration in a definition-use chain.
Definition: declaration.h:51
KDevelop::DECLARE_LIST_MEMBER_HASH
KDEVPLATFORMLANGUAGE_EXPORT DECLARE_LIST_MEMBER_HASH(DUContextData, m_childContexts, LocalIndexedDUContext) KDEVPLATFORMLANGUAGE_EXPORT DECLARE_LIST_MEMBER_HASH(DUContextData
QString
KDevelop::AbstractFunctionFlag
Definition: classfunctiondeclaration.h:35
KDevelop::FunctionSignalFlag
Definition: classfunctiondeclaration.h:33
KDevelop::MergeAbstractFunctionDeclaration
Use this to merge AbstractFunctionDeclaration into the class hierarchy.
Definition: abstractfunctiondeclaration.h:107
KDevelop::FinalFunctionFlag
Definition: classfunctiondeclaration.h:36
END_APPENDED_LISTS
#define END_APPENDED_LISTS(container, predecessor)
Definition: appendedlist.h:358
KDevelop::FunctionFlagNormal
Definition: classfunctiondeclaration.h:32
abstractfunctiondeclaration.h
classmemberdeclarationdata.h
KDevelop
Definition: abstractfunctiondeclaration.cpp:27
KDevelop::DUContext
A single context in source code, represented as a node in a directed acyclic graph.
Definition: ducontext.h:72
ClassFunctionDeclarationBase
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Thu Mar 4 2021 23:31:17 by doxygen 1.8.16 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kdevplatform/language/duchain

Skip menu "kdevplatform/language/duchain"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdevelop API Reference

Skip menu "kdevelop API Reference"
  • kdevplatform
  •   debugger
  •   documentation
  •   interfaces
  •   language
  •     assistant
  •     backgroundparser
  •     checks
  •     classmodel
  •     codecompletion
  •     codegen
  •     duchain
  •     editor
  •     highlighting
  •     interfaces
  •     util
  •   outputview
  •   project
  •   serialization
  •   shell
  •   sublime
  •   tests
  •   util
  •   vcs

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal