kdevplatform/language/duchain
#include <duchainregister.h>
Public Member Functions | |
void | callDestructor (DUChainBaseData *data) const |
DUChainBaseData * | cloneData (const DUChainBaseData &data) const |
void | copy (const DUChainBaseData &from, DUChainBaseData &to, bool constant) const |
DUChainBase * | create (DUChainBaseData *data) const |
uint | dataClassSize (const DUChainBaseData &data) const |
void | deleteDynamicData (DUChainBaseData *data) const |
uint | dynamicSize (const DUChainBaseData &data) const |
void | freeDynamicData (DUChainBaseData *data) const |
template<class T , class Data > | |
void | registerTypeClass () |
template<class T , class Data > | |
void | unregisterTypeClass () |
Static Public Member Functions | |
static DUChainItemSystem & | self () |
Detailed Description
A class which registers data types and creates factories for them.
DUChainItemSystem is a global static class which allows you to register new DUChainBase subclasses for creation.
Definition at line 112 of file duchainregister.h.
Member Function Documentation
◆ callDestructor()
void KDevelop::DUChainItemSystem::callDestructor | ( | DUChainBaseData * | data | ) | const |
Calls the destructor, but does not delete anything.
This is needed because the data classes must not contain virtual members. This should only be called when a duchain data-pointer is semantically deleted, eg. when it does not persist on disk.
Definition at line 49 of file duchainregister.cpp.
◆ cloneData()
DUChainBaseData * KDevelop::DUChainItemSystem::cloneData | ( | const DUChainBaseData & | data | ) | const |
Creates a dynamic copy of the given data.
Definition at line 40 of file duchainregister.cpp.
◆ copy()
void KDevelop::DUChainItemSystem::copy | ( | const DUChainBaseData & | from, |
DUChainBaseData & | to, | ||
bool | constant | ||
) | const |
This just calls the correct constructor on the target.
The target must be big enough to hold all the data. If constant is true, it must be as big as dynamicSize(from).
Definition at line 84 of file duchainregister.cpp.
◆ create()
DUChainBase * KDevelop::DUChainItemSystem::create | ( | DUChainBaseData * | data | ) | const |
Create an DUChainBase for the given data.
The returned type must be put into a DUChainBase::Ptr immediately. Can return null if no type-factory is available for the given data (for example when a language-part is not loaded)
Definition at line 33 of file duchainregister.cpp.
◆ dataClassSize()
uint KDevelop::DUChainItemSystem::dataClassSize | ( | const DUChainBaseData & | data | ) | const |
Returns the size of the derived class, not including dynamic data.
Returns zero if the class is not known.
Definition at line 77 of file duchainregister.cpp.
◆ deleteDynamicData()
void KDevelop::DUChainItemSystem::deleteDynamicData | ( | DUChainBaseData * | data | ) | const |
Call delete on data
.
Definition at line 63 of file duchainregister.cpp.
◆ dynamicSize()
uint KDevelop::DUChainItemSystem::dynamicSize | ( | const DUChainBaseData & | data | ) | const |
Calls the dynamicSize(..) member on the given data, in the most special class. Since we cannot use virtual functions, this is the only way.
Definition at line 70 of file duchainregister.cpp.
◆ freeDynamicData()
void KDevelop::DUChainItemSystem::freeDynamicData | ( | KDevelop::DUChainBaseData * | data | ) | const |
Does not call the destructor, but frees all special data associated to dynamic data(the appendedlists stuff) This needs to be called whenever a dynamic duchain data-pointer is being deleted.
Definition at line 56 of file duchainregister.cpp.
◆ registerTypeClass()
|
inline |
Register a new DUChainBase subclass.
Definition at line 119 of file duchainregister.h.
◆ self()
|
static |
Access the static DUChainItemSystem instance.
Definition at line 93 of file duchainregister.cpp.
◆ unregisterTypeClass()
|
inline |
Unregister an DUChainBase subclass.
Definition at line 135 of file duchainregister.h.
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.