language/duchain
KDevelop::DUChainBaseData Class Reference
#include <duchainbase.h>

Public Member Functions | |
| DUChainBaseData (const DUChainBaseData &rhs) | |
| uint | classSize () const |
| void | freeDynamicData () |
| template<class T > | |
| void | setClassId (T *) |
Static Public Member Functions | |
| static void | setShouldCreateConstantData (bool) |
| static bool | shouldCreateConstantData () |
Public Attributes | |
| uint | classId |
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 55 of file duchainbase.h.
Member Function Documentation
| void KDevelop::DUChainBaseData::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 80 of file duchainbase.h.
| void KDevelop::DUChainBaseData::setClassId | ( | T * | ) | [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 72 of file duchainbase.h.
| bool KDevelop::DUChainBaseData::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 137 of file duchainbase.cpp.
The documentation for this class was generated from the following files:
KDE 4.4 API Reference