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

Public Types | |
enum | { Identity = 58 } |
using | Data = ListTypeData |
using | Ptr = TypePtr< ListType > |
![]() | |
enum | { Identity = 6 } |
using | Data = StructureTypeData |
using | Ptr = TypePtr< StructureType > |
Protected Member Functions | |
TYPE_DECLARE_DATA (ListType) | |
![]() | |
void | accept0 (TypeVisitor *v) const override |
Detailed Description
Represents a list-like object which can have a content type.
Example for Python:
This type class can be used to determine the type of a as "list of int" as follows: (1) When creating the type for the List class, create a ListType instead of a structure type. (Your language plugin somehow needs to know which classes are list-like; Python does this through special comments for the class) (2) Set the type of a to the type declared by the List class, as usual. (3) Call
(Your language plugin needs to know which methods add their argument's content to the type's content; Python does this through special comments for the method)
Definition at line 83 of file containertypes.h.
Member Typedef Documentation
◆ Data
using KDevelop::ListType::Data = ListTypeData |
Definition at line 145 of file containertypes.h.
◆ Ptr
using KDevelop::ListType::Ptr = TypePtr<ListType> |
Definition at line 87 of file containertypes.h.
Member Enumeration Documentation
◆ anonymous enum
anonymous enum |
Enumerator | |
---|---|
Identity |
Definition at line 143 of file containertypes.h.
Constructor & Destructor Documentation
◆ ListType() [1/3]
KDevelop::ListType::ListType | ( | ) |
Definition at line 33 of file containertypes.cpp.
◆ ListType() [2/3]
KDevelop::ListType::ListType | ( | const ListType & | rhs | ) |
Definition at line 39 of file containertypes.cpp.
◆ ListType() [3/3]
|
explicit |
Definition at line 36 of file containertypes.cpp.
Member Function Documentation
◆ addContentType()
|
inline |
Adds typeToAdd
to the content type of this list.
If the list currently has no type, it is set to this type. If typeToAdd
equals this list's content type, or is a useless type nothing happens. Otherwise, the type of the list becomes an unsure type of the previous and typeToAdd
.
Pass your language's UnsureType as a template parameter, as it will eventually need to be instantiated.
- Note
- If the type is already assigned to a declaration, the duchain must be write-locked when this is called.
- Parameters
-
typeToAdd The new type the list's contents can possibly be of.
Definition at line 113 of file containertypes.h.
◆ clone()
|
override |
Definition at line 71 of file containertypes.cpp.
◆ containerToString()
QString KDevelop::ListType::containerToString | ( | ) | const |
Return only the container type, not the content type in a string.
Definition at line 104 of file containertypes.cpp.
◆ contentType()
IndexedType KDevelop::ListType::contentType | ( | ) | const |
Get this lists's content type.
Definition at line 61 of file containertypes.cpp.
◆ equals()
|
override |
Definition at line 109 of file containertypes.cpp.
◆ hash()
|
override |
Definition at line 137 of file containertypes.cpp.
◆ operator=()
◆ replaceContentType()
void KDevelop::ListType::replaceContentType | ( | const AbstractType::Ptr & | newType | ) |
Replaces this list's content type by newType
.
Definition at line 51 of file containertypes.cpp.
◆ toString()
|
override |
Formats this type (base type and content type) in a string.
Definition at line 81 of file containertypes.cpp.
◆ TYPE_DECLARE_DATA()
|
protected |
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.