public CodegenExpression Make(
            CodegenMethodScope parent,
            CodegenClassScope classScope)
        {
            CodegenExpression numRowsVariable = ConstantNull();
            if (numRowsVariableMetaData != null) {
                numRowsVariable = VariableDeployTimeResolver.MakeVariableField(
                    numRowsVariableMetaData,
                    classScope,
                    this.GetType());
            }

            CodegenExpression offsetVariable = ConstantNull();
            if (offsetVariableMetaData != null) {
                offsetVariable = VariableDeployTimeResolver.MakeVariableField(
                    offsetVariableMetaData,
                    classScope,
                    this.GetType());
            }

            CodegenMethod method = parent.MakeChild(typeof(RowLimitProcessorFactory), this.GetType(), classScope);
            method.Block
                .DeclareVar<RowLimitProcessorFactory>("factory", NewInstance(typeof(RowLimitProcessorFactory)))
                .SetProperty(Ref("factory"), "NumRowsVariable", numRowsVariable)
                .SetProperty(Ref("factory"), "OffsetVariable", offsetVariable)
                .SetProperty(Ref("factory"), "CurrentRowLimit", Constant(currentRowLimit))
                .SetProperty(Ref("factory"), "CurrentOffset", Constant(currentOffset))
                .MethodReturn(Ref("factory"));
            return LocalMethod(method);
        }
Esempio n. 2
0
        public CodegenExpression Make(
            CodegenMethodScope parent,
            CodegenClassScope classScope)
        {
            // resolve variable at init-time via field
            CodegenExpression variableExpression = ConstantNull();
            if (variableMetaData != null) {
                variableExpression = VariableDeployTimeResolver.MakeVariableField(
                    variableMetaData,
                    classScope,
                    this.GetType());
            }

            CodegenMethod method = parent.MakeChild(
                typeof(OutputConditionPolledCountFactory),
                this.GetType(),
                classScope);
            method.Block
                .DeclareVar<OutputConditionPolledCountFactory>(
                    "factory",
                    NewInstance(typeof(OutputConditionPolledCountFactory)))
                .SetProperty(Ref("factory"), "EventRate", Constant(eventRate))
                .SetProperty(Ref("factory"), "Variable", variableExpression)
                .MethodReturn(Ref("factory"));
            return LocalMethod(method);
        }
        public CodegenExpression Make(
            CodegenMethodScope parent,
            SAIFFInitializeSymbol symbols,
            CodegenClassScope classScope)
        {
            // resolve variable at init-time via field
            var variableExpression = ConstantNull();
            if (variableMetaData != null) {
                variableExpression =
                    VariableDeployTimeResolver.MakeVariableField(variableMetaData, classScope, GetType());
            }

            var method = parent.MakeChild(typeof(OutputConditionFactory), GetType(), classScope);
            method.Block
                .MethodReturn(
                    ExprDotMethodChain(symbols.GetAddInitSvc(method))
                        .Get(EPStatementInitServicesConstants.RESULTSETPROCESSORHELPERFACTORY)
                        .Add("MakeOutputConditionCount", Constant(eventRate), variableExpression));
            return LocalMethod(method);
        }