• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdevelop API Reference
  • KDE Home
  • Contact Us
 

kdevplatform/language/duchain

  • KDevelop
  • DUChainBaseData
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
KDevelop::DUChainBaseData Class Reference

#include <duchainbase.h>

Inheritance diagram for KDevelop::DUChainBaseData:
Inheritance graph
[legend]

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]

KDevelop::DUChainBaseData::DUChainBaseData ( )
inline

Definition at line 62 of file duchainbase.h.

◆ DUChainBaseData() [2/2]

KDevelop::DUChainBaseData::DUChainBaseData ( const DUChainBaseData &  rhs)
inline

Definition at line 67 of file duchainbase.h.

◆ ~DUChainBaseData()

KDevelop::DUChainBaseData::~DUChainBaseData ( )
inline

Definition at line 73 of file duchainbase.h.

Member Function Documentation

◆ appendedListDynamicDefault()

static bool KDevelop::DUChainBaseData::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()

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 108 of file duchainbase.h.

◆ isDynamic()

bool KDevelop::DUChainBaseData::isDynamic ( ) const
inline

Definition at line 86 of file duchainbase.h.

◆ operator=()

DUChainBaseData& KDevelop::DUChainBaseData::operator= ( const DUChainBaseData &  rhs)
delete

◆ setClassId()

template<class T >
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 98 of file duchainbase.h.

◆ shouldCreateConstantData()

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 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:
  • duchainbase.h
  • duchainbase.cpp
This file is part of the KDE documentation.
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.

kdevplatform/language/duchain

Skip menu "kdevplatform/language/duchain"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdevelop API Reference

Skip menu "kdevelop API Reference"
  • kdevplatform
  •   debugger
  •   documentation
  •   interfaces
  •   language
  •     assistant
  •     backgroundparser
  •     checks
  •     classmodel
  •     codecompletion
  •     codegen
  •     duchain
  •     editor
  •     highlighting
  •     interfaces
  •     util
  •   outputview
  •   project
  •   serialization
  •   shell
  •   sublime
  •   tests
  •   util
  •   vcs

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal