public CodegenExpression MakeCodegen( CodegenMethodScope parent, SAIFFInitializeSymbol symbols, CodegenClassScope classScope) { var method = parent.MakeChild(typeof(ContextControllerDetailHashItem), GetType(), classScope); method.Block.DeclareVar<EventType>( "eventType", EventTypeUtility.ResolveTypeCodegen( FilterSpecCompiled.FilterForEventType, symbols.GetAddInitSvc(method))); var symbolsWithType = new SAIFFInitializeSymbolWEventType(); var methodLookupableMake = parent.MakeChildWithScope( typeof(ExprFilterSpecLookupable), GetType(), symbolsWithType, classScope) .AddParam(typeof(EventType), "eventType") .AddParam(typeof(EPStatementInitServices), SAIFFInitializeSymbol.REF_STMTINITSVC.Ref); var methodLookupable = Lookupable.MakeCodegen(methodLookupableMake, symbolsWithType, classScope); methodLookupableMake.Block.MethodReturn(LocalMethod(methodLookupable)); method.Block .DeclareVar<ContextControllerDetailHashItem>( "item", NewInstance(typeof(ContextControllerDetailHashItem))) .DeclareVar<ExprFilterSpecLookupable>( "lookupable", LocalMethod(methodLookupableMake, Ref("eventType"), symbols.GetAddInitSvc(method))) .SetProperty( Ref("item"), "FilterSpecActivatable", LocalMethod(FilterSpecCompiled.MakeCodegen(method, symbols, classScope))) .SetProperty(Ref("item"), "Lookupable", Ref("lookupable")) .Expression( ExprDotMethodChain(symbols.GetAddInitSvc(method)) .Get(EPStatementInitServicesConstants.FILTERSHAREDLOOKUPABLEREGISTERY) .Add("RegisterLookupable", Ref("eventType"), Ref("lookupable"))) .MethodReturn(Ref("item")); return LocalMethod(method); }
public CodegenExpression MakeCodegen( CodegenMethodScope parent, SAIFFInitializeSymbol symbols, CodegenClassScope classScope) { var method = parent.MakeChild(typeof(ViewableActivatorFilter), GetType(), classScope); var makeFilter = filterSpecCompiled.MakeCodegen(method, symbols, classScope); method.Block.DeclareVar<FilterSpecActivatable>("filterSpecCompiled", LocalMethod(makeFilter)) .DeclareVar<ViewableActivatorFilter>( "activator", ExprDotMethodChain(symbols.GetAddInitSvc(method)) .Get(EPStatementInitServicesConstants.VIEWABLEACTIVATORFACTORY) .Add("CreateFilter")) .SetProperty(Ref("activator"), "Container", ExprDotName(Ref("stmtInitSvc"), "Container")) .SetProperty(Ref("activator"), "FilterSpec", Ref("filterSpecCompiled")) .SetProperty(Ref("activator"), "CanIterate", Constant(canIterate)) .SetProperty(Ref("activator"), "StreamNumFromClause", Constant(streamNumFromClause)) .SetProperty(Ref("activator"), "IsSubSelect", Constant(isSubSelect)) .SetProperty(Ref("activator"), "SubselectNumber", Constant(subselectNumber)) .MethodReturn(Ref("activator")); return LocalMethod(method); }