internal BlockObjQueue.Block NewBlock() { BlockObjQueue.Block b = next; if (b == null) { return(new BlockObjQueue.Block()); } next = b.next; b.Clear(); return(b); }
internal virtual RevObject Next() { BlockObjQueue.Block b = head; if (b == null) { return(null); } RevObject c = b.Pop(); if (b.IsEmpty()) { head = b.next; if (head == null) { tail = null; } free.FreeBlock(b); } return(c); }
internal virtual void Add(RevObject c) { BlockObjQueue.Block b = tail; if (b == null) { b = free.NewBlock(); b.Add(c); head = b; tail = b; return; } else { if (b.IsFull()) { b = free.NewBlock(); tail.next = b; tail = b; } } b.Add(c); }
internal virtual RevObject Next() { BlockObjQueue.Block b = head; if (b == null) { return null; } RevObject c = b.Pop(); if (b.IsEmpty()) { head = b.next; if (head == null) { tail = null; } free.FreeBlock(b); } return c; }
internal void Clear() { next = null; headIndex = 0; tailIndex = 0; }
internal void FreeBlock(BlockObjQueue.Block b) { b.next = next; next = b; }
internal BlockObjQueue.Block NewBlock() { BlockObjQueue.Block b = next; if (b == null) { return new BlockObjQueue.Block(); } next = b.next; b.Clear(); return b; }