Пример #1
0
        public TargetList FilterInside(IGraphState graph, short pid)
        {
            if (pid < 0)
            {
                throw new ArgumentException();
            }

            if (inner == null)
            {
                return(TargetList.Null);
            }

            string here = graph.GetProviderBasis(pid);

            return(new TargetList(Inside(graph, here)));
        }
Пример #2
0
        // 'Here-and-below' tree matching

        IEnumerable <BuildServices> Inside(IGraphState graph, string here)
        {
            Dictionary <short, bool> provider_ok = new Dictionary <short, bool> ();

            foreach (BuildServices bs in inner)
            {
                short pid = (short)((((uint)bs.Id) >> 16) & 0xFFFF);

                if (!provider_ok.ContainsKey(pid))
                {
                    provider_ok[pid] = StrUtils.StartsWith(graph.GetProviderBasis(pid), here);
                }

                if (!provider_ok[pid])
                {
                    continue;
                }

                yield return(bs);
            }
        }
Пример #3
0
 public string GetProviderBasis(short id)
 {
     n_GetProviderBasis++;
     return(inner.GetProviderBasis(id));
 }