Exemplo n.º 1
0
 /// <summary>Insert the commit pointer at the front of the queue.</summary>
 /// <remarks>Insert the commit pointer at the front of the queue.</remarks>
 /// <param name="c">the commit to insert into the queue.</param>
 public virtual void Unpop(RevCommit c)
 {
     BlockRevQueue.Block b = head;
     if (b == null)
     {
         b = free.NewBlock();
         b.ResetToMiddle();
         b.Add(c);
         head = b;
         tail = b;
         return;
     }
     else
     {
         if (b.CanUnpop())
         {
             b.Unpop(c);
             return;
         }
     }
     b = free.NewBlock();
     b.ResetToEnd();
     b.Unpop(c);
     b.next = head;
     head   = b;
 }
 internal BlockRevQueue.Block NewBlock()
 {
     BlockRevQueue.Block b = next;
     if (b == null)
     {
         return(new BlockRevQueue.Block());
     }
     next = b.next;
     b.Clear();
     return(b);
 }
Exemplo n.º 3
0
 public override void Add(RevCommit c)
 {
     BlockRevQueue.Block b = head;
     if (b == null || !b.CanUnpop())
     {
         b = free.NewBlock();
         b.ResetToEnd();
         b.next = head;
         head   = b;
     }
     b.Unpop(c);
 }
Exemplo n.º 4
0
		public override void Add(RevCommit c)
		{
			BlockRevQueue.Block b = head;
			if (b == null || !b.CanUnpop())
			{
				b = free.NewBlock();
				b.ResetToEnd();
				b.next = head;
				head = b;
			}
			b.Unpop(c);
		}
Exemplo n.º 5
0
        internal virtual void RemoveFlag(int f)
        {
            int not_f = ~f;

            for (BlockRevQueue.Block b = head; b != null; b = b.next)
            {
                for (int i = b.headIndex; i < b.tailIndex; i++)
                {
                    b.commits[i].flags &= not_f;
                }
            }
        }
Exemplo n.º 6
0
        public override string ToString()
        {
            StringBuilder s = new StringBuilder();

            for (BlockRevQueue.Block q = head; q != null; q = q.next)
            {
                for (int i = q.headIndex; i < q.tailIndex; i++)
                {
                    Describe(s, q.commits[i]);
                }
            }
            return(s.ToString());
        }
Exemplo n.º 7
0
 internal override bool AnybodyHasFlag(int f)
 {
     for (BlockRevQueue.Block b = head; b != null; b = b.next)
     {
         for (int i = b.headIndex; i < b.tailIndex; i++)
         {
             if ((b.commits[i].flags & f) != 0)
             {
                 return(true);
             }
         }
     }
     return(false);
 }
Exemplo n.º 8
0
        internal override RevCommit Next()
        {
            BlockRevQueue.Block b = head;
            if (b == null)
            {
                return(null);
            }
            RevCommit c = b.Pop();

            if (b.IsEmpty())
            {
                head = b.next;
                free.FreeBlock(b);
            }
            return(c);
        }
Exemplo n.º 9
0
		public override void Add(RevCommit c)
		{
			BlockRevQueue.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);
		}
Exemplo n.º 10
0
 public override void Add(RevCommit c)
 {
     BlockRevQueue.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);
 }
Exemplo n.º 11
0
 internal BlockRevQueue.Block NewBlock()
 {
     BlockRevQueue.Block b = next;
     if (b == null)
     {
         return new BlockRevQueue.Block();
     }
     next = b.next;
     b.Clear();
     return b;
 }
Exemplo n.º 12
0
 internal void FreeBlock(BlockRevQueue.Block b)
 {
     b.next = next;
     next = b;
 }
Exemplo n.º 13
0
 internal void Clear()
 {
     next = null;
 }
Exemplo n.º 14
0
 internal void Clear()
 {
     next = null;
     headIndex = 0;
     tailIndex = 0;
 }
Exemplo n.º 15
0
 public override void Clear()
 {
     head = null;
     free.Clear();
 }
 internal void FreeBlock(BlockRevQueue.Block b)
 {
     b.next = next;
     next   = b;
 }
 internal void Clear()
 {
     next = null;
 }
 internal void Clear()
 {
     next      = null;
     headIndex = 0;
     tailIndex = 0;
 }
Exemplo n.º 19
0
		internal override RevCommit Next()
		{
			BlockRevQueue.Block b = head;
			if (b == null)
			{
				return null;
			}
			RevCommit c = b.Pop();
			if (b.IsEmpty())
			{
				head = b.next;
				if (head == null)
				{
					tail = null;
				}
				free.FreeBlock(b);
			}
			return c;
		}
Exemplo n.º 20
0
		/// <summary>Insert the commit pointer at the front of the queue.</summary>
		/// <remarks>Insert the commit pointer at the front of the queue.</remarks>
		/// <param name="c">the commit to insert into the queue.</param>
		public virtual void Unpop(RevCommit c)
		{
			BlockRevQueue.Block b = head;
			if (b == null)
			{
				b = free.NewBlock();
				b.ResetToMiddle();
				b.Add(c);
				head = b;
				tail = b;
				return;
			}
			else
			{
				if (b.CanUnpop())
				{
					b.Unpop(c);
					return;
				}
			}
			b = free.NewBlock();
			b.ResetToEnd();
			b.Unpop(c);
			b.next = head;
			head = b;
		}
Exemplo n.º 21
0
		public override void Clear()
		{
			head = null;
			tail = null;
			free.Clear();
		}