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

Public Member Functions | |
DUChainPointerData () | |
~DUChainPointerData () | |
DUChainBase * | base () |
DUChainBase * | base () const |
![]() | |
QSharedData () | |
QSharedData (const QSharedData &other) | |
Detailed Description
Whenever the du-chain is unlocked and locked again, any du-chain item may have been deleted in between.
For that reason, the following class should be used to make sure that no deleted objects are accessed. It contains a pointer that will be reset to zero once the pointed object is deleted.
Access to the data must still be serialized through duchain-locking. Using this comes with no additional cost.
In practice this means: Store an instance of DUChainPointer instead of a pointer to the du-chain object. Then, access the eventually still existing object by calling pointer->base().
To make it even more convenient see DUChainPointer
Definition at line 50 of file duchainpointer.h.
Constructor & Destructor Documentation
◆ DUChainPointerData()
KDevelop::DUChainPointerData::DUChainPointerData | ( | ) |
Default-initialization of an invalid reference.
Definition at line 33 of file duchainpointer.cpp.
◆ ~DUChainPointerData()
KDevelop::DUChainPointerData::~DUChainPointerData | ( | ) |
Definition at line 37 of file duchainpointer.cpp.
Member Function Documentation
◆ base() [1/2]
DUChainBase * KDevelop::DUChainPointerData::base | ( | ) |
Will return zero once the pointed-to object was deleted.
Definition at line 23 of file duchainpointer.cpp.
◆ base() [2/2]
DUChainBase * KDevelop::DUChainPointerData::base | ( | ) | const |
Will return zero once the pointed-to object was deleted.
Definition at line 28 of file duchainpointer.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2021 The KDE developers.
Generated on Wed Mar 3 2021 00:37:28 by doxygen 1.8.16 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.