public void AcceptHelperVisitorCodegen(
     CodegenClassScope classScope,
     CodegenMethod method,
     CodegenInstanceAux instance)
 {
     ResultSetProcessorRowPerGroupRollupImpl.AcceptHelperVisitorCodegen(method, instance);
 }
 public void ApplyJoinResultCodegen(
     CodegenClassScope classScope,
     CodegenMethod method,
     CodegenInstanceAux instance)
 {
     ResultSetProcessorRowPerGroupRollupImpl.ApplyJoinResultCodegen(this, classScope, method, instance);
 }
 public void ContinueOutputLimitedLastAllNonBufferedJoinCodegen(
     CodegenClassScope classScope,
     CodegenMethod method,
     CodegenInstanceAux instance)
 {
     ResultSetProcessorRowPerGroupRollupImpl.ContinueOutputLimitedLastAllNonBufferedJoinCodegen(this, method);
 }
 public void ProcessOutputLimitedJoinCodegen(
     CodegenClassScope classScope,
     CodegenMethod method,
     CodegenInstanceAux instance)
 {
     ResultSetProcessorRowPerGroupRollupImpl.ProcessOutputLimitedJoinCodegen(this, classScope, method, instance);
 }
 public void GetEnumeratorJoinCodegen(
     CodegenClassScope classScope,
     CodegenMethod method,
     CodegenInstanceAux instance)
 {
     ResultSetProcessorRowPerGroupRollupImpl.GetEnumeratorJoinCodegen(this, classScope, method, instance);
 }
 public void StopMethodCodegen(
     CodegenClassScope classScope,
     CodegenMethod method,
     CodegenInstanceAux instance)
 {
     if (unbounded) {
         ResultSetProcessorRowPerGroupRollupUnbound.StopMethodUnboundCodegen(this, classScope, method, instance);
     }
     else {
         ResultSetProcessorRowPerGroupRollupImpl.StopMethodCodegenBound(method, instance);
     }
 }
 public void ApplyViewResultCodegen(
     CodegenClassScope classScope,
     CodegenMethod method,
     CodegenInstanceAux instance)
 {
     if (unbounded) {
         ResultSetProcessorRowPerGroupRollupUnbound.ApplyViewResultUnboundCodegen(
             this,
             classScope,
             method,
             instance);
     }
     else {
         ResultSetProcessorRowPerGroupRollupImpl.ApplyViewResultCodegen(this, classScope, method, instance);
     }
 }
 public void GetEnumeratorViewCodegen(
     CodegenClassScope classScope,
     CodegenMethod method,
     CodegenInstanceAux instance)
 {
     if (unbounded) {
         ResultSetProcessorRowPerGroupRollupUnbound.GetEnumeratorViewUnboundCodegen(
             this,
             classScope,
             method,
             instance);
     }
     else {
         ResultSetProcessorRowPerGroupRollupImpl.GetEnumeratorViewCodegen(this, classScope, method, instance);
     }
 }
 public void ClearMethodCodegen(
     CodegenClassScope classScope,
     CodegenMethod method)
 {
     ResultSetProcessorRowPerGroupRollupImpl.ClearMethodCodegen(method);
 }
        public void InstanceCodegen(
            CodegenInstanceAux instance,
            CodegenClassScope classScope,
            CodegenCtor factoryCtor,
            IList<CodegenTypedParam> factoryMembers)
        {
            instance.Properties.AddProperty(
                typeof(AggregationService),
                "AggregationService",
                GetType(),
                classScope,
                node => node.GetterBlock.BlockReturn(MEMBER_AGGREGATIONSVC));
            instance.Methods.AddMethod(
                typeof(ExprEvaluatorContext),
                "GetAgentInstanceContext",
                EmptyList<CodegenNamedParam>.Instance,
                GetType(),
                classScope,
                node => node.Block.ReturnMethodOrBlock(MEMBER_AGENTINSTANCECONTEXT));
            instance.Properties.AddProperty(
                typeof(bool),
                "IsSelectRStream",
                typeof(ResultSetProcessorRowForAll),
                classScope,
                node => node.GetterBlock.BlockReturn(Constant(IsSelectRStream)));

            var rollupDesc = classScope.AddDefaultFieldUnshared(
                true,
                typeof(AggregationGroupByRollupDesc),
                GroupByRollupDesc.Codegen(classScope.NamespaceScope.InitMethod, classScope));

            instance.Properties.AddProperty(
                typeof(AggregationGroupByRollupDesc),
                "GroupByRollupDesc",
                typeof(ResultSetProcessorRowPerGroupRollup),
                classScope,
                node => node.GetterBlock.BlockReturn(rollupDesc));

            GenerateGroupKeySingle = ResultSetProcessorGroupedUtil.GenerateGroupKeySingleCodegen(GroupKeyNodeExpressions, MultiKeyClassRef, classScope, instance);
            ResultSetProcessorRowPerGroupRollupImpl.RemovedAggregationGroupKeyCodegen(classScope, instance);
            ResultSetProcessorRowPerGroupRollupImpl.GenerateOutputBatchedMapUnsortedCodegen(this, instance, classScope);
            ResultSetProcessorRowPerGroupRollupImpl.GenerateOutputBatchedCodegen(this, instance, classScope);

            // generate having clauses
            var havingForges = PerLevelForges.OptionalHavingForges;
            if (havingForges != null) {
                factoryMembers.Add(
                    new CodegenTypedParam(typeof(HavingClauseEvaluator[]), NAME_HAVINGEVALUATOR_ARRAYNONMEMBER));
                factoryCtor.Block.AssignRef(
                    NAME_HAVINGEVALUATOR_ARRAYNONMEMBER,
                    NewArrayByLength(typeof(HavingClauseEvaluator), Constant(havingForges.Length)));
                for (var i = 0; i < havingForges.Length; i++) {
                    var evaluateHaving = new CodegenExpressionLambda(factoryCtor.Block)
                        .WithParams(PARAMS)
                        .WithBody(block => block.BlockReturn(
                            CodegenLegoMethodExpression.CodegenBooleanExpressionReturnTrueFalse(
                                havingForges[i],
                                classScope,
                                factoryCtor,
                                REF_EPS,
                                ResultSetProcessorCodegenNames.REF_ISNEWDATA,
                                REF_EXPREVALCONTEXT)));

                    var impl = NewInstance<ProxyHavingClauseEvaluator>(evaluateHaving);

                    //var evaluateHaving = CodegenMethod.MakeMethod(typeof(bool), GetType(), classScope)
                    //    .AddParam(PARAMS);
                    //impl.AddMethod("EvaluateHaving", evaluateHaving);

                    factoryCtor.Block.AssignArrayElement(NAME_HAVINGEVALUATOR_ARRAYNONMEMBER, Constant(i), impl);
                }
            }
        }