Class ReferenceType
- java.lang.Object
-
- de.fraunhofer.aisec.cpg.graph.Node
-
- de.fraunhofer.aisec.cpg.graph.types.Type
-
- de.fraunhofer.aisec.cpg.graph.types.ReferenceType
-
- All Implemented Interfaces:
Persistable,SecondOrderType,IVisitable<Node>
public class ReferenceType extends Type implements SecondOrderType
ReferenceTypes describe CPP References (int&), which are represent an alternative name for a variable. It is necessary to make this distinction, and not just rely on the original type as it is required for matching parameters in function arguments to discover which implementation is called.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class de.fraunhofer.aisec.cpg.graph.types.Type
Type.Origin, Type.Qualifier, Type.Storage
-
-
Field Summary
-
Fields inherited from class de.fraunhofer.aisec.cpg.graph.types.Type
origin, primitive, qualifier, storage, superTypes, UNKNOWN_TYPE_STRING
-
-
Constructor Summary
Constructors Constructor Description ReferenceType(Type reference)ReferenceType(Type.Storage storage, Type.Qualifier qualifier, Type reference)ReferenceType(Type type, Type reference)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Typedereference()Typeduplicate()booleanequals(java.lang.Object o)TypegetElementType()inthashCode()booleanisSimilar(Type t)Required for possibleSubTypes to check if the new Type should be considered a subtype or notTypereference(PointerType.PointerOrigin pointerOrigin)voidrefreshName()voidsetElementType(Type reference)java.lang.StringtoString()-
Methods inherited from class de.fraunhofer.aisec.cpg.graph.types.Type
getQualifier, getReferenceDepth, getRoot, getStorage, getSuperTypes, getTypeName, getTypeOrigin, isFirstOrderType, isPrimitive, refreshNames, setAdditionalTypeKeywords, setQualifier, setRoot, setStorage, setTypeOrigin
-
Methods inherited from class de.fraunhofer.aisec.cpg.graph.Node
addAnnotations, addNextCFG, addNextCFG, addNextDFG, addNextEOG, addPrevDFG, addPrevEOG, addTypedef, clearNextEOG, disconnectFromGraph, getAnnotations, getArgumentIndex, getCode, getFile, getId, getLocation, getName, getNextCFG, getNextDFG, getNextEOG, getNextEOGProperties, getNextEOGPropertyEdge, getPrevDFG, getPrevEOG, getPrevEOGProperties, getTypedefs, isDummy, isImplicit, removeNextDFG, removePrevDFG, removePrevEOGEntries, removePrevEOGEntry, setArgumentIndex, setCode, setComment, setDummy, setFile, setImplicit, setLocation, setName, setNextDFG, setNextEOG, setPrevDFG, setPrevEOG, setPrevEOGProperties, setTypedefs
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface de.fraunhofer.aisec.cpg.processing.IVisitable
accept
-
-
-
-
Constructor Detail
-
ReferenceType
public ReferenceType(Type reference)
-
ReferenceType
public ReferenceType(Type.Storage storage, Type.Qualifier qualifier, Type reference)
-
-
Method Detail
-
reference
public Type reference(PointerType.PointerOrigin pointerOrigin)
-
dereference
public Type dereference()
- Specified by:
dereferencein classType- Returns:
- Dereferencing a ReferenceType equals to dereferencing the original (non-reference) type
-
duplicate
public Type duplicate()
-
getElementType
public Type getElementType()
- Specified by:
getElementTypein interfaceSecondOrderType
-
setElementType
public void setElementType(Type reference)
- Specified by:
setElementTypein interfaceSecondOrderType
-
isSimilar
public boolean isSimilar(Type t)
Description copied from class:TypeRequired for possibleSubTypes to check if the new Type should be considered a subtype or not
-
refreshName
public void refreshName()
-
-