public static void GetValueCodegen( AggregationAccessorWindowNoEvalForge forge, AggregationStateLinearForge accessStateFactory, AggregationAccessorForgeGetCodegenContext context) { var size = accessStateFactory.AggregatorLinear.SizeCodegen(); var iterator = accessStateFactory.AggregatorLinear.EnumeratorCodegen( context.ClassScope, context.Method, context.NamedMethods); context.Method.Block.IfCondition(EqualsIdentity(size, Constant(0))) .BlockReturn(ConstantNull()) .DeclareVar( TypeHelper.GetArrayType(forge.ComponentType), "array", NewArrayByLength(forge.ComponentType, size)) .DeclareVar<int>("count", Constant(0)) .DeclareVar<IEnumerator<EventBean>>("it", iterator) .WhileLoop(ExprDotMethod(Ref("it"), "MoveNext")) .DeclareVar<EventBean>("bean", Cast(typeof(EventBean), ExprDotName(Ref("it"), "Current"))) .AssignArrayElement( Ref("array"), Ref("count"), Cast(forge.ComponentType, ExprDotUnderlying(Ref("bean")))) .Increment("count") .BlockEnd() .MethodReturn(Ref("array")); }
public static void GetValueCodegen( AggregationAccessorFirstLastIndexWEvalForge forge, AggregationAccessorForgeGetCodegenContext context) { AggregationStateLinearForge stateForge = (AggregationStateLinearForge) context.AccessStateForge; CodegenMethod getBeanFirstLastIndex = GetBeanFirstLastIndexCodegen( forge, context.Column, context.ClassScope, stateForge, context.Method, context.NamedMethods); context.Method.Block.DeclareVar<EventBean>("bean", LocalMethod(getBeanFirstLastIndex)) .DebugStack() .IfRefNullReturnNull("bean") .DeclareVar<EventBean[]>( "eventsPerStreamBuf", NewArrayByLength(typeof(EventBean), Constant(forge.StreamNum + 1))) .AssignArrayElement("eventsPerStreamBuf", Constant(forge.StreamNum), Ref("bean")) .MethodReturn( LocalMethod( CodegenLegoMethodExpression.CodegenExpression( forge.ChildNode, context.Method, context.ClassScope, true), Ref("eventsPerStreamBuf"), ConstantTrue(), ConstantNull())); }
public void GetValueCodegen(AggregationAccessorForgeGetCodegenContext context) { AggregationAccessorLastWEval.GetValueCodegen( this, (AggregationStateLinearForge) context.AccessStateForge, context); }
public void GetEnumerableScalarCodegen(AggregationAccessorForgeGetCodegenContext context) { AggregationAccessorWindowNoEval.GetEnumerableScalarCodegen( this, (AggregationStateLinearForge) context.AccessStateForge, context); }
public void GetValueCodegen(AggregationAccessorForgeGetCodegenContext context) { var eventToPublic = TableDeployTimeResolver.MakeTableEventToPublicField(table, context.ClassScope, GetType()); var sorted = (AggregatorAccessSorted) context.AccessStateForge.Aggregator; var size = sorted.SizeCodegen(); var enumerator = max ? sorted.ReverseEnumeratorCodegen() : sorted.EnumeratorCodegen(); context.Method.Block.IfCondition(EqualsIdentity(size, Constant(0))) .BlockReturn(ConstantNull()) .DeclareVar(TypeHelper.GetArrayType(componentType), "array", NewArrayByLength(componentType, size)) .DeclareVar<int>("count", Constant(0)) .DeclareVar<IEnumerator<EventBean>>("enumerator", enumerator) .WhileLoop(ExprDotMethod(Ref("enumerator"), "MoveNext")) .DeclareVar<EventBean>("bean", Cast(typeof(EventBean), ExprDotName(Ref("enumerator"), "Current"))) .AssignArrayElement( Ref("array"), Ref("count"), ExprDotMethod( eventToPublic, "ConvertToUnd", Ref("bean"), REF_EPS, REF_ISNEWDATA, REF_EXPREVALCONTEXT)) .IncrementRef("count") .BlockEnd() .MethodReturn(Ref("array")); }
public void GetEnumerableEventCodegen(AggregationAccessorForgeGetCodegenContext context) { AggregationAccessorFirstWEval.GetEnumerableEventCodegen( this, (AggregationStateLinearForge) context.AccessStateForge, context); }
public static void GetEnumerableScalarCodegen( AggregationAccessorLastWEvalForge forge, AggregationStateLinearForge stateForge, AggregationAccessorForgeGetCodegenContext context) { CodegenMethod childExpr = CodegenLegoMethodExpression.CodegenExpression( forge.ChildNode, context.Method, context.ClassScope, true); context.Method.Block.DeclareVar<EventBean>( "bean", stateForge.AggregatorLinear.GetLastValueCodegen( context.ClassScope, context.Method, context.NamedMethods)) .DebugStack() .IfRefNullReturnNull("bean") .DeclareVar<EventBean[]>( "eventsPerStreamBuf", NewArrayByLength(typeof(EventBean), Constant(forge.StreamNum + 1))) .AssignArrayElement("eventsPerStreamBuf", Constant(forge.StreamNum), Ref("bean")) .DeclareVar<object>( "value", LocalMethod(childExpr, Ref("eventsPerStreamBuf"), Constant(true), ConstantNull())) .IfRefNullReturnNull("value") .MethodReturn(StaticMethod(typeof(Collections), "SingletonList", Ref("value"))); }
public static void GetEnumerableEventCodegen( AggregationAccessorFirstWEvalForge forge, AggregationStateLinearForge stateForge, AggregationAccessorForgeGetCodegenContext context) { context.Method.Block.MethodReturn( stateForge.AggregatorLinear.GetFirstValueCodegen(context.ClassScope, context.Method)); }
public void GetEnumerableEventCodegen(AggregationAccessorForgeGetCodegenContext context) { var sorted = (AggregatorAccessSorted) context.AccessStateForge.Aggregator; if (max) { context.Method.Block.MethodReturn(sorted.GetLastValueCodegen(context.ClassScope, context.Method)); } else { context.Method.Block.MethodReturn(sorted.GetFirstValueCodegen(context.ClassScope, context.Method)); } }
public static void GetEnumerableEventsCodegen( AggregationAccessorFirstWEvalForge forge, AggregationStateLinearForge stateForge, AggregationAccessorForgeGetCodegenContext context) { context.Method.Block.DeclareVar<EventBean>( "bean", stateForge.AggregatorLinear.GetFirstValueCodegen(context.ClassScope, context.Method)) .IfRefNullReturnNull("bean") .MethodReturn(StaticMethod(typeof(Collections), "SingletonList", Ref("bean"))); }
public override void GetValueCodegen(AggregationAccessorForgeGetCodegenContext context) { var forge = (AggregatorAccessSorted) context.AccessStateForge.Aggregator; context.Method.Block.DeclareVar<EventBean>( "@event", max ? forge.GetLastValueCodegen(context.ClassScope, context.Method) : forge.GetFirstValueCodegen(context.ClassScope, context.Method)) .IfRefNullReturnNull("@event") .MethodReturn(ExprDotUnderlying(Ref("@event"))); }
public void GetEnumerableEventsCodegen(AggregationAccessorForgeGetCodegenContext context) { var forge = (AggregatorAccessSorted) context.AccessStateForge.Aggregator; context.Method.Block .DeclareVar<EventBean>( "bean", max ? forge.GetLastValueCodegen(context.ClassScope, context.Method) : forge.GetFirstValueCodegen(context.ClassScope, context.Method)) .IfRefNullReturnNull("bean") .MethodReturn(StaticMethod(typeof(Collections), "SingletonList", Ref("bean"))); }
public static void GetEnumerableEventsCodegen( AggregationAccessorWindowNoEvalForge forge, AggregationStateLinearForge stateForge, AggregationAccessorForgeGetCodegenContext context) { context.Method.Block.IfCondition(EqualsIdentity(stateForge.AggregatorLinear.SizeCodegen(), Constant(0))) .BlockReturn(ConstantNull()) .MethodReturn( stateForge.AggregatorLinear.CollectionReadOnlyCodegen( context.Method, context.ClassScope, context.NamedMethods)); }
public static void GetEnumerableEventCodegen( AggregationAccessorFirstLastIndexWEvalForge forge, AggregationAccessorForgeGetCodegenContext context) { AggregationStateLinearForge stateForge = (AggregationStateLinearForge) context.AccessStateForge; CodegenMethod getBeanFirstLastIndex = GetBeanFirstLastIndexCodegen( forge, context.Column, context.ClassScope, stateForge, context.Method, context.NamedMethods); context.Method.Block.MethodReturn(LocalMethod(getBeanFirstLastIndex)); }
public static void GetEnumerableEventsCodegen( AggregationAccessorFirstLastIndexWEvalForge forge, AggregationAccessorForgeGetCodegenContext context) { AggregationStateLinearForge stateForge = (AggregationStateLinearForge) context.AccessStateForge; CodegenMethod getBeanFirstLastIndex = GetBeanFirstLastIndexCodegen( forge, context.Column, context.ClassScope, stateForge, context.Method, context.NamedMethods); context.Method.Block.DeclareVar<EventBean>("bean", LocalMethod(getBeanFirstLastIndex)) .IfRefNullReturnNull("bean") .MethodReturn(StaticMethod(typeof(Collections), "SingletonList", Ref("bean"))); }
public void GetValueCodegen(AggregationAccessorForgeGetCodegenContext context) { var sorted = (AggregatorAccessSorted) context.AccessStateForge.Aggregator; var size = sorted.SizeCodegen(); var iterator = max ? sorted.ReverseEnumeratorCodegen : sorted.EnumeratorCodegen(); context.Method.Block.IfCondition(EqualsIdentity(size, Constant(0))) .BlockReturn(ConstantNull()) .DeclareVar(TypeHelper.GetArrayType(componentType), "array", NewArrayByLength(componentType, size)) .DeclareVar<int>("count", Constant(0)) .DeclareVar<IEnumerator<EventBean>>("it", iterator) .WhileLoop(ExprDotMethod(Ref("it"), "MoveNext")) .DeclareVar<EventBean>("bean", Cast(typeof(EventBean), ExprDotName(Ref("it"), "Current"))) .AssignArrayElement(Ref("array"), Ref("count"), Cast(componentType, ExprDotUnderlying(Ref("bean")))) .Increment("count") .BlockEnd() .MethodReturn(Ref("array")); }
public override void GetValueCodegen(AggregationAccessorForgeGetCodegenContext context) { var eventToPublic = TableDeployTimeResolver.MakeTableEventToPublicField(table, context.ClassScope, GetType()); var forge = (AggregatorAccessSorted) context.AccessStateForge.Aggregator; context.Method.Block.DeclareVar<EventBean>( "@event", max ? forge.GetLastValueCodegen(context.ClassScope, context.Method) : forge.GetFirstValueCodegen(context.ClassScope, context.Method)) .IfRefNullReturnNull("@event") .MethodReturn( ExprDotMethod( eventToPublic, "ConvertToUnd", Ref("@event"), REF_EPS, REF_ISNEWDATA, REF_EXPREVALCONTEXT)); }
public static void GetValueCodegen( AggregationAccessorFirstWEvalForge forge, AggregationStateLinearForge accessStateFactory, AggregationAccessorForgeGetCodegenContext context) { CodegenMethod childExpr = CodegenLegoMethodExpression.CodegenExpression( forge.ChildNode, context.Method, context.ClassScope, true); context.Method.Block.DeclareVar<EventBean>( "bean", accessStateFactory.AggregatorLinear.GetFirstValueCodegen(context.ClassScope, context.Method)) .DebugStack() .IfRefNullReturnNull("bean") .DeclareVar<EventBean[]>( "eventsPerStreamBuf", NewArrayByLength(typeof(EventBean), Constant(forge.StreamNum + 1))) .AssignArrayElement("eventsPerStreamBuf", Constant(forge.StreamNum), Ref("bean")) .MethodReturn(LocalMethod(childExpr, Ref("eventsPerStreamBuf"), Constant(true), ConstantNull())); }
public static void GetEnumerableScalarCodegen( AggregationAccessorWindowWEvalForge forge, AggregationStateLinearForge stateForge, AggregationAccessorForgeGetCodegenContext context) { context.Method.Block .DeclareVar<int>("size", stateForge.AggregatorLinear.SizeCodegen()) .IfCondition(EqualsIdentity(Ref("size"), Constant(0))) .BlockReturn(ConstantNull()) .DeclareVar<IList<object>>("values", NewInstance<List<object>>(Ref("size"))) .DeclareVar<IEnumerator<EventBean>>( "enumerator", stateForge.AggregatorLinear.EnumeratorCodegen( context.ClassScope, context.Method, context.NamedMethods)) .DebugStack() .DeclareVar<EventBean[]>( "eventsPerStreamBuf", NewArrayByLength(typeof(EventBean), Constant(forge.StreamNum + 1))) .WhileLoop(ExprDotMethod(Ref("enumerator"), "MoveNext")) .DeclareVar<EventBean>("bean", Cast(typeof(EventBean), ExprDotName(Ref("enumerator"), "Current"))) .AssignArrayElement("eventsPerStreamBuf", Constant(forge.StreamNum), Ref("bean")) .DeclareVar( forge.ChildNode.EvaluationType.GetBoxedType(), "value", LocalMethod( CodegenLegoMethodExpression.CodegenExpression( forge.ChildNode, context.Method, context.ClassScope, true), Ref("eventsPerStreamBuf"), ConstantTrue(), ConstantNull())) .ExprDotMethod(Ref("values"), "Add", Ref("value")) .BlockEnd() .MethodReturn(Ref("values")); }
public static void GetEnumerableScalarCodegen( AggregationAccessorWindowNoEvalForge forge, AggregationStateLinearForge stateForge, AggregationAccessorForgeGetCodegenContext context) { context.Method.Block.DeclareVar<int>("size", stateForge.AggregatorLinear.SizeCodegen()) .IfCondition(EqualsIdentity(Ref("size"), Constant(0))) .BlockReturn(ConstantNull()) .DeclareVar<IList<object>>("values", NewInstance<List<object>>(Ref("size"))) .DeclareVar<IEnumerator<EventBean>>( "it", stateForge.AggregatorLinear.EnumeratorCodegen( context.ClassScope, context.Method, context.NamedMethods)) .WhileLoop(ExprDotMethod(Ref("it"), "MoveNext")) .DeclareVar<EventBean>("bean", Cast(typeof(EventBean), ExprDotName(Ref("it"), "Current"))) .DeclareVar(forge.ComponentType, "value", Cast(forge.ComponentType, ExprDotUnderlying(Ref("bean")))) .ExprDotMethod(Ref("values"), "Add", Ref("value")) .BlockEnd() .MethodReturn(Ref("values")); }
public static void GetValueCodegen( AggregationAccessorWindowWEvalForge forge, AggregationStateLinearForge accessStateFactory, AggregationAccessorForgeGetCodegenContext context) { var size = accessStateFactory.AggregatorLinear.SizeCodegen(); var enumerator = accessStateFactory.AggregatorLinear.EnumeratorCodegen( context.ClassScope, context.Method, context.NamedMethods); var childExpr = CodegenLegoMethodExpression.CodegenExpression( forge.ChildNode, context.Method, context.ClassScope, false); var childExprType = forge.ChildNode.EvaluationType; CodegenExpression invokeChild = LocalMethod(childExpr, Ref("eventsPerStreamBuf"), Constant(true), ConstantNull()); if (forge.ComponentType != childExprType) { invokeChild = Unbox(invokeChild); } context.Method.Block .IfCondition(EqualsIdentity(size, Constant(0))) .BlockReturn(ConstantNull()) .DeclareVar(TypeHelper.GetArrayType(forge.ComponentType), "array", NewArrayByLength(forge.ComponentType, size)) .DeclareVar<int>("count", Constant(0)) .DeclareVar<IEnumerator<EventBean>>("enumerator", enumerator) .DebugStack() .DeclareVar<EventBean[]>("eventsPerStreamBuf", NewArrayByLength(typeof(EventBean), Constant(forge.StreamNum + 1))) .WhileLoop(ExprDotMethod(Ref("enumerator"), "MoveNext")) .DeclareVar<EventBean>("bean", Cast(typeof(EventBean), ExprDotName(Ref("enumerator"), "Current"))) .AssignArrayElement("eventsPerStreamBuf", Constant(forge.StreamNum), Ref("bean")) .AssignArrayElement(Ref("array"), Ref("count"), invokeChild) .IncrementRef("count") .BlockEnd() .MethodReturn(Ref("array")); }
public void GetValueCodegen(AggregationAccessorForgeGetCodegenContext context) { AggregationAccessorFirstLastIndexWEval.GetValueCodegen(this, context); }
public void GetEnumerableScalarCodegen(AggregationAccessorForgeGetCodegenContext context) { MakeBlock("GetEnumerableScalar", context.Column, context.Method, context.ClassScope); }
public void GetEnumerableScalarCodegen(AggregationAccessorForgeGetCodegenContext context) { AggregationAccessorFirstLastIndexWEval.GetEnumerableScalarCodegen(this, context); }
public abstract void GetValueCodegen(AggregationAccessorForgeGetCodegenContext context);
public void GetValueCodegen(AggregationAccessorForgeGetCodegenContext context) { MakeBlock("GetValue", context.Column, context.Method, context.ClassScope); }
public void GetEnumerableEventsCodegen(AggregationAccessorForgeGetCodegenContext context) { var sorted = (AggregatorAccessSorted) context.AccessStateForge.Aggregator; context.Method.Block.MethodReturn(sorted.CollectionReadOnlyCodegen()); }
public void GetEnumerableEventCodegen(AggregationAccessorForgeGetCodegenContext context) { context.Method.Block.MethodReturn(ConstantNull()); }