Exemple #1
0
        public CodegenExpression MakeCodegen(
            CodegenMethodScope parent,
            SAIFFInitializeSymbol symbols,
            CodegenClassScope classScope)
        {
            var method = parent.MakeChild(typeof(ContextControllerDetailInitiatedTerminated), GetType(), classScope);

            method.Block
                .DeclareVar<ContextControllerDetailInitiatedTerminated>(
                    "detail",
                    NewInstance(typeof(ContextControllerDetailInitiatedTerminated)))
                .SetProperty(Ref("detail"), "StartCondition", StartCondition.Make(method, symbols, classScope))
                .SetProperty(Ref("detail"), "EndCondition", EndCondition.Make(method, symbols, classScope))
                .SetProperty(Ref("detail"), "IsOverlapping", Constant(IsOverlapping));
            if (DistinctExpressions != null && DistinctExpressions.Length > 0) {
                method.Block
                    .SetProperty(
                        Ref("detail"),
                        "DistinctEval",
                        ExprNodeUtilityCodegen.CodegenEvaluatorMayMultiKeyWCoerce(
                            ExprNodeUtilityQuery.GetForges(DistinctExpressions),
                            null,
                            method,
                            GetType(),
                            classScope))
                    .SetProperty(
                        Ref("detail"),
                        "DistinctTypes",
                        Constant(ExprNodeUtilityQuery.GetExprResultTypes(DistinctExpressions)));
            }

            method.Block.MethodReturn(Ref("detail"));
            return LocalMethod(method);
        }
Exemple #2
0
        public CodegenExpression MakeCodegen(
            CodegenMethodScope parent,
            SAIFFInitializeSymbol symbols,
            CodegenClassScope classScope)
        {
            var method = parent.MakeChild(typeof(ContextControllerDetailInitiatedTerminated), GetType(), classScope);

            var distinctEval = MultiKeyCodegen.CodegenExprEvaluatorMayMultikey(
                DistinctExpressions, null, DistinctMultiKey, method, classScope);

            method.Block
                .DeclareVar<ContextControllerDetailInitiatedTerminated>(
                    "detail",
                    NewInstance(typeof(ContextControllerDetailInitiatedTerminated)))
                .SetProperty(Ref("detail"), "StartCondition", StartCondition.Make(method, symbols, classScope))
                .SetProperty(Ref("detail"), "EndCondition", EndCondition.Make(method, symbols, classScope))
                .SetProperty(Ref("detail"), "IsOverlapping", Constant(IsOverlapping))
                .SetProperty(Ref("detail"), "DistinctEval", distinctEval)
                .SetProperty(Ref("detail"), "DistinctTypes", DistinctExpressions == null ? ConstantNull() : Constant(ExprNodeUtilityQuery.GetExprResultTypes(DistinctExpressions)))
                .SetProperty(Ref("detail"), "DistinctSerde", DistinctMultiKey == null ? ConstantNull() : DistinctMultiKey.GetExprMKSerde(method, classScope));

            method.Block.MethodReturn(Ref("detail"));
            return LocalMethod(method);
        }