Source file wave_intf.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
open Base
open Hardcaml

module type S = sig
  type wave_format_with_default =
    { mutable current : Wave_format.t
    ; default : Wave_format.t
    }
  [@@deriving sexp_of, equal ~localize]

  type mutable_style = { mutable style : Style.t }

  type 'data t =
    | Empty of { mutable name : string }
    | Divider of
        { mutable name : string
        ; style : mutable_style
        }
    | Clock of
        { mutable name : string
        ; style : mutable_style
        }
    | Binary of
        { mutable name : string
        ; data : 'data
        ; style : mutable_style
        }
    | Data of
        { mutable name : string
        ; data : 'data
        ; width : int
        ; wave_format : wave_format_with_default
        ; text_alignment : Text_alignment.t
        ; style : mutable_style
        }
  [@@deriving sexp_of, equal ~localize]

  val set_name : 'a t -> string -> 'a t
  val get_name : 'a t -> string
  val get_data : 'data t -> 'data
  val get_to_str : 'a t -> Bits.t -> string
  val get_alignment : 'a t -> Text_alignment.t
  val get_format : 'a t -> Wave_format.t
  val get_height_in_chars : 'a t -> int
end

module type Wave = sig
  module type S = S

  include S
end