Example #1
0
 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")));
 }
Example #2
0
 public static void GetEnumerableEventCodegen(
     AggregationAccessorFirstWEvalForge forge,
     AggregationStateLinearForge stateForge,
     AggregationAccessorForgeGetCodegenContext context)
 {
     context.Method.Block.MethodReturn(
         stateForge.AggregatorLinear.GetFirstValueCodegen(context.ClassScope, context.Method));
 }
Example #3
0
 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")));
 }