Exemplo n.º 1
0
 public RingBuffer(int size)
 {
     Transforms = new List <Tuple <int, Func <object, object> > >();
     Size       = size;
     Head       = RingBufferCell.Build(this, Size);
     Steps      = Enumerable.Repeat(Head, 10).ToArray();
     WriteLock  = new object();
 }
Exemplo n.º 2
0
 public static RingBufferCell Build( RingBuffer ring, int count )
 {
     var head = new RingBufferCell( ring );
     var last = head;
     while ( --count > 0 )
     {
         var cell = new RingBufferCell( ring );
         last.Next = cell;
         last = cell;
     }
     last.Next = head;
     last.Tail = true;
     return head;
 }
Exemplo n.º 3
0
        public static RingBufferCell Build(RingBuffer ring, int count)
        {
            var head = new RingBufferCell(ring);
            var last = head;

            while (--count > 0)
            {
                var cell = new RingBufferCell(ring);
                last.Next = cell;
                last      = cell;
            }
            last.Next = head;
            last.Tail = true;
            return(head);
        }