Ejemplo n.º 1
0
        /// <summary>
        /// Runs a query on all routines.
        /// </summary>
        public void RunQueryAll(ITableQuery inQuery, ITableOperation inOperation)
        {
            int totalLeft   = m_ActiveCount;
            int currentNode = m_ActiveHead;

            while (currentNode != -1 && totalLeft-- > 0)
            {
                Entry e = m_Entries[currentNode];
                currentNode = e.NextIndex;
                if (inQuery.Validate(e.Fiber))
                {
                    inOperation.Execute(e.Fiber);
                }
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Runs a query and returns the first routine to pass.
        /// </summary>
        public Routine RunQueryFirst(ITableQuery inQuery, ITableOperation inOperation)
        {
            int totalLeft   = m_ActiveCount;
            int currentNode = m_ActiveHead;

            while (currentNode != -1 && totalLeft-- > 0)
            {
                Entry e = m_Entries[currentNode];
                currentNode = e.NextIndex;
                if (inQuery.Validate(e.Fiber))
                {
                    inOperation.Execute(e.Fiber);
                    return(e.Fiber.GetHandle());
                }
            }
            return(Routine.Null);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Runs a query on all routines.
        /// </summary>
        public void RunQueryAll(ITableQuery inQuery, ITableOperation inOperation, ref ICollection <Routine> ioRoutines)
        {
            int totalLeft   = m_ActiveCount;
            int currentNode = m_ActiveHead;

            while (currentNode != -1 && totalLeft-- > 0)
            {
                Entry e = m_Entries[currentNode];
                currentNode = e.NextIndex;

                if (inQuery.Validate(e.Fiber))
                {
                    inOperation.Execute(e.Fiber);
                    if (ioRoutines == null)
                    {
                        ioRoutines = new List <Routine>();
                    }
                    ioRoutines.Add(e.Fiber.GetHandle());
                }
            }
        }