• 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
functiondeclaration.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-2007 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_FUNCTIONDECLARATION_H
23 #define KDEVPLATFORM_FUNCTIONDECLARATION_H
24 
25 #include "declaration.h"
26 #include "abstractfunctiondeclaration.h"
27 #include "declarationdata.h"
28 
29 namespace KDevelop {
30 KDEVPLATFORMLANGUAGE_EXPORT DECLARE_LIST_MEMBER_HASH(FunctionDeclarationData, m_defaultParameters, IndexedString)
31 
32 class KDEVPLATFORMLANGUAGE_EXPORT FunctionDeclarationData
33  : public DeclarationData
34  , public AbstractFunctionDeclarationData
35 {
36 public:
37  FunctionDeclarationData()
38  {
39  initializeAppendedLists();
40  }
41  FunctionDeclarationData(const FunctionDeclarationData& rhs)
42  : DeclarationData(rhs)
43  , AbstractFunctionDeclarationData(rhs)
44  {
45  initializeAppendedLists();
46  copyListsFrom(rhs);
47  }
48  ~FunctionDeclarationData()
49  {
50  freeAppendedLists();
51  }
52  FunctionDeclarationData& operator=(const FunctionDeclarationData& rhs) = delete;
53 
54  START_APPENDED_LISTS_BASE(FunctionDeclarationData, DeclarationData);
55  APPENDED_LIST_FIRST(FunctionDeclarationData, IndexedString, m_defaultParameters);
56  END_APPENDED_LISTS(FunctionDeclarationData, m_defaultParameters);
57 };
61 using FunctionDeclarationBase = MergeAbstractFunctionDeclaration<Declaration, FunctionDeclarationData>;
62 class KDEVPLATFORMLANGUAGE_EXPORT FunctionDeclaration
63  : public FunctionDeclarationBase
64 {
65 public:
66  FunctionDeclaration(const FunctionDeclaration& rhs);
67  FunctionDeclaration(const RangeInRevision& range, DUContext* context);
68  explicit FunctionDeclaration(FunctionDeclarationData& data);
69  FunctionDeclaration(FunctionDeclarationData& data, const KDevelop::RangeInRevision&);
70  ~FunctionDeclaration() override;
71 
72  FunctionDeclaration& operator=(const FunctionDeclaration& rhs) = delete;
73 
74  void setAbstractType(AbstractType::Ptr type) override;
75 
76  QString toString() const override;
77 
78  bool isFunctionDeclaration() const override;
79 
80  uint additionalIdentity() const override;
81 
82  const IndexedString* defaultParameters() const override;
83  unsigned int defaultParametersSize() const override;
84  void addDefaultParameter(const IndexedString& str) override;
85  void clearDefaultParameters() override;
86 
87  enum {
88  Identity = 12
89  };
90 
91  using Base = Declaration;
92 
93 private:
94  Declaration* clonePrivate() const override;
95  DUCHAIN_DECLARE_DATA(FunctionDeclaration)
96 };
97 }
98 
99 #endif // KDEVPLATFORM_FUNCTIONDECLARATION_H
APPENDED_LIST_FIRST
#define APPENDED_LIST_FIRST(container, type, name)
Definition: appendedlist.h:321
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 >
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
declaration.h
declarationdata.h
QString
KDevelop::MergeAbstractFunctionDeclaration
Use this to merge AbstractFunctionDeclaration into the class hierarchy.
Definition: abstractfunctiondeclaration.h:107
END_APPENDED_LISTS
#define END_APPENDED_LISTS(container, predecessor)
Definition: appendedlist.h:358
abstractfunctiondeclaration.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
KDevelop::FunctionDeclaration
Definition: functiondeclaration.h:62
FunctionDeclarationData
FunctionDeclarationBase
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Wed Mar 3 2021 00:37:28 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