• 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
indexedtopducontext.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 "indexedtopducontext.h"
20 
21 #include "duchain.h"
22 
23 using namespace KDevelop;
24 
25 IndexedTopDUContext::IndexedTopDUContext(TopDUContext* context)
26 {
27  if (context)
28  m_index = context->ownIndex();
29  else
30  m_index = DummyMask;
31 }
32 
33 bool IndexedTopDUContext::isLoaded() const
34 {
35  if (index())
36  return DUChain::self()->isInMemory(index());
37  else
38  return false;
39 }
40 
41 IndexedString IndexedTopDUContext::url() const
42 {
43  if (index())
44  return DUChain::self()->urlForIndex(index());
45  else
46  return IndexedString();
47 }
48 
49 TopDUContext* IndexedTopDUContext::data() const
50 {
51 // ENSURE_CHAIN_READ_LOCKED
52  if (index())
53  return DUChain::self()->chainForIndex(index());
54  else
55  return nullptr;
56 }
KDevelop::DUChain::urlForIndex
IndexedString urlForIndex(uint index) const
Returns the url for the given top-context index if available. This does have some cost,...
Definition: duchain.cpp:1399
KDevelop::DUChain::chainForIndex
TopDUContext * chainForIndex(uint index)
Returns the top-context that has the given index assigned, or zero if it doesn't exist.
Definition: duchain.h:177
KDevelop::TopDUContext::ownIndex
uint ownIndex() const
Definition: topducontext.cpp:537
KDevelop::IndexedTopDUContext::DummyMask
Definition: indexedtopducontext.h:46
KDevelop::DUChain::isInMemory
bool isInMemory(uint topContextIndex) const
Returns whether the top-context with the given index is currently loaded in memory.
Definition: duchain.cpp:1394
KDevelop::IndexedTopDUContext::url
IndexedString url() const
Definition: indexedtopducontext.cpp:41
KDevelop::IndexedTopDUContext::isLoaded
bool isLoaded() const
Returns whether the top-context is currently loaded.
Definition: indexedtopducontext.cpp:33
KDevelop::IndexedTopDUContext::index
uint index() const
Definition: indexedtopducontext.h:85
KDevelop::TopDUContext
The top context in a definition-use chain for one source file.
Definition: topducontext.h:113
KDevelop::IndexedTopDUContext::IndexedTopDUContext
IndexedTopDUContext(uint index)
Definition: indexedtopducontext.h:38
indexedtopducontext.h
KDevelop::IndexedTopDUContext::data
TopDUContext * data() const
Returns the top-context represented by this indexed top-context.
Definition: indexedtopducontext.cpp:49
duchain.h
KDevelop
Definition: abstractfunctiondeclaration.cpp:27
KDevelop::DUChain::self
static DUChain * self()
Returns the global static instance.
Definition: duchain.cpp:1230
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