public static void GetEnumerableScalarCodegen( 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")) .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 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"))); }