kdevplatform/language/duchain
#include <identifiedtype.h>

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()
|
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
-
top Top 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
-
rhs other 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]
|
pure virtual |
Allow IdentifiedType to access its data.
Implemented in KDevelop::MergeIdentifiedType< Parent >.
◆ idData() [2/2]
|
pure virtual |
Allow IdentifiedType to access its data.
Implemented in KDevelop::MergeIdentifiedType< Parent >.
◆ internalContext()
KDevelop::DUContext * KDevelop::IdentifiedType::internalContext | ( | const TopDUContext * | top | ) | const |
- Parameters
-
top Top 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
-
declaration Declaration 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
-
id new identifier
Definition at line 68 of file identifiedtype.cpp.
The documentation for this class was generated from the following files:
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.