public Cast(Entity.DataType resultType) { ResultType = resultType; AddInput(Reference, new Entity.Variable(AnyType.Instance), true); AddOutput(Value, new Entity.Variable(resultType), true); AddOutput(Succeed, new Entity.Variable(Scalar.Boolean)); }
public Fill(Entity.DataType stored) : base() { AddInput("array", new Entity.Variable(new Entity.Type.ListType(stored)), true); AddInput("element", new Entity.Variable(stored)); AddInput("count", new Entity.Variable(Entity.Type.Scalar.Integer)); AddOutput("count", new Entity.Variable(Entity.Type.Scalar.Integer)); }
public SetValueAt(Entity.DataType stored) : base() { Entity.Variable val = new Entity.Variable(stored); AddInput("array", new Entity.Variable(new Entity.Type.ListType(stored)), true); AddInput("value", val); AddInput("index", new Entity.Variable(Entity.Type.Scalar.Integer)); AddOutput("value", val, true); }
/// <summary> /// Constructor that need inputs and outputs type, and the operation to execute /// </summary> /// <param name="lOpType">Type of the left operand</param> /// <param name="rOpType">Type of the right operand</param> /// <param name="operation">Operation to execute</param> /// <param name="resultType">Type of the returned value</param> public BinaryOperator(Entity.DataType lOpType, Entity.DataType rOpType, Func <dynamic, dynamic, dynamic> operation, Entity.DataType resultType, bool outreference = false) : base(resultType, operation, outreference) { AddInput(Global.Operator.Left, new Entity.Variable(lOpType), true); AddInput(Global.Operator.Right, new Entity.Variable(rOpType), true); }
/// <summary> /// Constructor that need inputs types /// </summary> /// <param name="leftOpType">Type of the left operand</param> /// <param name="rightOpType">Type of the right operand</param> public Greater(Entity.DataType leftOpType, Entity.DataType rightOpType) : base(leftOpType, rightOpType, (dynamic left, dynamic right) => leftOpType.OperatorGt(left, right)) { }
/// <summary> /// Constructor that /// </summary> /// <param name="lOpType">Type of the left operand</param> /// <param name="rOpType">Type of the right operand</param> /// <param name="resType">Type of the returned value</param> public BinaryAnd(Entity.DataType lOpType, Entity.DataType rOpType, Entity.DataType resType) : base(lOpType, rOpType, (dynamic left, dynamic right) => lOpType.OperatorBAnd(left, right), resType) { }
/// <summary> /// Constructor that need input and output type /// </summary> /// <param name="opType">Operand type</param> /// <param name="resType">Returned value type</param> public Increment(Entity.DataType opType, Entity.DataType resType) : base(opType, (dynamic op) => ++ op, resType) { }
/// <summary> /// Constructor that need input and output type /// </summary> /// <param name="opType">Type of the operand</param> /// <param name="resType">Type of the returned value</param> public BinaryNot(Entity.DataType opType, Entity.DataType resType) : base(opType, (dynamic op) => opType.OperatorBNot(op), resType) { }
/// <summary> /// Constructor need inputs and output type /// </summary> /// <param name="lOpType">Type of the left operand</param> /// <param name="rOpType">Type of the right operand</param> /// <param name="resType">Type of the returned value</param> public Access(Entity.DataType lOpType, Entity.DataType rOpType, Entity.DataType resType) : base(lOpType, rOpType, (dynamic left, dynamic right) => lOpType.OperatorAccess(left, right), resType, true) { }
/// <summary> /// Constructor that need inputs and output type /// </summary> /// <param name="lOpType">Type of the left operand</param> /// <param name="rOpType">Type of the right operand</param> /// <param name="resultType">Type of the returned value</param> public Add(Entity.DataType lOpType, Entity.DataType rOpType, Entity.DataType resultType) : base(lOpType, rOpType, (dynamic left, dynamic right) => lOpType.OperatorAdd(left, right), resultType) { }
/// <summary> /// Constructor that /// </summary> /// <param name="lOpType">Type of the left operand</param> /// <param name="rOpType">Type of the right operand</param> /// <param name="resType">Type of the returned value</param> public Multiplicate(Entity.DataType lOpType, Entity.DataType rOpType, Entity.DataType resType) : base(lOpType, rOpType, (dynamic left, dynamic right) => lOpType.OperatorMul(left, right), resType) { }
/// <summary> /// Constructor that need inputs type /// </summary> /// <param name="leftOpType">Type of the left operand</param> /// <param name="rightOpType">Type of the right operand</param> public Different(Entity.DataType leftOpType, Entity.DataType rightOpType) : base(leftOpType, rightOpType, (dynamic left, dynamic right) => !leftOpType.OperatorEqual(left, right)) { }
/// <summary> /// Constructor that need input and output type, and the operation the execute /// </summary> /// <param name="opType">Type of the operand</param> /// <param name="operation">Operation to execute</param> /// <param name="resultType">Type of the returned value</param> public UnaryOperator(Entity.DataType opType, Func <dynamic, dynamic> operation, Entity.DataType resultType, bool outreference = false) : base(resultType, operation, outreference) { AddInput("Operand", new Entity.Variable(opType), true); }
/// <summary> /// Constructor that only need input type (assume that output is same type) /// </summary> /// <param name="opType">Operand type</param> public Not(Entity.DataType opType) : base(opType, (dynamic op) => !op, Scalar.Boolean) { }
public Clear(Entity.DataType stored) : base() { AddInput("array", new Entity.Variable(new Entity.Type.ListType(stored)), true); }
/// <summary> /// Constructor that need inputs, outputs and operation /// </summary> /// <param name="inputs">Dictionnary of all inputs</param> /// <param name="outputType">Dictionnary of all outputs</param> /// <param name="operation">Operation to execute</param> public Operator(Entity.DataType outputType, Delegate operation, bool outreference = false) : base() { AddOutput(Global.Operator.Result, new Entity.Variable(outputType), outreference); this.operation = operation; }
/// <summary> /// Constructor that need inputs types and the operation to process /// </summary> /// <param name="lOpType">Type of the left operand</param> /// <param name="rOpType">Type of the right operand</param> /// <param name="operation">Operation to execute</param> public LogicalOperator(Entity.DataType lOpType, Entity.DataType rOpType, Func <dynamic, dynamic, dynamic> operation) : base(lOpType, rOpType, operation, Entity.Type.Scalar.Boolean) { }
/// <summary> /// Constructor that need input and output type /// </summary> /// <param name="opType">Operand type</param> /// <param name="resType">Returned value type</param> public Inverse(Entity.DataType opType, Entity.DataType resType) : base(opType, (dynamic op) => - op, resType) { }
/// <summary> /// Checks if an output type is compatible with a given type /// </summary> /// <param name="name">Name of the ouput</param> /// <param name="type">Type to check</param> /// <returns>Treue if types are compatibles, false either</returns> public bool IsOutputCompatible(string name, Entity.DataType type) { return(type.IsValueOfType(outputs[name].Value)); }
/// <summary> /// Constructor that need inputs type /// </summary> /// <param name="leftOpType">Type of the left operand</param> /// <param name="rightOpType">Type of the right operand</param> public LessEqual(Entity.DataType leftOpType, Entity.DataType rightOpType) : base(leftOpType, rightOpType, (dynamic left, dynamic right) => leftOpType.OperatorLtEq(left, right)) { }
/// <summary> /// Constructor that /// </summary> /// <param name="lOpType">Type of the left operand</param> /// <param name="rOpType">Type of the right operand</param> /// <param name="resType">Type of the returned value</param> public Xor(Entity.DataType lOpType, Entity.DataType rOpType, Entity.DataType resType) : base(lOpType, rOpType, (dynamic left, dynamic right) => lOpType.OperatorXor(left, right), resType) { }
/// <summary> /// Constructor that /// </summary> /// <param name="lOpType">Type of the left operand</param> /// <param name="rOpType">Type of the right operand</param> /// <param name="resType">Type of the returned value</param> public Substract(Entity.DataType lOpType, Entity.DataType rOpType, Entity.DataType resType) : base(lOpType, rOpType, (dynamic left, dynamic right) => lOpType.OperatorSub(left, right), resType) { }