Class TypeToTypeSlimConverter
A type visitor that visits CLR types and returns slim representations of those types.
Inherited Members
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
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
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
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
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
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
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
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
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. |