C# Класс Mono.CSharp.TypeInfo

This is used by the flow analysis code to keep track of the type of local variables and variables. The flow code uses a BitVector to keep track of whether a variable has been assigned or not. This is easy for fundamental types (int, char etc.) or reference types since you can only assign the whole variable as such. For structs, we also need to keep track of all its fields. To do this, we allocate one bit for the struct itself (it's used if you assign/access the whole struct) followed by one bit for each of its fields. This class computes this `layout' for each type.
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
IsStruct bool
Length int
Offset int
SubStructInfo TypeInfo[]
TotalLength int

Открытые методы

Метод Описание
GetFieldIndex ( string name ) : int
GetStructField ( string name ) : TypeInfo
GetTypeInfo ( System.TypeSpec type, IMemberContext context ) : TypeInfo
IsFullyInitialized ( Mono.CSharp.FlowAnalysisContext fc, VariableInfo vi, Mono.CSharp.Location loc ) : bool

A struct's constructor must always assign all fields. This method checks whether it actually does so.

Reset ( ) : void
ToString ( ) : string

Приватные методы

Метод Описание
TypeInfo ( ) : System
TypeInfo ( StructInfo struct_info, int offset ) : System
TypeInfo ( int totalLength ) : System

Описание методов

GetFieldIndex() публичный Метод

public GetFieldIndex ( string name ) : int
name string
Результат int

GetStructField() публичный Метод

public GetStructField ( string name ) : TypeInfo
name string
Результат TypeInfo

GetTypeInfo() публичный статический Метод

public static GetTypeInfo ( System.TypeSpec type, IMemberContext context ) : TypeInfo
type System.TypeSpec
context IMemberContext
Результат TypeInfo

IsFullyInitialized() публичный Метод

A struct's constructor must always assign all fields. This method checks whether it actually does so.
public IsFullyInitialized ( Mono.CSharp.FlowAnalysisContext fc, VariableInfo vi, Mono.CSharp.Location loc ) : bool
fc Mono.CSharp.FlowAnalysisContext
vi VariableInfo
loc Mono.CSharp.Location
Результат bool

Reset() публичный статический Метод

public static Reset ( ) : void
Результат void

ToString() публичный Метод

public ToString ( ) : string
Результат string

Описание свойств

IsStruct публичное свойство

If this is a struct.
public bool IsStruct
Результат bool

Length публичное свойство

Number of bits the simple fields of a variable of this type consume in the flow vector.
public int Length
Результат int

Offset публичное свойство

This is only used by sub-structs.
public int Offset
Результат int

SubStructInfo публичное свойство

If this is a struct, all fields which are structs theirselves.
public TypeInfo[] SubStructInfo
Результат TypeInfo[]

TotalLength публичное свойство

Total number of bits a variable of this type consumes in the flow vector.
public int TotalLength
Результат int