FloatRingBuffer
final class FloatRingBufferCircular floating-point sample buffer retaining the most recent length elements in order.
-
Creates a
FloatRingBufferoflengthelements initialized to zero.Declaration
Swift
init(length: Int) -
A copy of all ring buffer elements ordered from oldest to newest.
Declaration
Swift
final var floatBuffer: FloatBuffer { get } -
The capacity of the ring buffer.
Declaration
Swift
final var length: Int { get } -
Resets all elements in the ring buffer to
0.0and rewinds the write cursor.Declaration
Swift
final func clear() -
Returns
lengthchronologically ordered elements starting atoffsetfrom the oldest element.Declaration
Swift
final func floatBuffer(offset: Int, length: Int) throws -> FloatBuffer -
Appends
lengthelements fromfloatBufferstarting atoffsetinto the circular buffer.If
lengthexceeds the ring buffer capacity, only the most recentself.lengthelements are retained.Declaration
Swift
final func load(floatBuffer: FloatBuffer, offset: Int, length: Int) throws