// DO NOT REMOVE maxSize parameter, the parameters are fixed and passed through reflection public RetainingMultiReaderBuffer(long initialSize, long maxSize, ICursors cursors) { Cursors = cursors; if ((initialSize & (initialSize - 1)) != 0 || initialSize <= 0) { throw new ArgumentException("initialSize must be a power of 2 that is > 0"); } // We don't care about the maximum size Buffer = new T[initialSize]; }
/// <summary> /// TBD /// </summary> /// <param name="initialSize">TBD</param> /// <param name="maxSize">TBD</param> /// <param name="cursors">TBD</param> /// <exception cref="ArgumentException">TBD</exception> public ResizableMultiReaderRingBuffer(long initialSize, long maxSize, ICursors cursors) { Cursors = cursors; if ((initialSize & (initialSize - 1)) != 0 || initialSize <= 0 || initialSize > maxSize) { throw new ArgumentException("initialSize must be a power of 2 that is > 0 and <= maxSize"); } if ((maxSize & (maxSize - 1)) != 0 || maxSize <= 0 || maxSize > int.MaxValue / 2) { throw new ArgumentException("maxSize must be a power of 2 that is > 0 and < Int.MaxValue/2"); } _array = new T[initialSize]; _maxSizeBit = BitOperations.TrailingZeroCount(maxSize); }
/// <summary> /// TBD /// </summary> /// <param name="initialSize">TBD</param> /// <param name="maxSize">TBD</param> /// <param name="cursors">TBD</param> /// <exception cref="ArgumentException">TBD</exception> public ResizableMultiReaderRingBuffer(int initialSize, int maxSize, ICursors cursors) { Cursors = cursors; if ((initialSize & (initialSize - 1)) != 0 || initialSize <= 0 || initialSize > maxSize) { throw new ArgumentException("initialSize must be a power of 2 that is > 0 and <= maxSize"); } if ((maxSize & (maxSize - 1)) != 0 || maxSize <= 0 || maxSize > int.MaxValue / 2) { throw new ArgumentException("maxSize must be a power of 2 that is > 0 and < Int.MaxValue/2"); } _array = new object[initialSize]; _maxSizeBit = maxSize.NumberOfTrailingZeros(); }
public TestBuffer(int initialSize, int maxSize, ICursors cursors) : base(initialSize, maxSize, cursors) { UnderlyingCursors = cursors; }
public DistinctRetainingMultiReaderBuffer(long initialSize, long maxSize, ICursors cursors) : base(initialSize, maxSize, cursors) { }