language/duchain
KDevelop::DUChainItemSystem Class Reference
A class which registers data types and creates factories for them. More...
#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 |
| size_t | dataClassSize (const 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 90 of file duchainregister.h.
Member Function Documentation
| 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 37 of file duchainregister.cpp.
| DUChainBaseData * KDevelop::DUChainItemSystem::cloneData | ( | const DUChainBaseData & | data | ) | const |
Creates a dynamic copy of the given data.
Definition at line 29 of file duchainregister.cpp.
| 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 63 of file duchainregister.cpp.
| 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 23 of file duchainregister.cpp.
| size_t 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 56 of file duchainregister.cpp.
| 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 50 of file duchainregister.cpp.
| 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 43 of file duchainregister.cpp.
| void KDevelop::DUChainItemSystem::registerTypeClass | ( | ) | [inline] |
Register a new DUChainBase subclass.
Definition at line 96 of file duchainregister.h.
| DUChainItemSystem & KDevelop::DUChainItemSystem::self | ( | ) | [static] |
Access the static DUChainItemSystem instance.
Definition at line 71 of file duchainregister.cpp.
| void KDevelop::DUChainItemSystem::unregisterTypeClass | ( | ) | [inline] |
Unregister an DUChainBase subclass.
Definition at line 111 of file duchainregister.h.
The documentation for this class was generated from the following files:
KDE 4.4 API Reference