예제 #1
0
 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")));
 }
예제 #2
0
 public static void GetEnumerableEventCodegen(
     AggregationAccessorLastWEvalForge forge,
     AggregationStateLinearForge stateForge,
     AggregationAccessorForgeGetCodegenContext context)
 {
     context.Method.Block.MethodReturn(
         stateForge.AggregatorLinear.GetLastValueCodegen(
             context.ClassScope,
             context.Method,
             context.NamedMethods));
 }
예제 #3
0
 public static void GetEnumerableEventsCodegen(
     AggregationAccessorLastWEvalForge forge,
     AggregationStateLinearForge factoryLinear,
     AggregationAccessorForgeGetCodegenContext context)
 {
     context.Method.Block.DeclareVar<EventBean>(
             "bean",
             factoryLinear.AggregatorLinear.GetLastValueCodegen(
                 context.ClassScope,
                 context.Method,
                 context.NamedMethods))
         .IfRefNullReturnNull("bean")
         .MethodReturn(StaticMethod(typeof(Collections), "SingletonList", Ref("bean")));
 }
예제 #4
0
 public static void GetValueCodegen(
     AggregationAccessorLastWEvalForge forge,
     AggregationStateLinearForge factoryLinear,
     AggregationAccessorForgeGetCodegenContext context)
 {
     CodegenMethod childExpr = CodegenLegoMethodExpression.CodegenExpression(
         forge.ChildNode,
         context.Method,
         context.ClassScope,
         true);
     context.Method.Block
         .DeclareVar<EventBean>(
             "bean",
             factoryLinear.AggregatorLinear.GetLastValueCodegen(
                 context.ClassScope,
                 context.Method,
                 context.NamedMethods))
         .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()));
 }