Example #1
0
 public void ProvideCodegen(
     CodegenMethod method,
     SAIFFInitializeSymbol symbols,
     CodegenClassScope classScope)
 {
     method.Block.MethodReturn(
         NewInstance<OutputProcessViewDirectDistinctOrAfterFactory>(
             _outputStrategyPostProcessForge == null
                 ? ConstantNull()
                 : _outputStrategyPostProcessForge.Make(method, symbols, classScope),
             Constant(_isDistinct),
             MultiKeyCodegen.CodegenGetterEventDistinct(
                 _isDistinct, ResultEventType, DistinctMultiKey, method, classScope),
             AfterTimePeriod == null
                 ? ConstantNull()
                 : AfterTimePeriod.TimePeriodComputeForge.MakeEvaluator(method, classScope),
             Constant(AfterConditionNumberOfEvents),
             EventTypeUtility.ResolveTypeCodegen(ResultEventType, symbols.GetAddInitSvc(method))));
 }
Example #2
0
 protected override void InlineInitializeOnTriggerSpecific(
     CodegenExpressionRef saiff,
     CodegenMethod method,
     SAIFFInitializeSymbol symbols,
     CodegenClassScope classScope)
 {
     method.Block
         .SetProperty(
             saiff,
             "ResultSetProcessorFactoryProvider",
             NewInstanceInner(
                 resultSetProcessorProviderClassName,
                 symbols.GetAddInitSvc(method),
                 Ref("statementFields")))
         .SetProperty(saiff, "IsInsertInto", Constant(insertInto))
         .SetProperty(saiff, "IsAddToFront", Constant(addToFront))
         .SetProperty(saiff, "IsSelectAndDelete", Constant(selectAndDelete))
         .SetProperty(saiff, "IsDistinct", Constant(distinct))
         .SetProperty(
             saiff,
             "DistinctKeyGetter",
             MultiKeyCodegen.CodegenGetterEventDistinct(
                 distinct,
                 ResultEventType,
                 distinctMultiKey,
                 method,
                 classScope))
         .SetProperty(
             saiff,
             "OptionalInsertIntoTable",
             optionalInsertIntoTable == null
                 ? ConstantNull()
                 : TableDeployTimeResolver.MakeResolveTable(
                     optionalInsertIntoTable,
                     symbols.GetAddInitSvc(method)));
 }
Example #3
0
 public void ProvideCodegen(
     CodegenMethod method,
     SAIFFInitializeSymbol symbols,
     CodegenClassScope classScope)
 {
     var spec = Ref("spec");
     method.Block
         .DeclareVar<OutputProcessViewConditionSpec>(
             spec.Ref,
             NewInstance(typeof(OutputProcessViewConditionSpec)))
         .SetProperty(
             spec,
             "ConditionType",
             EnumValue(typeof(ResultSetProcessorOutputConditionType), _conditionType.GetName()))
         .SetProperty(
             spec,
             "OutputConditionFactory",
             _outputConditionFactoryForge.Make(method, symbols, classScope))
         .SetProperty(
             spec,
             "StreamCount",
             Constant(_streamCount))
         .SetProperty(
             spec,
             "IsTerminable",
             Constant(_terminable))
         .SetProperty(
             spec,
             "SelectClauseStreamSelector",
             EnumValue(typeof(SelectClauseStreamSelectorEnum), _selectClauseStreamSelector.GetName()))
         .SetProperty(
             spec,
             "PostProcessFactory",
             _outputStrategyPostProcessForge == null
                 ? ConstantNull()
                 : _outputStrategyPostProcessForge.Make(method, symbols, classScope))
         .SetProperty(
             spec,
             "HasAfter",
             Constant(_hasAfter))
         .SetProperty(
             spec,
             "IsDistinct",
             Constant(_isDistinct))
         .SetProperty(
             spec,
             "DistinctKeyGetter",
             MultiKeyCodegen.CodegenGetterEventDistinct(
                 _isDistinct, _resultEventType, _distinctMultiKey, method, classScope))
         .SetProperty(
             spec,
             "ResultEventType",
             EventTypeUtility.ResolveTypeCodegen(_resultEventType, symbols.GetAddInitSvc(method)))
         .SetProperty(
             spec,
             "AfterTimePeriod",
             _afterTimePeriodExpr == null
                 ? ConstantNull()
                 : _afterTimePeriodExpr.TimePeriodComputeForge.MakeEvaluator(method, classScope))
         .SetProperty(
             spec,
             "AfterConditionNumberOfEvents",
             Constant(_afterNumberOfEvents))
         .SetProperty(
             spec,
             "IsUnaggregatedUngrouped",
             Constant(_unaggregatedUngrouped))
         .SetProperty(
             spec,
             "EventTypes",
             EventTypeUtility.ResolveTypeArrayCodegen(_eventTypes, EPStatementInitServicesConstants.REF))
         .MethodReturn(NewInstance<OutputProcessViewConditionFactory>(spec));
 }
Example #4
0
 public void MakeMethod(
     CodegenMethod method,
     SAIFFInitializeSymbol symbols,
     CodegenClassScope classScope)
 {
     var select = Ref("select");
     method.Block
         .DeclareVar<FAFQueryMethodSelect>(select.Ref, NewInstance(typeof(FAFQueryMethodSelect)))
         .SetProperty(
             select,
             "Annotations",
             LocalMethod(
                 AnnotationUtil.MakeAnnotations(typeof(Attribute[]), _desc.Annotations, method, classScope)))
         .SetProperty(
             select,
             "Processors",
             FireAndForgetProcessorForgeExtensions.MakeArray(_desc.Processors, method, symbols, classScope))
         .DeclareVar(
             _classNameResultSetProcessor,
             "rsp",
             NewInstanceInner(_classNameResultSetProcessor, symbols.GetAddInitSvc(method), Ref("statementFields")))
         .SetProperty(
             select,
             "ResultSetProcessorFactoryProvider",
             Ref("rsp"))
         .SetProperty(
             select,
             "QueryGraph",
             _desc.QueryGraph.Make(method, symbols, classScope))
         .SetProperty(
             select,
             "WhereClause",
             _desc.WhereClause == null
                 ? ConstantNull()
                 : ExprNodeUtilityCodegen.CodegenEvaluator(
                     _desc.WhereClause.Forge,
                     method,
                     GetType(),
                     classScope))
         .SetProperty(
             select,
             "JoinSetComposerPrototype",
             _desc.Joins == null ? ConstantNull() : _desc.Joins.Make(method, symbols, classScope))
         .SetProperty(
             select,
             "ConsumerFilters",
             ExprNodeUtilityCodegen.CodegenEvaluators(
                 _desc.ConsumerFilters,
                 method,
                 GetType(),
                 classScope))
         .SetProperty(
             select,
             "ContextName",
             Constant(_desc.ContextName))
         .SetProperty(
             select,
             "TableAccesses",
             ExprTableEvalStrategyUtil.CodegenInitMap(
                 _desc.TableAccessForges,
                 GetType(),
                 method,
                 symbols,
                 classScope))
         .SetProperty(
             select,
             "HasTableAccess",
             Constant(_desc.HasTableAccess))
         .SetProperty(
             select,
             "IsDistinct",
             Constant(_desc.IsDistinct))
         .SetProperty(
             select,
             "DistinctKeyGetter",
             MultiKeyCodegen.CodegenGetterEventDistinct(
                 _desc.IsDistinct,
                 _desc.ResultSetProcessor.ResultEventType,
                 _desc.DistinctMultiKey,
                 method,
                 classScope))
         .SetProperty(
             select,
             "Subselects",
             SubSelectFactoryForge.CodegenInitMap(
                 _desc.SubselectForges,
                 GetType(),
                 method,
                 symbols,
                 classScope))
         .MethodReturn(select);
 }