C# Class Microsoft.Scripting.MutableTuple

Afficher le fichier Open project: jschementi/iron Class Usage Examples

Méthodes publiques

Свойство Type Description
MaxSize int

Méthodes publiques

Méthode Description
Create ( ) : Expression

Provides an expression for creating a tuple with the specified values.

GetAccessPath ( Type tupleType, int index ) : IEnumerable

Gets the series of properties that needs to be accessed to access a logical item in a potentially nested tuple.

GetNestedValue ( int size, int index ) : object

Gets the value at the given index for a tuple of the given size. This get supports walking through nested tuples to get the correct final index.

GetSize ( Type tupleType ) : int

Gets the number of usable slots in the provided Tuple type including slots available in nested tuples.

GetTupleType ( int size ) : Type

Gets the unbound generic Tuple type which has at lease size slots or null if a large enough tuple is not available.

GetTupleValues ( MutableTuple tuple ) : object[]

Gets the values from a tuple including unpacking nested values.

GetValue ( int index ) : object
MakeTuple ( Type tupleType ) : MutableTuple

Creates a new instance of tupleType with the specified args. If the tuple is a nested tuple the values are added in their nested forms.

MakeTupleType ( ) : Type

Creates a generic tuple with the specified types. If the number of slots fits within the maximum tuple size then we simply create a single tuple. If it's greater then we create nested tuples (e.g. a Tuple`2 which contains a Tuple`128 and a Tuple`8 if we had a size of 136).

SetNestedValue ( int size, int index, object value ) : void

Sets the value at the given index for a tuple of the given size. This set supports walking through nested tuples to get the correct final index.

SetValue ( int index, object value ) : void

Private Methods

Méthode Description
CreateNew ( Type tupleType, int start, int end, Expression values ) : Expression
CreateTupleInstance ( Type tupleType, int start, int end, object args ) : MutableTuple
GetAccessPath ( int size, int index ) : IEnumerable
GetAccessProperties ( Type tupleType, int size, int index ) : IEnumerable

Gets the series of properties that needs to be accessed to access a logical item in a potentially nested tuple.

GetTupleValues ( MutableTuple tuple, List args ) : void
MakeTuple ( Type tupleType, int start, int end, object args ) : MutableTuple
MakeTupleType ( Type types, int start, int end ) : Type
PowerOfTwoRound ( int value ) : int

Method Details

Create() public static méthode

Provides an expression for creating a tuple with the specified values.
public static Create ( ) : Expression
Résultat Expression

GetAccessPath() public static méthode

Gets the series of properties that needs to be accessed to access a logical item in a potentially nested tuple.
public static GetAccessPath ( Type tupleType, int index ) : IEnumerable
tupleType System.Type
index int
Résultat IEnumerable

GetNestedValue() public méthode

Gets the value at the given index for a tuple of the given size. This get supports walking through nested tuples to get the correct final index.
public GetNestedValue ( int size, int index ) : object
size int
index int
Résultat object

GetSize() public static méthode

Gets the number of usable slots in the provided Tuple type including slots available in nested tuples.
public static GetSize ( Type tupleType ) : int
tupleType System.Type
Résultat int

GetTupleType() public static méthode

Gets the unbound generic Tuple type which has at lease size slots or null if a large enough tuple is not available.
public static GetTupleType ( int size ) : Type
size int
Résultat System.Type

GetTupleValues() public static méthode

Gets the values from a tuple including unpacking nested values.
public static GetTupleValues ( MutableTuple tuple ) : object[]
tuple MutableTuple
Résultat object[]

GetValue() public abstract méthode

public abstract GetValue ( int index ) : object
index int
Résultat object

MakeTuple() public static méthode

Creates a new instance of tupleType with the specified args. If the tuple is a nested tuple the values are added in their nested forms.
public static MakeTuple ( Type tupleType ) : MutableTuple
tupleType System.Type
Résultat MutableTuple

MakeTupleType() public static méthode

Creates a generic tuple with the specified types. If the number of slots fits within the maximum tuple size then we simply create a single tuple. If it's greater then we create nested tuples (e.g. a Tuple`2 which contains a Tuple`128 and a Tuple`8 if we had a size of 136).
public static MakeTupleType ( ) : Type
Résultat System.Type

SetNestedValue() public méthode

Sets the value at the given index for a tuple of the given size. This set supports walking through nested tuples to get the correct final index.
public SetNestedValue ( int size, int index, object value ) : void
size int
index int
value object
Résultat void

SetValue() public abstract méthode

public abstract SetValue ( int index, object value ) : void
index int
value object
Résultat void

Property Details

MaxSize public_oe static_oe property

public static int MaxSize
Résultat int