/// <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); } } }
/// <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); }
/// <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()); } } }