コード例 #1
0
ファイル: RingBuffer.cs プロジェクト: yonglehou/Symbiote
 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();
 }
コード例 #2
0
ファイル: RingBufferCell.cs プロジェクト: cmgator/Symbiote
 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;
 }
コード例 #3
0
ファイル: RingBufferCell.cs プロジェクト: yonglehou/Symbiote
        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);
        }