sig
  type clock_variable
  type source_t = Fallible | Infallible
  class virtual source :
    ?name:string ->
    Frame.content_kind ->
    object
      val mutable ns_kind : string
      method virtual abort_track : unit
      method advance : unit
      method after_output : unit
      method clock : Source.clock_variable
      method private create_request :
        ?metadata:(string * string) list ->
        ?persistent:bool ->
        ?indicators:Request.indicator list -> string -> Request.t
      method get : Frame.t -> unit
      method private virtual get_frame : Frame.t -> unit
      method get_ready : ?dynamic:bool -> Source.source list -> unit
      method id : string
      method is_output : bool
      method virtual is_ready : bool
      method kind : Frame.content_kind
      method leave : ?dynamic:bool -> Source.source -> unit
      method private log : Dtools.Log.t
      method on_shutdown : (unit -> unit) -> unit
      method register_command :
        descr:string -> ?usage:string -> string -> (string -> string) -> unit
      method virtual remaining : int
      method seek : int -> int
      method private set_clock : unit
      method set_id : ?definitive:bool -> string -> unit
      method private sleep : unit
      method virtual stype : Source.source_t
      method private wake_up : Source.source list -> unit
    end
  and virtual active_source :
    ?name:string ->
    Frame.content_kind ->
    object
      val memo : Frame.t
      val mutable ns_kind : string
      method virtual abort_track : unit
      method advance : unit
      method after_output : unit
      method clock : Source.clock_variable
      method private create_request :
        ?metadata:(string * string) list ->
        ?persistent:bool ->
        ?indicators:Request.indicator list -> string -> Request.t
      method get : Frame.t -> unit
      method private virtual get_frame : Frame.t -> unit
      method get_ready : ?dynamic:bool -> Source.source list -> unit
      method id : string
      method virtual is_active : bool
      method is_output : bool
      method virtual is_ready : bool
      method kind : Frame.content_kind
      method leave : ?dynamic:bool -> Source.source -> unit
      method private log : Dtools.Log.t
      method on_shutdown : (unit -> unit) -> unit
      method virtual output : unit
      method virtual output_get_ready : unit
      method virtual output_reset : unit
      method register_command :
        descr:string -> ?usage:string -> string -> (string -> string) -> unit
      method virtual remaining : int
      method seek : int -> int
      method private set_clock : unit
      method set_id : ?definitive:bool -> string -> unit
      method private sleep : unit
      method virtual stype : Source.source_t
      method private wake_up : Source.source list -> unit
    end
  class virtual operator :
    ?name:string ->
    Frame.content_kind ->
    Source.source list ->
    object
      val mutable ns_kind : string
      method virtual abort_track : unit
      method advance : unit
      method after_output : unit
      method clock : clock_variable
      method private create_request :
        ?metadata:(string * string) list ->
        ?persistent:bool ->
        ?indicators:Request.indicator list -> string -> Request.t
      method get : Frame.t -> unit
      method private virtual get_frame : Frame.t -> unit
      method get_ready : ?dynamic:bool -> source list -> unit
      method id : string
      method is_output : bool
      method virtual is_ready : bool
      method kind : Frame.content_kind
      method leave : ?dynamic:bool -> source -> unit
      method private log : Dtools.Log.t
      method on_shutdown : (unit -> unit) -> unit
      method register_command :
        descr:string -> ?usage:string -> string -> (string -> string) -> unit
      method virtual remaining : int
      method seek : int -> int
      method private set_clock : unit
      method set_id : ?definitive:bool -> string -> unit
      method private sleep : unit
      method virtual stype : source_t
      method private wake_up : source list -> unit
    end
  class virtual active_operator :
    ?name:string ->
    Frame.content_kind ->
    Source.source list ->
    object
      val memo : Frame.t
      val mutable ns_kind : string
      method virtual abort_track : unit
      method advance : unit
      method after_output : unit
      method clock : clock_variable
      method private create_request :
        ?metadata:(string * string) list ->
        ?persistent:bool ->
        ?indicators:Request.indicator list -> string -> Request.t
      method get : Frame.t -> unit
      method private virtual get_frame : Frame.t -> unit
      method get_ready : ?dynamic:bool -> source list -> unit
      method id : string
      method virtual is_active : bool
      method is_output : bool
      method virtual is_ready : bool
      method kind : Frame.content_kind
      method leave : ?dynamic:bool -> source -> unit
      method private log : Dtools.Log.t
      method on_shutdown : (unit -> unit) -> unit
      method virtual output : unit
      method virtual output_get_ready : unit
      method virtual output_reset : unit
      method register_command :
        descr:string -> ?usage:string -> string -> (string -> string) -> unit
      method virtual remaining : int
      method seek : int -> int
      method private set_clock : unit
      method set_id : ?definitive:bool -> string -> unit
      method private sleep : unit
      method virtual stype : source_t
      method private wake_up : source list -> unit
    end
  val has_outputs : unit -> bool
  val iterate_new_outputs : (Source.active_source -> unit) -> unit
  class type clock =
    object
      method attach : Source.active_source -> unit
      method attach_clock : Source.clock_variable -> unit
      method detach : (Source.active_source -> bool) -> unit
      method end_tick : unit
      method get_tick : int
      method id : string
      method start_outputs :
        (Source.active_source -> bool) -> unit -> Source.active_source list
      method sub_clocks : Source.clock_variable list
    end
  exception Clock_conflict of string * string
  exception Clock_loop of string * string
  module Clock_variables :
    sig
      val to_string : Source.clock_variable -> string
      val create_unknown :
        sources:Source.active_source list ->
        sub_clocks:Source.clock_variable list -> Source.clock_variable
      val create_known : Source.clock -> Source.clock_variable
      val unify : Source.clock_variable -> Source.clock_variable -> unit
      val get : Source.clock_variable -> Source.clock
      val is_known : Source.clock_variable -> bool
    end
end