private void DoBatchLoadAdd(BatchLoadInfo info)
 {
     try
     {
         this.Add(info.Name, info.ExpressionText, info.Context);
     }
     catch (ExpressionCompileException ex)
     {
         this.Clear();
         throw new BatchLoadCompileException(info.Name, info.ExpressionText, ex);
     }
 }
Exemplo n.º 2
0
        internal BatchLoadInfo[] GetBachInfos()
        {
            string[]       tails   = MyDependencies.GetTails();
            Queue <string> sources = MyDependencies.GetSources(tails);

            IList <string> result = MyDependencies.TopologicalSort(sources);

            BatchLoadInfo[] infos = new BatchLoadInfo[result.Count];

            for (int i = 0; i <= result.Count - 1; i++)
            {
                infos[i] = MyNameInfoMap[result[i]];
            }

            return(infos);
        }
Exemplo n.º 3
0
        /// <include file='Resources/DocComments.xml' path='DocComments/Member[@name="BatchLoader.Add"]/*' />
        public void Add(string atomName, string expression, ExpressionContext context)
        {
            Utility.AssertNotNull(atomName, "atomName");
            Utility.AssertNotNull(expression, "expression");
            Utility.AssertNotNull(context, "context");

            BatchLoadInfo info = new BatchLoadInfo(atomName, expression, context);

            MyNameInfoMap.Add(atomName, info);
            MyDependencies.AddTail(atomName);

            ICollection <string> references = this.GetReferences(expression, context);

            foreach (string reference in references)
            {
                MyDependencies.AddTail(reference);
                MyDependencies.AddDepedency(reference, atomName);
            }
        }