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

Public Member Functions | |
DUChainBaseData () | |
DUChainBaseData (const DUChainBaseData &rhs) | |
~DUChainBaseData () | |
uint | classSize () const |
void | freeDynamicData () |
bool | isDynamic () const |
DUChainBaseData & | operator= (const DUChainBaseData &rhs)=delete |
template<class T > | |
void | setClassId (T *) |
Static Public Member Functions | |
static bool | appendedListDynamicDefault () |
static bool & | shouldCreateConstantData () |
Public Attributes | |
quint16 | classId = 0 |
RangeInRevision | m_range |
Detailed Description
- Note
- When a data-item is stored on disk, no destructors of contained items will be called while destruction. DUChainBase assumes that each item that has constant data, is stored on disk. However the destructor is called even on constant items, when they have been replaced with a dynamic item. This tries to keep constructor/destructor count consistency persistently, which allows doing static reference-counting using contained classes in their constructor/destructors(For example the class Utils::StorableSet). This means that the data of all items that are stored to disk MUST be made constant before their destruction. This also means that every item that is "semantically" deleted, MUST have dynamic data before its destruction. This also means that DUChainBaseData based items should never be cloned using memcpy, but rather always using the copy-constructor, even if both sides are constant.
Definition at line 59 of file duchainbase.h.
Constructor & Destructor Documentation
◆ DUChainBaseData() [1/2]
|
inline |
Definition at line 62 of file duchainbase.h.
◆ DUChainBaseData() [2/2]
|
inline |
Definition at line 67 of file duchainbase.h.
◆ ~DUChainBaseData()
|
inline |
Definition at line 73 of file duchainbase.h.
Member Function Documentation
◆ appendedListDynamicDefault()
|
inlinestatic |
Returns whether initialized objects should be created as dynamic objects.
Definition at line 118 of file duchainbase.h.
◆ classSize()
uint KDevelop::DUChainBaseData::classSize | ( | ) | const |
Definition at line 39 of file duchainbase.cpp.
◆ freeDynamicData()
|
inline |
This is called whenever the data-object is being deleted memory-wise, but not semantically(Which means it stays on disk) Implementations of parent-classes must always be called.
Definition at line 108 of file duchainbase.h.
◆ isDynamic()
|
inline |
Definition at line 86 of file duchainbase.h.
◆ operator=()
|
delete |
◆ setClassId()
|
inline |
Internal setup for the data structure.
This must be called from actual class that belongs to this data(not parent classes), and the class must have the "Identity" enumerator with a unique identity. Do NOT call this in copy-constructors!
Definition at line 98 of file duchainbase.h.
◆ shouldCreateConstantData()
|
static |
Used to decide whether a constructed item should create constant data.
The default is "false", so dynamic data is created by default. This is stored thread-locally.
Definition at line 231 of file duchainbase.cpp.
Member Data Documentation
◆ classId
quint16 KDevelop::DUChainBaseData::classId = 0 |
Definition at line 84 of file duchainbase.h.
◆ m_range
RangeInRevision KDevelop::DUChainBaseData::m_range |
Definition at line 80 of file duchainbase.h.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2021 The KDE developers.
Generated on Fri Apr 9 2021 23:30:00 by doxygen 1.8.16 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.