C# Class Microsoft.Scripting.MutableTuple

Mostra file Open project: jschementi/iron Class Usage Examples

Public Properties

Property Type Description
MaxSize int

Public Methods

Method 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

Method 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 method

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

GetAccessPath() public static method

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
return IEnumerable

GetNestedValue() public method

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
return object

GetSize() public static method

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
return int

GetTupleType() public static method

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
return System.Type

GetTupleValues() public static method

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

GetValue() public abstract method

public abstract GetValue ( int index ) : object
index int
return object

MakeTuple() public static method

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
return MutableTuple

MakeTupleType() public static method

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
return System.Type

SetNestedValue() public method

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
return void

SetValue() public abstract method

public abstract SetValue ( int index, object value ) : void
index int
value object
return void

Property Details

MaxSize public_oe static_oe property

public static int MaxSize
return int