package containers
Install
dune-project
Dependency
Authors
Maintainers
Sources
md5=d84e09c5d0abc501aa17cd502e31a038
sha512=8b832f4ada6035e80d81be0cfb7bdffb695ec67d465ed6097a144019e2b8a8f909095e78019c3da2d8181cc3cd730cd48f7519e87d3162442562103b7f36aabb
doc/containers.data/CCRingBuffer/Make/index.html
Module CCRingBuffer.MakeSource
Buffer using regular arrays
Parameters
module X : sig ... endSignature
The module type of Array for this ring buffer
Defines the bounded ring buffer type
Raised in querying functions when the buffer is empty
create size creates a new bounded buffer with given size. The underlying array is allocated immediately and no further (large) allocation will happen from now on.
blit_from buf from_buf o len copies the slice o, ... o + len - 1 from an input buffer from_buf to the end of the buffer. If the slice is too large for the buffer, only the last part of the array will be copied.
blit_into buf to_buf o len copies at most len elements from buf into to_buf starting at offset o in s.
append b ~into copies all data from b and adds it at the end of into. Erases data of into if there is not enough room.
iteri b ~f calls f i t for each element t in buf, with i being its relative index within buf.
get_front buf i returns the i-th element of buf from the front, i.e. the one returned by take_front buf after i-1 calls to junk_front buf.
get_back buf i returns the i-th element of buf from the back, i.e. the one returned by take_back buf after i-1 calls to junk_back buf.
Push value at the back of t. If t.bounded=false, the buffer will grow as needed, otherwise the oldest elements are replaced first.
Take and remove the first value from front of t, if any.
Create a buffer from an initial array, but doesn't take ownership of it (still allocates a new internal array).