Functor CCBitField.Make

module Make (X : EMPTY) : S 
Create a new bitfield type
Parameters:
X : EMPTY

type t = private int 
Generative type of bitfields. Each instantiation of the functor should create a new, incompatible type
val empty : t
Empty bitfields (all bits 0)
type '_ field_kind = 
| Bool : bool field_kind
| Int : int field_kind
module type FIELD = sig .. end
Field of type value, with a given width and position within the bitfield type
type 'a field = (module CCBitField.S.FIELD with type value = 'a) 
val bool : ?name:string -> unit -> bool field
New field of type bool
Raises
val int2 : ?name:string -> unit -> int field
New field of type 2-bits int (same as int ~width:2)
Raises
val int3 : ?name:string -> unit -> int field
New field of type 3-bits int (same as int ~width:3)
Raises
val int : ?name:string -> width:int -> unit -> int field
New field for width bits.
Raises
val freeze : unit -> unit
Prevent new fields from being added. From now on, creating a field will raise Frozen
val total_width : unit -> int
Current width of the bitfield
type any_field = 
| AnyField : (module CCBitField.S.FIELD with type value = 'a) * 'a field_kind -> any_field
val iter_fields : (any_field -> unit) -> unit
Iterate on all currently present fields
val pp : Format.formatter -> t -> unit
Print the bitfield using the current list of fields