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

kdevplatform/language/duchain

  • KDevelop
  • IdentifiedType
Public Member Functions | List of all members
KDevelop::IdentifiedType Class Referenceabstract

#include <identifiedtype.h>

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

Public Member Functions

virtual ~IdentifiedType ()
 
void clear ()
 
Declaration * declaration (const TopDUContext *top) const
 
DeclarationId declarationId () const
 
bool equals (const IdentifiedType *rhs) const
 
uint hash () const
 
virtual const IdentifiedTypeData * idData () const =0
 
virtual IdentifiedTypeData * idData ()=0
 
DUContext * internalContext (const TopDUContext *top) const
 
QualifiedIdentifier qualifiedIdentifier () const
 
void setDeclaration (Declaration *declaration)
 
void setDeclarationId (const DeclarationId &id)
 

Detailed Description

An IdentifiedType is a type that has a declaration.

Example of an identified type:

  • A class type

Example of types which are not identified:

  • Pointer types (they can point to identified types, but by themselves have no declaration)
  • Reference types (the same)

Definition at line 54 of file identifiedtype.h.

Constructor & Destructor Documentation

◆ ~IdentifiedType()

KDevelop::IdentifiedType::~IdentifiedType ( )
virtual

Destructor.

Definition at line 29 of file identifiedtype.cpp.

Member Function Documentation

◆ clear()

void KDevelop::IdentifiedType::clear ( )

Clear the identifier.

Definition at line 33 of file identifiedtype.cpp.

◆ declaration()

Declaration * KDevelop::IdentifiedType::declaration ( const TopDUContext *  top) const

Look up the declaration of this type in the given top context.

Parameters
topTop context to search for the declaration within
Returns
the declaration corresponding to this identified type

Definition at line 73 of file identifiedtype.cpp.

◆ declarationId()

DeclarationId KDevelop::IdentifiedType::declarationId ( ) const

Access the identified type's declaration id, which is a unique global identifier for the type even when the same identifier represents a different type in a different context or source file.

Returns
the declaration identifier.
See also
DeclarationId

Definition at line 63 of file identifiedtype.cpp.

◆ equals()

bool KDevelop::IdentifiedType::equals ( const IdentifiedType *  rhs) const

Test for equivalence with another type.

Parameters
rhsother type to check for equivalence
Returns
true if equal, otherwise false.

Definition at line 38 of file identifiedtype.cpp.

◆ hash()

uint KDevelop::IdentifiedType::hash ( ) const

Determine this identified type's hash value.

Returns
the hash value

Definition at line 58 of file identifiedtype.cpp.

◆ idData() [1/2]

virtual const IdentifiedTypeData* KDevelop::IdentifiedType::idData ( ) const
pure virtual

Allow IdentifiedType to access its data.

Implemented in KDevelop::MergeIdentifiedType< Parent >.

◆ idData() [2/2]

virtual IdentifiedTypeData* KDevelop::IdentifiedType::idData ( )
pure virtual

Allow IdentifiedType to access its data.

Implemented in KDevelop::MergeIdentifiedType< Parent >.

◆ internalContext()

KDevelop::DUContext * KDevelop::IdentifiedType::internalContext ( const TopDUContext *  top) const
Parameters
topTop context to search for the declaration within Convenience function that returns the internal context of the attached declaration, or zero if no declaration is found, or if it does not have an internal context.

Definition at line 78 of file identifiedtype.cpp.

◆ qualifiedIdentifier()

QualifiedIdentifier KDevelop::IdentifiedType::qualifiedIdentifier ( ) const

Determine the qualified identifier for this identified type.

Note
This is relatively expensive. Use declarationId() instead when possible!
Returns
the type's qualified identifier

Definition at line 53 of file identifiedtype.cpp.

◆ setDeclaration()

void KDevelop::IdentifiedType::setDeclaration ( Declaration *  declaration)

Set the declaration which created this type.

Note
You should be careful when setting this, because it also changes the meaning of the declaration.

The logic is: If a declaration has a set abstractType(), and that abstractType() has set the same declaration as declaration(), then the declaration declares the type(thus it is a type-declaration, see Declaration::kind())

Parameters
declarationDeclaration which created the type

Definition at line 87 of file identifiedtype.cpp.

◆ setDeclarationId()

void KDevelop::IdentifiedType::setDeclarationId ( const DeclarationId &  id)

Set the globally unique declaration id.

Parameters
idnew identifier

Definition at line 68 of file identifiedtype.cpp.


The documentation for this class was generated from the following files:
  • identifiedtype.h
  • identifiedtype.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Thu Mar 4 2021 23:31:18 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