public CodegenExpression Make(
            CodegenMethodScope parent,
            SAIFFInitializeSymbol symbols,
            CodegenClassScope classScope)
        {
            var mode = _forge.FactoryMode;
            if (!(mode is VirtualDataWindowFactoryModeManaged)) {
                throw new ArgumentException("Unexpected factory mode " + mode);
            }

            var managed = (VirtualDataWindowFactoryModeManaged) mode;
            var injectionStrategy = (InjectionStrategyClassNewInstance) managed.InjectionStrategyFactoryFactory;
            var factoryField = classScope.AddDefaultFieldUnshared(
                true,
                typeof(VirtualDataWindowFactoryFactory),
                injectionStrategy.GetInitializationExpression(classScope));

            var builder = new SAIFFInitializeBuilder(
                typeof(VirtualDWViewFactory),
                GetType(),
                "factory",
                parent,
                symbols,
                classScope);
            builder
                .Eventtype("eventType", EventType)
                .Expression(
                    "factory",
                    ExprDotMethod(
                        factoryField,
                        "CreateFactory",
                        NewInstance(typeof(VirtualDataWindowFactoryFactoryContext))))
                .Constant("parameters", _parameterValues)
                .Expression(
                    "ParameterExpressions",
                    ExprNodeUtilityCodegen.CodegenEvaluators(
                        _validatedParameterExpressions,
                        builder.Method(),
                        GetType(),
                        classScope))
                .Constant("NamedWindowName", _namedWindowName)
                .Expression(
                    "compileTimeConfiguration",
                    SerializerUtil.ExpressionForUserObject(_customConfigs));
            return builder.Build();
        }
Exemple #2
0
        public CodegenExpression Make(
            CodegenMethodScope parent,
            SAIFFInitializeSymbol symbols,
            CodegenClassScope classScope)
        {
            var hashes = new ExprNode[_hashKeys.Count];
            var hashTypes = new Type[_hashKeys.Count];
            for (var i = 0; i < _hashKeys.Count; i++) {
                hashes[i] = _hashKeys[i].HashKey.KeyExpr;
                hashTypes[i] = _hashKeyCoercionTypes.CoercionTypes[i];
            }

            var ranges = new QueryGraphValueEntryRangeForge[_rangeKeys.Count];
            var rangesTypes = new Type[_rangeKeys.Count];
            for (var i = 0; i < _rangeKeys.Count; i++) {
                ranges[i] = _rangeKeys[i].RangeInfo;
                rangesTypes[i] = _rangeKeyCoercionTypes.CoercionTypes[i];
            }

            var builder = new SAIFFInitializeBuilder(
                typeof(SubordTableLookupStrategyFactoryVDW),
                GetType(),
                "lookup",
                parent,
                symbols,
                classScope);
            builder
                .Expression("indexHashedProps", IndexedPropDesc.MakeArray(_hashAndRanges.HashedProps))
                .Expression("indexBtreeProps", IndexedPropDesc.MakeArray(_hashAndRanges.BtreeProps))
                .Constant("IsNwOnTrigger", _nwOnTrigger)
                .Constant("NumOuterStreams", _outerStreams.Length)
                .Expression(
                    "hashEvals",
                    ExprNodeUtilityCodegen.CodegenEvaluators(hashes, builder.Method(), GetType(), classScope))
                .Constant("HashCoercionTypes", hashTypes)
                .Expression(
                    "rangeEvals",
                    QueryGraphValueEntryRangeForge.MakeArray(ranges, builder.Method(), symbols, classScope))
                .Constant("RangeCoercionTypes", rangesTypes);
            return builder.Build();
        }
Exemple #3
0
 public CodegenExpression Make(
     CodegenMethodScope parent,
     SAIFFInitializeSymbol symbols,
     CodegenClassScope classScope)
 {
     var builder = new SAIFFInitializeBuilder(
         OP_PACKAGE_NAME + ".eventbussource.EventBusSourceFactory",
         GetType(),
         "eventbussource",
         parent,
         symbols,
         classScope);
     builder.Expression(
             "filterSpecActivatable",
             LocalMethod(
                 FilterSpecCompiled.MakeCodegen(
                     builder.Method(),
                     symbols,
                     classScope)))
         .Constant("IsSubmitEventBean", submitEventBean);
     return builder.Build();
 }