language/duchain
KDevelop::IdentifiedType Class Reference
An IdentifiedType is a type that has a declaration. More...
#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 55 of file identifiedtype.h.
Constructor & Destructor Documentation
| KDevelop::IdentifiedType::~IdentifiedType | ( | ) | [virtual] |
Destructor.
Definition at line 30 of file identifiedtype.cpp.
Member Function Documentation
| void KDevelop::IdentifiedType::clear | ( | ) |
Clear the identifier.
Definition at line 34 of file identifiedtype.cpp.
| 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 69 of file identifiedtype.cpp.
| 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 61 of file identifiedtype.cpp.
| 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.
| uint KDevelop::IdentifiedType::hash | ( | ) | const |
Determine this identified type's hash value.
- Returns:
- the hash value
Reimplemented in KDevelop::StructureType.
Definition at line 57 of file identifiedtype.cpp.
| virtual const IdentifiedTypeData* KDevelop::IdentifiedType::idData | ( | ) | const [pure virtual] |
Allow IdentifiedType to access its data.
Implemented in KDevelop::MergeIdentifiedType< Parent >, KDevelop::MergeIdentifiedType< IntegralType >, KDevelop::MergeIdentifiedType< AbstractType >, and KDevelop::MergeIdentifiedType< ConstantIntegralType >.
| virtual IdentifiedTypeData* KDevelop::IdentifiedType::idData | ( | ) | [pure virtual] |
Allow IdentifiedType to access its data.
Implemented in KDevelop::MergeIdentifiedType< Parent >, KDevelop::MergeIdentifiedType< IntegralType >, KDevelop::MergeIdentifiedType< AbstractType >, and KDevelop::MergeIdentifiedType< ConstantIntegralType >.
| 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 74 of file identifiedtype.cpp.
| 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.
| 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 82 of file identifiedtype.cpp.
| void KDevelop::IdentifiedType::setDeclarationId | ( | const DeclarationId & | id | ) |
Set the globally unique declaration id.
- Parameters:
-
id new identifier
Definition at line 65 of file identifiedtype.cpp.
The documentation for this class was generated from the following files:
KDE 4.4 API Reference