C# Class YAMP.FunctionValue

A function value, i.e. a lambda expression or existing function wrapped as a value that can be used within YAMP.
Inheritance: Value, IFunction
Afficher le fichier Open project: FlorianRappl/YAMP Class Usage Examples

Méthodes publiques

Méthode Description
AsMemberFunction ( ) : MemberFunction

Tries to cast the function to a member function.

Copy ( ) : Value

Does not clone the function, but just returns the same function again.

Deserialize ( byte content ) : Value

Tries to create a new instance from the given bytes.

FunctionValue ( ) : System

Creates a new (dummy) instance of a FunctionValue.

FunctionValue ( Func f, System.Boolean standardFunctionBehaviour = false ) : System

Creates a new instance of a FunctionValue with a delegate argument.

FunctionValue ( IFunction function ) : System

Creates a new FunctionValue with a given class that contains a perform method, i.e. implements the IFunction interface.

FunctionValue ( String arguments, String body ) : System

Creates a new FunctionValue with data to parse.

Perform ( ParseContext context, Value argument ) : Value

Invokes the given function value.

Serialize ( ) : byte[]

Tries to convert the given instance into bytes.

ToString ( ) : String

Returns a string representation of the function.

Private Methods

Méthode Description
FunctionValue ( String arguments, Expression body ) : System

Creates a new FunctionValue with a parsed object (lambda expression).

FunctionValue ( String name, String arguments, Expression body ) : System

Creates a new FunctionValue with a parsed named function (function).

SetPerform ( String arguments, Expression body ) : void
SetPerform ( String name, String arguments, Expression body ) : void

Method Details

AsMemberFunction() public méthode

Tries to cast the function to a member function.
public AsMemberFunction ( ) : MemberFunction
Résultat MemberFunction

Copy() public méthode

Does not clone the function, but just returns the same function again.
public Copy ( ) : Value
Résultat Value

Deserialize() public méthode

Tries to create a new instance from the given bytes.
public Deserialize ( byte content ) : Value
content byte The binary content.
Résultat Value

FunctionValue() public méthode

Creates a new (dummy) instance of a FunctionValue.
public FunctionValue ( ) : System
Résultat System

FunctionValue() public méthode

Creates a new instance of a FunctionValue with a delegate argument.
public FunctionValue ( Func f, System.Boolean standardFunctionBehaviour = false ) : System
f Func Delegate to be wrapped in a function
standardFunctionBehaviour System.Boolean indicates if the wrapper /// should include the StandardFunction behaviour, i.e. scalar execution /// for ScalarValues and matrix execution for MatrixValues
Résultat System

FunctionValue() public méthode

Creates a new FunctionValue with a given class that contains a perform method, i.e. implements the IFunction interface.
public FunctionValue ( IFunction function ) : System
function IFunction The instance of the class implementing the IFunction interface.
Résultat System

FunctionValue() public méthode

Creates a new FunctionValue with data to parse.
public FunctionValue ( String arguments, String body ) : System
arguments String The list of argument identifiers.
body String The string representation of the body.
Résultat System

Perform() public méthode

Invokes the given function value.
public Perform ( ParseContext context, Value argument ) : Value
context ParseContext The context of the invocation.
argument Value The argument(s) to use for the invocation.
Résultat Value

Serialize() public méthode

Tries to convert the given instance into bytes.
public Serialize ( ) : byte[]
Résultat byte[]

ToString() public méthode

Returns a string representation of the function.
public ToString ( ) : String
Résultat String