Class TypeVisitor
Base class for visitor for CLR types, based on their structure.
Namespace: System.Linq.CompilerServices
Assembly: Nuqleon.Linq.CompilerServices.dll
Syntax
public class TypeVisitor : Object
Constructors
TypeVisitor()
Declaration
public TypeVisitor()
Methods
Visit(Type)
Visits a CLR type.
Declaration
public virtual Type Visit(Type type)
Parameters
Type | Name | Description |
---|---|---|
System.Type | type | Type to visit. |
Returns
Type | Description |
---|---|
System.Type | Resulting type after the visit. |
Visit(Type[])
Visits an array of types.
Declaration
protected Type[] Visit(Type[] types)
Parameters
Type | Name | Description |
---|---|---|
System.Type[] | types | Array of types to visit. |
Returns
Type | Description |
---|---|
System.Type[] | Array consisting of the result of visiting each type in the original sequence. |
VisitArray(Type)
Visits all array types and dispatches into VisitArrayVector or VisitArrayMultidimensional.
Declaration
protected virtual Type VisitArray(Type type)
Parameters
Type | Name | Description |
---|---|---|
System.Type | type | Array type to visit. |
Returns
Type | Description |
---|---|
System.Type | Resulting type after the visit. |
VisitArrayMultidimensional(Type)
Visits a multi-dimensional array type.
Declaration
protected virtual Type VisitArrayMultidimensional(Type type)
Parameters
Type | Name | Description |
---|---|---|
System.Type | type | Multi-dimensional array type to visit. |
Returns
Type | Description |
---|---|
System.Type | Resulting type after the visit. |
VisitArrayVector(Type)
Visits a single-dimensional array type, also known as a vector.
Declaration
protected virtual Type VisitArrayVector(Type type)
Parameters
Type | Name | Description |
---|---|---|
System.Type | type | Single-dimensional array type to visit. |
Returns
Type | Description |
---|---|
System.Type | Resulting type after the visit. |
VisitByRef(Type)
Visits a by ref type.
Declaration
protected virtual Type VisitByRef(Type type)
Parameters
Type | Name | Description |
---|---|---|
System.Type | type | By ref type to visit. |
Returns
Type | Description |
---|---|
System.Type | Resulting type after the visit. |
VisitGeneric(Type)
Visits types that are generic and dispatches into VisitGenericClosed or VisitGenericTypeDefinition. Notice this method does not dispatch into VisitGenericParameter, because a generic parameter is not categorized as a generic type.
Declaration
protected virtual Type VisitGeneric(Type type)
Parameters
Type | Name | Description |
---|---|---|
System.Type | type | Generic type to visit. |
Returns
Type | Description |
---|---|
System.Type | Resulting type after the visit. |
VisitGenericClosed(Type)
Visits a closed generic type.
Declaration
protected virtual Type VisitGenericClosed(Type type)
Parameters
Type | Name | Description |
---|---|---|
System.Type | type | Closed generic type to visit. |
Returns
Type | Description |
---|---|
System.Type | Resulting type after the visit. |
VisitGenericParameter(Type)
Visits a generic parameter.
Declaration
protected virtual Type VisitGenericParameter(Type type)
Parameters
Type | Name | Description |
---|---|---|
System.Type | type | Generic parameter to visit. |
Returns
Type | Description |
---|---|
System.Type | Resulting type after the visit. |
VisitGenericTypeDefinition(Type)
Visits a generic type definition.
Declaration
protected virtual Type VisitGenericTypeDefinition(Type type)
Parameters
Type | Name | Description |
---|---|---|
System.Type | type | Generic type definition to visit. |
Returns
Type | Description |
---|---|
System.Type | Resulting type after the visit. |
VisitPointer(Type)
Visits a pointer type.
Declaration
protected virtual Type VisitPointer(Type type)
Parameters
Type | Name | Description |
---|---|---|
System.Type | type | Pointer type to visit. |
Returns
Type | Description |
---|---|
System.Type | Resulting type after the visit. |
VisitSimple(Type)
Visits a type with no internal structure.
Declaration
protected virtual Type VisitSimple(Type type)
Parameters
Type | Name | Description |
---|---|---|
System.Type | type | Simple type to visit. |
Returns
Type | Description |
---|---|
System.Type | Resulting type after the visit. |