Module State


module State: sig .. end
A state is a meta-representation of a project-compliant mutable value.
Since Carbon-20101201


Type declarations


type standard_kind = [ `Correctness | `Internal ] 
type user_kind = [ `Correctness | `Internal | `Irrelevant | `Tuning ] 
Type of state kinds.
Since Carbon-20101201
type kind = [ `Correctness
| `Internal
| `Irrelevant
| `Proxy of standard_kind
| `Tuning ]
include Datatype.S_with_collections
module type Local = sig .. end
Operations on the local state required for registering a new state via State_builder.Register.

Getters and setters


val get_name : t -> string
Name of a state.
Since Carbon-20101201
val set_name : t -> string -> unit
Set the name of the given state.
Since Carbon-20101201
val get_unique_name : t -> string
Unique name of a state.
Since Carbon-20101201
val kind : t -> kind
Kind of a state.
Since Carbon-20101201
val dummy : t
A dummy state.
Since Carbon-20101201
val dummy_unique_name : string
val is_dummy : t -> bool
Since Carbon-20101201
Returns true if the given state is State.dummy.
exception Unknown
val get : string -> t
Since Carbon-20101201
Raises Unknown if there is no such state.
Returns the state corresponding to the given unique name.
val get_descr : t -> Structural_descr.pack
Since Carbon-20101201

Clusters


module Cluster: sig .. end
Cluster of states for grouping some states together.

Internals

All this stuff should not be used outside of the Project library.

type state_on_disk = {
   on_disk_value : Obj.t;
   on_disk_computed : bool;
   on_disk_saved : bool;
   on_disk_digest : Digest.t;
}

Since Carbon-20101201

type private_ops = private {
   descr : Structural_descr.pack;
   create : Project_skeleton.project -> unit;
   remove : Project_skeleton.project -> unit;
   mutable clear : Project_skeleton.project -> unit;
   mutable clear_some_projects : (Project_skeleton.project -> bool) -> Project_skeleton.project -> bool;
   copy : Project_skeleton.project -> Project_skeleton.project -> unit;
   commit : Project_skeleton.project -> unit;
   update : Project_skeleton.project -> unit;
   clean : unit -> unit;
   serialize : Project_skeleton.project -> state_on_disk;
   unserialize : Project_skeleton.project -> state_on_disk -> unit;
}
Since Carbon-20101201
val dummy_state_on_disk : state_on_disk
val private_ops : t -> private_ops
Since Carbon-20101201

Managing the set of known states


module States: Local 
module States_datatype: Datatype.S  with type t = States.t
val delete : t -> unit
Since Carbon-20101201

State generators


val unusable : name:string -> string -> t
Since Carbon-20101201
Returns a fresh named version of State.dummy.
val is_usable : t -> bool
Since Carbon-20101201
val update_unusable : t -> kind -> (Project_skeleton.project -> unit) -> unit
Since Carbon-20101201
val create : descr:Structural_descr.pack ->
create:(Project_skeleton.project -> unit) ->
remove:(Project_skeleton.project -> unit) ->
clear:(Project_skeleton.project -> unit) ->
clear_some_projects:((Project_skeleton.project -> bool) ->
Project_skeleton.project -> bool) ->
copy:(Project_skeleton.project -> Project_skeleton.project -> unit) ->
commit:(Project_skeleton.project -> unit) ->
update:(Project_skeleton.project -> unit) ->
clean:(unit -> unit) ->
serialize:(Project_skeleton.project -> state_on_disk) ->
unserialize:(Project_skeleton.project -> state_on_disk -> unit) ->
unique_name:string -> name:string -> kind -> t
Since Carbon-20101201