package core_profiler

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

An Id_table.t exploits the fact that Probe_id.ts should be consecutive integers to make lookups fast

type ('a, +'rw) t
val create : Core_profiler.Probe_id.t list -> 'a -> ('a, _) t

To create a table you need to specify which Probe_id.ts are valid cells, and give an empty value. This can either be in the form of a list of Probe_id.ts, or by copying the list from another Id_table.t (whose cell contents are ignored)

val create' : (_, _) t -> 'a -> ('a, _) t
val init : Core_profiler.Probe_id.t list -> f:(Core_profiler.Probe_id.t -> 'a) -> ('a, _) t
val init_from_map : 'b Core_profiler.Probe_id.Map.t -> f:(Core_profiler.Probe_id.t -> 'b -> 'a) -> ('a, _) t
val set_exn : ('a, Core.read_write) t -> Core_profiler.Probe_id.t -> 'a -> unit
val find : ('a, _) t -> Core_profiler.Probe_id.t -> 'a option

A ('a, read_only) Id_table.t is meant to look like an Probe_id.Map.t:

val find_exn : ('a, _) t -> Core_profiler.Probe_id.t -> 'a
val iter : ('a, _) t -> f:(Core_profiler.Probe_id.t -> 'a -> unit) -> unit
val fold : ('a, _) t -> init:'accum -> f:('accum -> Core_profiler.Probe_id.t -> 'a -> 'accum) -> 'accum
val fold_right : ('a, _) t -> init:'accum -> f:('accum -> Core_profiler.Probe_id.t -> 'a -> 'accum) -> 'accum
val to_alist : ('a, _) t -> (Core_profiler.Probe_id.t * 'a) list
val map : ('a, _) t -> f:(Core_profiler.Probe_id.t -> 'a -> 'b) -> ('b, _) t
val filter_map : ('a, _) t -> f:(Core_profiler.Probe_id.t -> 'a -> 'b option) -> ('b, _) t
val read_only : ('a, _) t -> ('a, Core.read) t