module Cbuffer: Cbuffertype 'a t = {
|
mutable data : |
(* | base of circular buffer | *) |
|
mutable start : |
(* | first position at which data is found | *) |
|
mutable length : |
(* | number of elements in buffer | *) |
|
never_shrink : |
(* | whether to refrain from shrinking the buffer | *) |
|
dummy : |
(* | value used to pack into newly allocated arrays | *) |
val sexp_of_t : ('a -> Sexplib.Sexp.t) -> 'a t -> Sexplib.Sexp.tval t_of_sexp : (Sexplib.Sexp.t -> 'a) -> Sexplib.Sexp.t -> 'a tval create : ?never_shrink:bool -> 'a -> Core.Std.Int.comparable -> 'a tval length : 'a t -> intval phys_length : 'a t -> intval is_full : 'a t -> boolval check_index : string -> 'a t -> int -> unitval get : 'a t -> int -> 'aval set : 'a t -> int -> 'a -> unitval copy_data : src:'a Core.Std.Array.container ->
dst:'a Core.Std.Array.t -> int -> int -> unitval swap_array : 'a t -> int -> unitswap_array buf len copies the contents of buf to a new array of length
len and places that new data into the buffer
double the size of the buffer
val expand : 'a t -> unitval shrink : 'a t -> unitval to_array : 'a t -> 'a Core.Std.Array.tval add : 'a t -> 'a -> unitval drop_from : 'a t -> int -> unitval drop_last : 'a t -> unitval iter : 'a t -> f:(int -> 'a -> 'b) -> unititer buf ~f calls func on each buffer element starting with 0
like this: (func pos element)val iterr : 'a t -> f:(int -> 'a -> 'b) -> unititerr buf ~f calls func on each buffer element starting with end
like this: (func pos element)val of_array : 'a Core.Std.Array.container -> 'a tval cb_compare : f:('a -> 'b -> bool) ->
b1:'a t -> b2:'b t -> s1:int -> s2:int -> n:int -> boolval drop_old : ?cmp:('a -> 'a -> int) ->
?free:('b -> unit) -> f:('b -> 'a) -> cutoff:'a -> 'b t -> int