public void InstanceCodegen( CodegenInstanceAux instance, CodegenClassScope classScope, CodegenCtor factoryCtor, IList<CodegenTypedParam> factoryMembers) { instance.Properties.AddProperty( typeof(SelectExprProcessor), "SelectExprProcessor", GetType(), classScope, propertyNode => propertyNode.GetterBlock.BlockReturn(MEMBER_SELECTEXPRPROCESSOR)); instance.Properties.AddProperty( typeof(AggregationService), "AggregationService", GetType(), classScope, propertyNode => propertyNode.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), "HasHavingClause", GetType(), classScope, propertyNode => propertyNode.GetterBlock.BlockReturn(Constant(OptionalHavingNode != null))); instance.Properties.AddProperty( typeof(bool), "IsSelectRStream", typeof(ResultSetProcessorRowForAll), classScope, propertyNode => propertyNode.GetterBlock.BlockReturn(Constant(IsSelectRStream))); ResultSetProcessorUtil.EvaluateHavingClauseCodegen(OptionalHavingNode, classScope, instance); ResultSetProcessorAggregateGroupedImpl.RemovedAggregationGroupKeyCodegen(classScope, instance); GenerateGroupKeySingle = ResultSetProcessorGroupedUtil.GenerateGroupKeySingleCodegen( GroupKeyNodeExpressions, MultiKeyClassRef, classScope, instance); GenerateGroupKeyArrayView = ResultSetProcessorGroupedUtil.GenerateGroupKeyArrayViewCodegen( GenerateGroupKeySingle, classScope, instance); GenerateGroupKeyArrayJoin = ResultSetProcessorGroupedUtil.GenerateGroupKeyArrayJoinCodegen( GenerateGroupKeySingle, classScope, instance); ResultSetProcessorAggregateGroupedImpl.GenerateOutputBatchedSingleCodegen(this, classScope, instance); ResultSetProcessorAggregateGroupedImpl.GenerateOutputBatchedViewUnkeyedCodegen(this, classScope, instance); ResultSetProcessorAggregateGroupedImpl.GenerateOutputBatchedJoinUnkeyedCodegen(this, classScope, instance); ResultSetProcessorAggregateGroupedImpl.GenerateOutputBatchedJoinPerKeyCodegen(this, classScope, instance); ResultSetProcessorAggregateGroupedImpl.GenerateOutputBatchedViewPerKeyCodegen(this, classScope, instance); }
public void InstanceCodegen( CodegenInstanceAux instance, CodegenClassScope classScope, CodegenCtor factoryCtor, IList<CodegenTypedParam> factoryMembers) { instance.Properties.AddProperty( typeof(SelectExprProcessor), "SelectExprProcessor", GetType(), classScope, propertyNode => propertyNode.GetterBlock.BlockReturn(MEMBER_SELECTEXPRPROCESSOR)); instance.Properties.AddProperty( typeof(AggregationService), "AggregationService", GetType(), classScope, propertyNode => propertyNode.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), "HasHavingClause", GetType(), classScope, propertyNode => propertyNode.GetterBlock.BlockReturn(Constant(OptionalHavingNode != null))); instance.Properties.AddProperty( typeof(bool), "IsSelectRStream", typeof(ResultSetProcessorRowForAll), classScope, propertyNode => propertyNode.GetterBlock.BlockReturn(Constant(IsSelectRStream))); ResultSetProcessorUtil.EvaluateHavingClauseCodegen(OptionalHavingNode, classScope, instance); GenerateGroupKeySingle = ResultSetProcessorGroupedUtil.GenerateGroupKeySingleCodegen(GroupKeyNodeExpressions, multiKeyClassRef, classScope, instance); GenerateGroupKeyArrayView = ResultSetProcessorGroupedUtil.GenerateGroupKeyArrayViewCodegen(GenerateGroupKeySingle, classScope, instance); GenerateGroupKeyArrayJoin = ResultSetProcessorGroupedUtil.GenerateGroupKeyArrayJoinCodegen(GenerateGroupKeySingle, classScope, instance); ResultSetProcessorRowPerGroupImpl.GenerateOutputBatchedNoSortWMapCodegen(this, classScope, instance); ResultSetProcessorRowPerGroupImpl.GenerateOutputBatchedArrFromEnumeratorCodegen(this, classScope, instance); ResultSetProcessorRowPerGroupImpl.RemovedAggregationGroupKeyCodegen(classScope, instance); if (unboundedProcessor) { var factory = classScope.AddOrGetDefaultFieldSharable(ResultSetProcessorHelperFactoryField.INSTANCE); instance.AddMember(NAME_GROUPREPS, typeof(ResultSetProcessorRowPerGroupUnboundHelper)); CodegenExpression groupKeySerde = MultiKeyClassRef.GetExprMKSerde(classScope.NamespaceScope.InitMethod, classScope); var eventType = classScope.AddDefaultFieldUnshared( true, typeof(EventType), EventTypeUtility.ResolveTypeCodegen(typesPerStream[0], EPStatementInitServicesConstants.REF)); instance.ServiceCtor.Block .AssignRef( NAME_GROUPREPS, ExprDotMethod( factory, "MakeRSRowPerGroupUnboundGroupRep", Constant(groupKeyTypes), groupKeySerde, eventType, MEMBER_AGENTINSTANCECONTEXT)) .ExprDotMethod(MEMBER_AGGREGATIONSVC, "SetRemovedCallback", Member(NAME_GROUPREPS)); } else { instance.ServiceCtor.Block .ExprDotMethod(MEMBER_AGGREGATIONSVC, "SetRemovedCallback", Ref("this")); } }