예제 #1
0
 public void Init(MemoryPool pool)
 {
     SymbolLink self = new SymbolLink(typeof(IContextProvider));
     pool.Bind(self);
     pool.SetData(self, this);
     SetValue(ID.Context, self);
 }
예제 #2
0
 public override void Bind(Executive.Parameter[] parameters, MemoryPool pool)
 {
     m_context = new SymbolLink(typeof(IContextProvider));            
     pool.Bind(m_context);
     object data = QueryContext.Resolver.GetCurrentStack();
     QueryContext.Resolver.SetValue(ID.Context, m_context);
     m_compiledBody = new FunctionLink[m_expr.Length];
     for (int k = 0; k < m_expr.Length; k++)
     {
         m_compiledBody[k] = new FunctionLink();
         QueryContext.Engine.Compile(parameters, m_expr[k], m_compiledBody[k]);
     }
     if (Annotation != null)
     {
         m_compiledAnnotation = new FunctionLink[Annotation.Length];
         for (int k = 0; k < Annotation.Length; k++)
         {
             m_compiledAnnotation[k] = new FunctionLink();
             QueryContext.Engine.Compile(parameters, Annotation[k], m_compiledAnnotation[k]);
         }
     }
     QueryContext.Resolver.RevertToStack(data);
 }
예제 #3
0
 public override void Bind(Executive.Parameter[] parameters, MemoryPool pool)
 {
     m_valueExpr = new FunctionLink();
     QueryContext.Engine.Compile(parameters, m_expr, m_valueExpr);
     m_value.IsStatic = true;
     SymbolLink[] depends = QueryContext.Engine.GetValueDependences(null, parameters, m_expr, m_valueExpr, false);
     foreach (SymbolLink s in depends)
         if (!s.IsStatic)
         {
             m_value.IsStatic = false;
             break;
         }
     object data = QueryContext.Resolver.GetCurrentStack();
     pool.Bind(m_value);
     QueryContext.Resolver.SetValue(m_var, m_value);
     if (ConditionExpr != null)
     {
         m_conditionExpr = new FunctionLink();
         QueryContext.Engine.Compile(parameters, ConditionExpr, m_conditionExpr);
     }
     m_bodyExpr.Bind(parameters, pool);
     QueryContext.Resolver.RevertToStack(data);
 }
예제 #4
0
 public override void Bind(Executive.Parameter[] parameters, MemoryPool pool)
 {
     m_valueExpr = new FunctionLink();
     QueryContext.Engine.Compile(parameters, m_expr, m_valueExpr);
     object data = QueryContext.Resolver.GetCurrentStack();
     pool.Bind(m_value);
     QueryContext.Resolver.SetValue(m_var, m_value);
     if (m_pos != null)
     {
         pool.Bind(m_posValue);
         QueryContext.Resolver.SetValue(m_pos, m_posValue);
     }
     if (ConditionExpr != null)
     {
         m_conditionExpr = new FunctionLink();
         QueryContext.Engine.Compile(parameters, ConditionExpr, m_conditionExpr);
     }
     m_bodyExpr.Bind(parameters, pool);
     QueryContext.Resolver.RevertToStack(data);
 }
예제 #5
0
 public override void Bind(Executive.Parameter[] parameters, MemoryPool pool)
 {
     HashSet<SymbolLink> outerValues = new HashSet<SymbolLink>(QueryContext.Resolver.List());
     foreach (XQueryExprBase expr in _path)
         expr.Bind(parameters, pool);
     EnableCaching = EnableCaching && !IsContextSensitive(parameters);
     pool.Bind(_cache);
     if (EnableCaching)
     {
         foreach (XQueryExprBase expr in _path)
             expr.GetValueDependences(null, parameters, false, (SymbolLink value) =>
                 {
                     if (!value.IsStatic && outerValues.Contains(value))
                         value.OnChange += new ChangeValueAction(OnChangeValue);
                 });
     }
 }