Show / Hide Table of Contents

Class TypeToTypeSlimConverter

A type visitor that visits CLR types and returns slim representations of those types.

Inheritance
System.Object
TypeVisitor<TypeSlim>
TypeToTypeSlimConverter
Inherited Members
TypeVisitor<TypeSlim>.Visit(IEnumerable<Type>)
TypeVisitor<TypeSlim>.Visit(Type[])
TypeVisitor<TypeSlim>.VisitArray(Type)
TypeVisitor<TypeSlim>.VisitArrayVector(Type)
TypeVisitor<TypeSlim>.VisitArrayMultidimensional(Type)
TypeVisitor<TypeSlim>.VisitGeneric(Type)
TypeVisitor<TypeSlim>.VisitGenericClosed(Type)
TypeVisitor<TypeSlim>.VisitByRef(Type)
TypeVisitor<TypeSlim>.VisitPointer(Type)
Namespace: System.Reflection
Assembly: Nuqleon.Linq.Expressions.Bonsai.dll
Syntax
public class TypeToTypeSlimConverter : TypeVisitor<TypeSlim>

Constructors

TypeToTypeSlimConverter()

Instantiates the type to type slim converter.

Declaration
public TypeToTypeSlimConverter()

Properties

TypeCache

Gets the cache of previously converted types.

Declaration
protected IDictionary<Type, TypeSlim> TypeCache { get; }
Property Value
Type Description
System.Collections.Generic.IDictionary<System.Type, TypeSlim>

Methods

MakeArrayType(Type, TypeSlim)

Constructs a single-dimensional vector array type slim from the specified element type.

Declaration
protected override TypeSlim MakeArrayType(Type type, TypeSlim elementType)
Parameters
Type Name Description
System.Type type

The original type.

TypeSlim elementType

Element type slim of the array.

Returns
Type Description
TypeSlim

Slim representation of a single-dimensional vector array type with the given element type.

Overrides
System.Linq.CompilerServices.TypeVisitor<System.Reflection.TypeSlim>.MakeArrayType(System.Type, System.Reflection.TypeSlim)

MakeArrayType(Type, TypeSlim, Int32)

Constructs a multi-dimensional array type slim from the specified element type and rank.

Declaration
protected override TypeSlim MakeArrayType(Type type, TypeSlim elementType, int rank)
Parameters
Type Name Description
System.Type type

The original type.

TypeSlim elementType

Element type slim of the array.

System.Int32 rank

Rank (the number of dimensions) of the array.

Returns
Type Description
TypeSlim

Slim representation of a multi-dimensional array type with the given element type and rank.

Overrides
System.Linq.CompilerServices.TypeVisitor<System.Reflection.TypeSlim>.MakeArrayType(System.Type, System.Reflection.TypeSlim, System.Int32)

MakeByRefType(Type, TypeSlim)

Not supported.

Declaration
protected override TypeSlim MakeByRefType(Type type, TypeSlim elementType)
Parameters
Type Name Description
System.Type type

Irrelevant.

TypeSlim elementType

Irrelevant.

Returns
Type Description
TypeSlim
Overrides
System.Linq.CompilerServices.TypeVisitor<System.Reflection.TypeSlim>.MakeByRefType(System.Type, System.Reflection.TypeSlim)
Exceptions
Type Condition
System.NotSupportedException

Always thrown.

MakeGenericType(Type, TypeSlim, TypeSlim[])

Constructs a closed generic type slim from the specified generic type slim definition and type slim arguments.

Declaration
protected override TypeSlim MakeGenericType(Type type, TypeSlim genericTypeDefinition, params TypeSlim[] genericArguments)
Parameters
Type Name Description
System.Type type

The original type.

TypeSlim genericTypeDefinition

Slim generic type definition.

TypeSlim[] genericArguments

Slim generic type arguments.

Returns
Type Description
TypeSlim

Slim representation of a closed generic type with the given generic type slim definition and type slim arguments.

Overrides
System.Linq.CompilerServices.TypeVisitor<System.Reflection.TypeSlim>.MakeGenericType(System.Type, System.Reflection.TypeSlim, System.Reflection.TypeSlim[])

MakePointerType(Type, TypeSlim)

Not supported.

Declaration
protected override TypeSlim MakePointerType(Type type, TypeSlim elementType)
Parameters
Type Name Description
System.Type type

Irrelevant.

TypeSlim elementType

Irrelevant.

Returns
Type Description
TypeSlim
Overrides
System.Linq.CompilerServices.TypeVisitor<System.Reflection.TypeSlim>.MakePointerType(System.Type, System.Reflection.TypeSlim)
Exceptions
Type Condition
System.NotSupportedException

Always thrown.

MapType(Type, TypeSlim)

Manually maps a CLR type to a slim type.

Declaration
public void MapType(Type type, TypeSlim typeSlim)
Parameters
Type Name Description
System.Type type

The CLR type.

TypeSlim typeSlim

The slim type.

Pop()

Pops a frame from the generic parameter context.

Declaration
public void Pop()

Push(IDictionary<Type, TypeSlim>)

Pushes a frame of generic parameters so the same generic parameter is used throughout the generic method definition types.

Declaration
public void Push(IDictionary<Type, TypeSlim> genericParameterMap)
Parameters
Type Name Description
System.Collections.Generic.IDictionary<System.Type, TypeSlim> genericParameterMap

The mapping from types to generic parameters.

Visit(Type)

Visits a CLR type and returns a slim representation.

Declaration
public override TypeSlim Visit(Type type)
Parameters
Type Name Description
System.Type type

Type to visit.

Returns
Type Description
TypeSlim

Slim representation of the CLR type.

Overrides
System.Linq.CompilerServices.TypeVisitor<System.Reflection.TypeSlim>.Visit(System.Type)

VisitAnonymousType(Type)

Visits a record type and returns a structural slim type representation.

Declaration
protected virtual TypeSlim VisitAnonymousType(Type type)
Parameters
Type Name Description
System.Type type

The record type.

Returns
Type Description
TypeSlim

The structural slim type representation.

VisitGenericParameter(Type)

Visits a generic parameter and returns a slim representation.

Declaration
protected override TypeSlim VisitGenericParameter(Type type)
Parameters
Type Name Description
System.Type type

Generic parameter to visit.

Returns
Type Description
TypeSlim

Slim representation of the generic parameter.

Overrides
System.Linq.CompilerServices.TypeVisitor<System.Reflection.TypeSlim>.VisitGenericParameter(System.Type)

VisitGenericTypeDefinition(Type)

Visits a generic type definition and returns a slim representation.

Declaration
protected override TypeSlim VisitGenericTypeDefinition(Type type)
Parameters
Type Name Description
System.Type type

Generic type definition to visit.

Returns
Type Description
TypeSlim

Slim representation of the generic type definition.

Overrides
System.Linq.CompilerServices.TypeVisitor<System.Reflection.TypeSlim>.VisitGenericTypeDefinition(System.Type)

VisitRecordType(Type)

Visits a record type and returns a structural slim type representation.

Declaration
protected virtual TypeSlim VisitRecordType(Type type)
Parameters
Type Name Description
System.Type type

The record type.

Returns
Type Description
TypeSlim

The structural slim type representation.

VisitSimple(Type)

Visits a type with no internal structure and returns a slim representation.

Declaration
protected override TypeSlim VisitSimple(Type type)
Parameters
Type Name Description
System.Type type

Simple type to visit.

Returns
Type Description
TypeSlim

Slim representation of the simple type.

Overrides
System.Linq.CompilerServices.TypeVisitor<System.Reflection.TypeSlim>.VisitSimple(System.Type)
In This Article
Back to top Generated by DocFX