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

Public Types | |
enum | { Identity = 4 } |
using | Data = ReferenceTypeData |
using | Ptr = TypePtr< ReferenceType > |
![]() | |
enum | { Identity = 1 } |
enum | CommonModifiers : quint32 { NoModifiers = 0, ConstModifier = 1 << 0, VolatileModifier = 1 << 1, TransientModifier = 1 << 2, NewModifier = 1 << 3, SealedModifier = 1 << 4, UnsafeModifier = 1 << 5, FixedModifier = 1 << 6, ShortModifier = 1 << 7, LongModifier = 1 << 8, LongLongModifier = 1 << 9, SignedModifier = 1 << 10, UnsignedModifier = 1 << 11, LanguageSpecificModifier = 1 << 12 } |
using | Data = AbstractTypeData |
using | Ptr = TypePtr< AbstractType > |
enum | WhichType : quint8 { TypeAbstract, TypeIntegral, TypePointer, TypeReference, TypeFunction, TypeStructure, TypeArray, TypeDelayed, TypeEnumeration, TypeEnumerator, TypeAlias, TypeUnsure } |
Public Member Functions | |
ReferenceType () | |
ReferenceType (const ReferenceType &rhs) | |
ReferenceType (ReferenceTypeData &data) | |
~ReferenceType () override | |
AbstractType::Ptr | baseType () const |
AbstractType * | clone () const override |
bool | equals (const AbstractType *rhs) const override |
void | exchangeTypes (TypeExchanger *exchanger) override |
uint | hash () const override |
bool | isRValue () const |
ReferenceType & | operator= (const ReferenceType &rhs)=delete |
void | setBaseType (const AbstractType::Ptr &baseType) |
void | setIsRValue (bool isRValue) |
QString | toString () const override |
WhichType | whichType () const override |
![]() | |
AbstractType () | |
AbstractType (AbstractTypeData &dd) | |
AbstractType (const AbstractType &rhs)=delete | |
virtual | ~AbstractType () |
void | accept (TypeVisitor *v) const |
int64_t | alignOf () const |
IndexedType | indexed () const |
void | makeDynamic () |
quint32 | modifiers () const |
AbstractType & | operator= (const AbstractType &rhs)=delete |
void | setAlignOf (int64_t alignedTo) |
void | setModifiers (quint32 modifiers) |
void | setSizeOf (int64_t sizeOf) |
int64_t | sizeOf () const |
![]() | |
QSharedData () | |
QSharedData (const QSharedData &other) | |
Protected Member Functions | |
void | accept0 (TypeVisitor *v) const override |
![]() | |
QString | toString (bool spaceOnLeft) const |
Additional Inherited Members | |
![]() | |
static void | acceptType (AbstractType::Ptr type, TypeVisitor *v) |
template<class Type > | |
static Type::Data & | copyData (const typename Type::Data &rhs) |
template<class DataType > | |
static DataType & | copyDataDirectly (const DataType &rhs) |
template<class Type > | |
static Type::Data & | createData () |
![]() | |
AbstractTypeData * | d_ptr |
Detailed Description
A type representing reference types.
ReferenceType is used to represent types which hold a reference to a variable.
Definition at line 35 of file referencetype.h.
Member Typedef Documentation
◆ Data
Definition at line 96 of file referencetype.h.
◆ Ptr
Definition at line 39 of file referencetype.h.
Member Enumeration Documentation
◆ anonymous enum
anonymous enum |
Enumerator | |
---|---|
Identity |
Definition at line 92 of file referencetype.h.
Constructor & Destructor Documentation
◆ ReferenceType() [1/3]
KDevelop::ReferenceType::ReferenceType | ( | ) |
Default constructor.
Definition at line 61 of file referencetype.cpp.
◆ ReferenceType() [2/3]
KDevelop::ReferenceType::ReferenceType | ( | const ReferenceType & | rhs | ) |
◆ ReferenceType() [3/3]
|
explicit |
Constructor using raw data.
- Parameters
-
data internal data.
Definition at line 37 of file referencetype.cpp.
◆ ~ReferenceType()
|
override |
Destructor.
Definition at line 66 of file referencetype.cpp.
Member Function Documentation
◆ accept0()
|
overrideprotectedvirtual |
Visitor method, reimplement to allow visiting of types.
- Parameters
-
v visitor which is visiting.
Implements KDevelop::AbstractType.
Definition at line 90 of file referencetype.cpp.
◆ baseType()
AbstractType::Ptr KDevelop::ReferenceType::baseType | ( | ) | const |
Retrieve the referenced type, ie.
what type of data this type references.
- Returns
- the base type.
Definition at line 70 of file referencetype.cpp.
◆ clone()
|
overridevirtual |
Should create a clone of the source-type, with as much data copied as possible without breaking the du-chain.
Implements KDevelop::AbstractType.
Definition at line 41 of file referencetype.cpp.
◆ equals()
|
overridevirtual |
Should return whether this type's content equals the given one Since this is used by the type-repository, it must compare ALL members of the data type.
Reimplemented from KDevelop::AbstractType.
Definition at line 46 of file referencetype.cpp.
◆ exchangeTypes()
|
overridevirtual |
Should, like accept0, be implemented by all types that hold references to other types.
If this is called on one type, that type should call exchangeTypes(..) with all its referenced sub-types. The type itself does not recurse into the sub-types, that can be done by the exchanger itself if desired.
Reimplemented from KDevelop::AbstractType.
Definition at line 98 of file referencetype.cpp.
◆ hash()
|
overridevirtual |
A hash-value that should have the following properties:
- When two types match on equals(), it should be same.
- When two types don't match on equals(), it should be different with a high probability.
Reimplemented from KDevelop::AbstractType.
Definition at line 119 of file referencetype.cpp.
◆ isRValue()
bool KDevelop::ReferenceType::isRValue | ( | ) | const |
Checks whether this type is an rvalue- or lvalue-reference type.
- Returns
- true for rvalue-references, false for lvalue-references
Definition at line 80 of file referencetype.cpp.
◆ operator=()
|
delete |
◆ setBaseType()
void KDevelop::ReferenceType::setBaseType | ( | const AbstractType::Ptr & | baseType | ) |
Sets the referenced type, ie.
what type of data this type references.
- Parameters
-
baseType the base type.
Definition at line 75 of file referencetype.cpp.
◆ setIsRValue()
void KDevelop::ReferenceType::setIsRValue | ( | bool | isRValue | ) |
Sets whether this type is an rvalue- or lvalue-reference type.
- Parameters
-
isRValue true for rvalue-references, false for lvalue-references
Definition at line 85 of file referencetype.cpp.
◆ toString()
|
overridevirtual |
Returns this type as a string, preferably the same as it is expressed in the code.
- Returns
- this type as a string
Reimplemented from KDevelop::AbstractType.
Definition at line 103 of file referencetype.cpp.
◆ whichType()
|
overridevirtual |
Determine which data type this abstract type represents.
- Returns
- the data type represented by this type.
Reimplemented from KDevelop::AbstractType.
Definition at line 114 of file referencetype.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.