1 /***************************************************************************
2 * This file is part of KDevelop *
3 * Copyright 2008 David Nolden <david.nolden.kdevelop@art-master.de> *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU Library General Public License as *
7 * published by the Free Software Foundation; either version 2 of the *
8 * License, or (at your option) any later version. *
10 * This program 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 *
13 * GNU General Public License for more details. *
15 * You should have received a copy of the GNU Library General Public *
16 * License along with this program; if not, write to the *
17 * Free Software Foundation, Inc., *
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
19 ***************************************************************************/
21 #ifndef TOPDUCONTEXTDATA_H
22 #define TOPDUCONTEXTDATA_H
24 #include "ducontextdata.h"
25 #include "topducontext.h"
26 #include "indexedstring.h"
27 #include "declarationid.h"
31 KDEVPLATFORMLANGUAGE_EXPORT
DECLARE_LIST_MEMBER_HASH(TopDUContextData
, m_usedDeclarationIds
, DeclarationId
)
33 class KDEVPLATFORMLANGUAGE_EXPORT TopDUContextData
: public DUContextData
36 TopDUContextData(IndexedString url
)
37 : DUContextData(), m_flags(TopDUContext::NoFlags
), m_deleting(false), m_url(url
), m_currentUsedDeclarationIndex(0)
39 initializeAppendedLists();
41 TopDUContextData(const TopDUContextData
& rhs
) :DUContextData(rhs
), m_deleting(false) {
42 initializeAppendedLists();
44 m_features
= rhs
.m_features
;
45 m_flags
= rhs
.m_flags
;
47 m_language
= rhs
.m_language
;
48 m_currentUsedDeclarationIndex
= rhs
.m_currentUsedDeclarationIndex
;
54 TopDUContext::Flags m_flags
;
56 TopDUContext::Features m_features
;
58 bool m_deleting
: 1; ///@todo remove
61 IndexedString m_language
;
63 ///Is used to count up the used declarations while building uses
64 uint m_currentUsedDeclarationIndex
;
66 START_APPENDED_LISTS_BASE(TopDUContextData
, DUContextData
);
67 ///Maps a declarationIndex to a DeclarationId, which is used when the entry in m_usedDeclaration is zero.
68 APPENDED_LIST_FIRST(TopDUContextData
, DeclarationId
, m_usedDeclarationIds
);
69 END_APPENDED_LISTS(TopDUContextData
, m_usedDeclarationIds
);