1 /* This file is part of KDevelop
2 Copyright 2002-2005 Roberto Raggi <roberto@kdevelop.org>
3 Copyright 2006 Adam Treat <treat@kde.org>
4 Copyright 2006-2007 Hamish Rodda <rodda@kde.org>
6 This library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Library General Public
8 License version 2 as published by the Free Software Foundation.
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details.
15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 Boston, MA 02110-1301, USA.
21 #ifndef FUNCTIONDECLARATION_H
22 #define FUNCTIONDECLARATION_H
24 #include "declaration.h"
25 #include "abstractfunctiondeclaration.h"
26 #include "declarationdata.h"
30 KDEVPLATFORMLANGUAGE_EXPORT
DECLARE_LIST_MEMBER_HASH(FunctionDeclarationData
, m_defaultParameters
, IndexedString
)
32 class KDEVPLATFORMLANGUAGE_EXPORT FunctionDeclarationData
: public DeclarationData
, public AbstractFunctionDeclarationData
35 FunctionDeclarationData()
37 initializeAppendedLists();
39 FunctionDeclarationData( const FunctionDeclarationData
& rhs
)
40 :DeclarationData( rhs
), AbstractFunctionDeclarationData(rhs
)
42 initializeAppendedLists();
45 ~FunctionDeclarationData()
50 START_APPENDED_LISTS_BASE(FunctionDeclarationData
, DeclarationData
);
51 APPENDED_LIST_FIRST(FunctionDeclarationData
, IndexedString
, m_defaultParameters
);
52 END_APPENDED_LISTS(FunctionDeclarationData
, m_defaultParameters
);
55 * Represents a single variable definition in a definition-use chain.
57 typedef MergeAbstractFunctionDeclaration
<Declaration
, FunctionDeclarationData
> FunctionDeclarationBase
;
58 class KDEVPLATFORMLANGUAGE_EXPORT FunctionDeclaration
: public FunctionDeclarationBase
61 FunctionDeclaration(const FunctionDeclaration
& rhs
);
62 FunctionDeclaration(const SimpleRange
& range
, DUContext
* context
);
63 FunctionDeclaration(FunctionDeclarationData
& data
);
64 FunctionDeclaration(FunctionDeclarationData
& data
, const KDevelop::SimpleRange
&);
65 virtual ~FunctionDeclaration();
67 virtual void setAbstractType(AbstractType::Ptr type
);
69 virtual QString
toString() const;
71 virtual bool isFunctionDeclaration() const;
73 virtual uint
additionalIdentity() const;
75 virtual const IndexedString
* defaultParameters() const;
76 virtual int defaultParametersSize() const;
77 virtual void addDefaultParameter(const IndexedString
& str
);
78 virtual void clearDefaultParameters();
84 typedef Declaration Base
;
87 virtual Declaration
* clonePrivate() const;
88 DUCHAIN_DECLARE_DATA(FunctionDeclaration
)
92 #endif // FUNCTIONDECLARATION_H
94 // kate: space-indent on; indent-width 2; tab-width 4; replace-tabs on; auto-insert-doxygen on