public static String GetName(this SupportAggMFFunc value) { switch (value) { case SupportAggMFFunc.SINGLE_EVENT_1: return("se1"); case SupportAggMFFunc.SINGLE_EVENT_2: return("se2"); case SupportAggMFFunc.ENUM_EVENT: return("ee"); case SupportAggMFFunc.COLL_SCALAR: return("sc"); case SupportAggMFFunc.ARR_SCALAR: return("sa"); case SupportAggMFFunc.SCALAR: return("ss"); } throw new ArgumentException(); }
public static PlugInAggregationMultiFunctionStateFactory GetStateFactory(this SupportAggMFFunc value, PlugInAggregationMultiFunctionValidationContext validationContext) { if (value == SupportAggMFFunc.SCALAR) { if (validationContext.ParameterExpressions.Length != 1) { throw new ArgumentException("Function '" + validationContext.FunctionName + "' requires 1 parameter"); } var evaluator = validationContext.ParameterExpressions[0].ExprEvaluator; return(new SupportAggMFStatePlainScalarFactory(evaluator)); } if (value == SupportAggMFFunc.ARR_SCALAR || value == SupportAggMFFunc.COLL_SCALAR) { if (validationContext.ParameterExpressions.Length != 1) { throw new ArgumentException("Function '" + validationContext.FunctionName + "' requires 1 parameter"); } var evaluator = validationContext.ParameterExpressions[0].ExprEvaluator; return(new SupportAggMFStateArrayCollScalarFactory(evaluator)); } if (value == SupportAggMFFunc.ENUM_EVENT) { return(new ProxyPlugInAggregationMultiFunctionStateFactory { ProcMakeAggregationState = stateContext => new SupportAggMFStateEnumerableEvents() }); } throw new ArgumentException("Return type not supported for " + value); }
public static AggregationAccessor GetAccessor(this SupportAggMFFunc value) { switch (value) { case SupportAggMFFunc.SINGLE_EVENT_1: return(null); case SupportAggMFFunc.SINGLE_EVENT_2: return(null); case SupportAggMFFunc.ENUM_EVENT: return(GetAccessor(typeof(SupportAggMFAccessorEnumerableEvents))); case SupportAggMFFunc.COLL_SCALAR: return(GetAccessor(typeof(SupportAggMFAccessorCollScalar))); case SupportAggMFFunc.ARR_SCALAR: return(GetAccessor(typeof(SupportAggMFAccessorArrScalar))); case SupportAggMFFunc.SCALAR: return(GetAccessor(typeof(SupportAggMFAccessorPlainScalar))); } throw new ArgumentException(); }
public static EPType GetReturnType(this SupportAggMFFunc value, EventType eventType, ExprNode[] parameters) { if (value == SupportAggMFFunc.SCALAR) { return(EPTypeHelper.SingleValue(parameters[0].ExprEvaluator.ReturnType)); } if (value == SupportAggMFFunc.ENUM_EVENT) { return(EPTypeHelper.CollectionOfEvents(eventType)); } if (value == SupportAggMFFunc.COLL_SCALAR) { return(EPTypeHelper.CollectionOfSingleValue(parameters[0].ExprEvaluator.ReturnType)); } if (value == SupportAggMFFunc.ARR_SCALAR) { return(EPTypeHelper.Array(parameters[0].ExprEvaluator.ReturnType)); } if (value == SupportAggMFFunc.SINGLE_EVENT_1 || value == SupportAggMFFunc.SINGLE_EVENT_2) { return(EPTypeHelper.SingleEvent(eventType)); } throw new ArgumentException("Return type not supported for " + value); }