kdevplatform/language/duchain
#include <duchainbase.h>

Public Types | |
enum | { Identity = 1 } |
Public Member Functions | |
DUChainBase (const RangeInRevision &range) | |
DUChainBase (DUChainBaseData &dd) | |
virtual | ~DUChainBase () |
PersistentMovingRange::Ptr | createRangeMoving () const |
void | makeDynamic () |
DUChainBase & | operator= (const DUChainBase &rhs)=delete |
RangeInRevision | range () const |
KTextEditor::Range | rangeInCurrentRevision () const |
virtual void | setData (DUChainBaseData *, bool constructorCalled=true) |
void | setRange (const RangeInRevision &range) |
virtual TopDUContext * | topContext () const |
KTextEditor::Cursor | transformFromLocalRevision (const CursorInRevision &cursor) const |
KTextEditor::Range | transformFromLocalRevision (const RangeInRevision &range) const |
CursorInRevision | transformToLocalRevision (const KTextEditor::Cursor &cursor) const |
RangeInRevision | transformToLocalRevision (const KTextEditor::Range &range) const |
virtual IndexedString | url () const |
const QExplicitlySharedDataPointer< DUChainPointerData > & | weakPointer () const |
Protected Member Functions | |
DUChainBase (DUChainBase &rhs) | |
DUChainBase (DUChainBaseData &dd, const RangeInRevision &range) | |
virtual void | rebuildDynamicData (DUContext *parent, uint ownIndex) |
Protected Attributes | |
DUChainBaseData * | d_ptr |
Detailed Description
Base class for definition-use chain objects.
This class provides a thread safe pointer type to reference duchain objects while the DUChain mutex is not held (
- See also
- DUChainPointer)
Definition at line 131 of file duchainbase.h.
Member Enumeration Documentation
◆ anonymous enum
anonymous enum |
Enumerator | |
---|---|
Identity |
Definition at line 156 of file duchainbase.h.
Constructor & Destructor Documentation
◆ DUChainBase() [1/4]
|
explicit |
Constructor.
- Parameters
-
range range of the alias declaration's identifier
Definition at line 44 of file duchainbase.cpp.
◆ ~DUChainBase()
|
virtual |
Destructor.
Definition at line 94 of file duchainbase.cpp.
◆ DUChainBase() [2/4]
|
explicit |
Definition at line 57 of file duchainbase.cpp.
◆ DUChainBase() [3/4]
|
protected |
Creates a duchain object that uses the data of the given one, and will not delete it on destruction.
The data will be shared, and this object must be deleted before the given one is.
Definition at line 62 of file duchainbase.cpp.
◆ DUChainBase() [4/4]
|
protected |
Constructor for copy constructors in subclasses.
- Parameters
-
dd data to use. range text range which this object covers.
Definition at line 51 of file duchainbase.cpp.
Member Function Documentation
◆ createRangeMoving()
PersistentMovingRange::Ptr KDevelop::DUChainBase::createRangeMoving | ( | ) | const |
Returns the range assigned to this object, transformed into the current revision of the document.
The returned object is unique at each call, so you can use it and change it in whatever way you want.
- Warning
- This must only be called from the foreground thread, or with the foreground lock acquired.
Definition at line 170 of file duchainbase.cpp.
◆ makeDynamic()
void KDevelop::DUChainBase::makeDynamic | ( | ) |
After this was called, the data-pointer is dynamic. It is cloned if needed.
Definition at line 132 of file duchainbase.cpp.
◆ operator=()
|
delete |
◆ range()
RangeInRevision KDevelop::DUChainBase::range | ( | ) | const |
Returns the range assigned to this object, in the document revision when this document was last parsed.
Definition at line 152 of file duchainbase.cpp.
◆ rangeInCurrentRevision()
KTextEditor::Range KDevelop::DUChainBase::rangeInCurrentRevision | ( | ) | const |
Returns the range assigned to this object, transformed into the current revision of the document.
- Warning
- This must only be called from the foreground thread, or with the foreground lock acquired.
Definition at line 157 of file duchainbase.cpp.
◆ rebuildDynamicData()
|
protectedvirtual |
Called after loading to rebuild the dynamic data. If this is a context, this should recursively work on all sub-contexts.
Reimplemented in KDevelop::TopDUContext.
Definition at line 126 of file duchainbase.cpp.
◆ setData()
|
virtual |
This must only be used to change the storage-location or storage-kind(dynamic/constant) of the data, but the data must always be equal!
Definition at line 77 of file duchainbase.cpp.
◆ setRange()
void KDevelop::DUChainBase::setRange | ( | const RangeInRevision & | range | ) |
Changes the range assigned to this object, in the document revision when this document is parsed.
Definition at line 224 of file duchainbase.cpp.
◆ topContext()
|
virtual |
Determine the top context to which this object belongs.
- Todo:
- Move the reference to the top-context right into this class, as it's common to all inheriters
Reimplemented in KDevelop::DUContext, KDevelop::Problem, KDevelop::ParsingEnvironmentFile, KDevelop::TopDUContext, and KDevelop::Declaration.
Definition at line 105 of file duchainbase.cpp.
◆ transformFromLocalRevision() [1/2]
KTextEditor::Cursor KDevelop::DUChainBase::transformFromLocalRevision | ( | const CursorInRevision & | cursor | ) | const |
◆ transformFromLocalRevision() [2/2]
KTextEditor::Range KDevelop::DUChainBase::transformFromLocalRevision | ( | const RangeInRevision & | range | ) | const |
◆ transformToLocalRevision() [1/2]
CursorInRevision KDevelop::DUChainBase::transformToLocalRevision | ( | const KTextEditor::Cursor & | cursor | ) | const |
Transforms the given cursor in the current document revision to its according position in the parsed document containing this duchain object.
The resulting cursor will be directly comparable to the non-translated range() members in the duchain, but only for one duchain locking cycle.
- Warning
- This must only be called from the foreground thread, or with the foreground lock acquired.
Definition at line 176 of file duchainbase.cpp.
◆ transformToLocalRevision() [2/2]
RangeInRevision KDevelop::DUChainBase::transformToLocalRevision | ( | const KTextEditor::Range & | range | ) | const |
Transforms the given range in the current document revision to its according position in the parsed document containing this duchain object.
The resulting cursor will be directly comparable to the non-translated range() members in the duchain, but only for one duchain locking cycle.
- Warning
- This must only be called from the foreground thread, or with the foreground lock acquired.
Definition at line 188 of file duchainbase.cpp.
◆ url()
|
virtual |
Reimplemented in KDevelop::Problem, KDevelop::ParsingEnvironmentFile, and KDevelop::TopDUContext.
Definition at line 68 of file duchainbase.cpp.
◆ weakPointer()
const QExplicitlySharedDataPointer< DUChainPointerData > & KDevelop::DUChainBase::weakPointer | ( | ) | const |
Returns a special pointer that can be used to track the existence of a du-chain object across locking-cycles.
- See also
- DUChainPointerData
Definition at line 115 of file duchainbase.cpp.
Member Data Documentation
◆ d_ptr
|
protected |
Data pointer that is shared across all the inheritance hierarchy.
Definition at line 221 of file duchainbase.h.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2021 The KDE developers.
Generated on Sun Mar 7 2021 23:29:31 by doxygen 1.8.16 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.