module type S =sig..end
The abstract ring buffer type, made concrete by choice of
ARRAY module implementation
module Array:CCRingBuffer.Array.S
type t
exception Empty
val create : int -> tcreate 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.Invalid_argument if the arguments is < 1val copy : t -> tval capacity : t -> intval length : t -> intval is_full : t -> boolval blit_from : t -> Array.t -> int -> int -> unitblit_from buf from_buf o len copies the slice o, ... o + len - 1 from
a 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.Invalid_argument if o,len is not a valid slice of sval blit_into : t -> Array.t -> int -> int -> intblit_into buf to_buf o len copies at most len elements from buf
into to_buf starting at offset o in s.Invalid_argument if o,len is not a valid slice of s.min len (length buf)).val append : t -> into:t -> unitappend 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.val to_list : t -> Array.elt listval clear : t -> unitval is_empty : t -> boolval junk_front : t -> unitt.Empty if the buffer is already empty.val junk_back : t -> unitt.Empty if the buffer is already empty.val skip : t -> int -> unitskip b len removes len elements from the front of b.Invalid_argument if len > length b.val iter : t -> f:(Array.elt -> unit) -> unititer b ~f calls f i t for each element t in bufval iteri : t -> f:(int -> Array.elt -> unit) -> unititeri b ~f calls f i t for each element t in buf, with i
being its relative index within buf.val get_front : t -> int -> Array.eltget_front buf i returns the i-th element of buf from the front, ie
the one returned by take_front buf after i-1 calls to junk_front buf.Invalid_argument if the index is invalid (> length buf)val get_back : t -> int -> Array.eltget_back buf i returns the i-th element of buf from the back, ie
the one returned by take_back buf after i-1 calls to junk_back buf.Invalid_argument if the index is invalid (> length buf)val push_back : t -> Array.elt -> unitt.
If t.bounded=false, the buffer will grow as needed,
otherwise the oldest elements are replaced first.val peek_front : t -> Array.elt optiont, without modification.val peek_front_exn : t -> Array.eltt, without modification.Empty if buffer is empty.val peek_back : t -> Array.elt optiont, without modification.val peek_back_exn : t -> Array.eltt, without modification.Empty if buffer is empty.val take_back : t -> Array.elt optiont, if anyval take_back_exn : t -> Array.eltt.Empty if buffer is already empty.val take_front : t -> Array.elt optiont, if anyval take_front_exn : t -> Array.eltt.Empty if buffer is already empty.val of_array : Array.t -> tval to_array : t -> Array.t