Class TypeVisitor
A type of object that recursively applies a mapping to types.
Inherited Members
Namespace: Flame.TypeSystem
Assembly: Flame.dll
Syntax
public abstract class TypeVisitor
Methods
| Improve this Doc View SourceIsOfInterest(IType)
Tells if a type is of interest to this visitor. Visitors always specify custom behavior for interesting types, whereas uninteresting composite types are usually treated the same: the visitor simply visits the types they are composed of.
Declaration
protected abstract bool IsOfInterest(IType type)
Parameters
Type | Name | Description |
---|---|---|
IType | type | A type. |
Returns
Type | Description |
---|---|
System.Boolean |
|
Visit(IField)
Visits a particular field's recursive generic arguments and creates a new specialization based on the results.
Declaration
public IField Visit(IField field)
Parameters
Type | Name | Description |
---|---|---|
IField | field | The field to visit. |
Returns
Type | Description |
---|---|
IField | A visited field. |
Visit(IMethod)
Visits a particular method's recursive generic arguments and creates a new specialization based on the results.
Declaration
public IMethod Visit(IMethod method)
Parameters
Type | Name | Description |
---|---|---|
IMethod | method | The method to visit. |
Returns
Type | Description |
---|---|
IMethod | A visited method. |
Visit(IType)
Visits a type.
Declaration
public IType Visit(IType type)
Parameters
Type | Name | Description |
---|---|---|
IType | type | A type to visit. |
Returns
Type | Description |
---|---|
IType | A visited type. |
Visit(Parameter)
Visits a parameter's type and uses the result to create a new parameter.
Declaration
public Parameter Visit(Parameter parameter)
Parameters
Type | Name | Description |
---|---|---|
Parameter | parameter | The parameter to visit. |
Returns
Type | Description |
---|---|
Parameter | A visited parameter. |
VisitAll(IReadOnlyList<IMethod>)
Visits all methods in a list of methods.
Declaration
public IReadOnlyList<IMethod> VisitAll(IReadOnlyList<IMethod> methods)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IReadOnlyList<IMethod> | methods | A list of methods to visit. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IReadOnlyList<IMethod> | A list of visited methods. |
VisitAll(IReadOnlyList<IType>)
Visits all types in a list of types.
Declaration
public IReadOnlyList<IType> VisitAll(IReadOnlyList<IType> types)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IReadOnlyList<IType> | types | A list of types to visit. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IReadOnlyList<IType> | A list of visited types. |
VisitAll(IReadOnlyList<Parameter>)
Visits all parameters in a list of parameters.
Declaration
public IReadOnlyList<Parameter> VisitAll(IReadOnlyList<Parameter> parameters)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IReadOnlyList<Parameter> | parameters | A list of parameters to visit. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IReadOnlyList<Parameter> | A list of visited parameters. |
VisitInteresting(IType)
Visits a type that has been marked as interesting.
Declaration
protected abstract IType VisitInteresting(IType type)
Parameters
Type | Name | Description |
---|---|---|
IType | type | A type to visit. |
Returns
Type | Description |
---|---|
IType | A visited type. |
VisitUninteresting(IType)
Visits a type that has not been marked as interesting.
Declaration
protected virtual IType VisitUninteresting(IType type)
Parameters
Type | Name | Description |
---|---|---|
IType | type | A type to visit. |
Returns
Type | Description |
---|---|
IType | A visited type. |