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

kdevelop/kdevplatform/language/duchain

  • extragear
  • kdevelop
  • kdevelop
  • kdevplatform
  • language
  • duchain
localindexeddeclaration.cpp
Go to the documentation of this file.
1 /* This file is part of KDevelop
2  Copyright 2007 David Nolden <[email protected]>
3 
4  This library is free software; you can redistribute it and/or
5  modify it under the terms of the GNU Library General Public
6  License version 2 as published by the Free Software Foundation.
7 
8  This library is distributed in the hope that it will be useful,
9  but WITHOUT ANY WARRANTY; without even the implied warranty of
10  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11  Library General Public License for more details.
12 
13  You should have received a copy of the GNU Library General Public License
14  along with this library; see the file COPYING.LIB. If not, write to
15  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
16  Boston, MA 02110-1301, USA.
17  */
18 
19 #include "localindexeddeclaration.h"
20 
21 #include "declaration.h"
22 #include "topducontextdynamicdata.h"
23 #include "topducontext.h"
24 
25 using namespace KDevelop;
26 
27 LocalIndexedDeclaration::LocalIndexedDeclaration(Declaration* decl)
28  : m_declarationIndex(decl ? decl->m_indexInTopContext : 0)
29 {
30 }
31 
32 LocalIndexedDeclaration::LocalIndexedDeclaration(uint declarationIndex)
33  : m_declarationIndex(declarationIndex)
34 {
35 }
36 
37 Declaration* LocalIndexedDeclaration::data(TopDUContext* top) const
38 {
39  if (!m_declarationIndex)
40  return nullptr;
41  Q_ASSERT(top);
42  return top->m_dynamicData->declarationForIndex(m_declarationIndex);
43 }
44 
45 bool LocalIndexedDeclaration::isLoaded(TopDUContext* top) const
46 {
47  if (!m_declarationIndex)
48  return false;
49 
50  Q_ASSERT(top);
51  return top->m_dynamicData->isDeclarationForIndexLoaded(m_declarationIndex);
52 }
KDevelop::Declaration
Represents a single declaration in a definition-use chain.
Definition: declaration.h:51
localindexeddeclaration.h
KDevelop::LocalIndexedDeclaration::LocalIndexedDeclaration
LocalIndexedDeclaration(Declaration *decl=nullptr)
Definition: localindexeddeclaration.cpp:27
KDevelop::TopDUContext
The top context in a definition-use chain for one source file.
Definition: topducontext.h:113
declaration.h
KDevelop::TopDUContextDynamicData::declarationForIndex
Declaration * declarationForIndex(uint index) const
Definition: topducontextdynamicdata.cpp:850
KDevelop::LocalIndexedDeclaration::isLoaded
bool isLoaded(TopDUContext *top) const
Definition: localindexeddeclaration.cpp:45
KDevelop::LocalIndexedDeclaration::data
Declaration * data(TopDUContext *top) const
Definition: localindexeddeclaration.cpp:37
KDevelop::TopDUContext::m_dynamicData
class TopDUContextDynamicData * m_dynamicData
Definition: topducontext.h:380
topducontext.h
topducontextdynamicdata.h
KDevelop::TopDUContextDynamicData::isDeclarationForIndexLoaded
bool isDeclarationForIndexLoaded(uint index) const
Definition: topducontextdynamicdata.cpp:818
This file is part of the KDE documentation.
Documentation copyright © 1996-2019 The KDE developers.
Generated on Thu Dec 12 2019 03:33:28 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kdevelop/kdevplatform/language/duchain

Skip menu "kdevelop/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