module State: sig
.. end
A state is a project-compliant mutable value.
Since Carbon-20101201
Consult the Plugin Development Guide for additional details.
Type declarations
include Datatype.S_with_collections
module type Local = sig
.. end
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 unique_name_from_name : string -> string
Since Nitrogen-20111001
Returns a fresh unique state name from the given name.
val dummy : t
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
val add_hook_on_update : t -> (unit -> unit) -> unit
Add an hook which is applied each time the project library changes the local
value of the state.
Since Nitrogen-20111001
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 {
}
Since Carbon-20101201
exception Incompatible_datatype of string
val dummy_state_on_disk : state_on_disk
val private_ops : t -> private_ops
Since Carbon-20101201
State generators
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) ->
on_update:((unit -> unit) -> unit) ->
clean:(unit -> unit) ->
serialize:(Project_skeleton.project -> state_on_disk) ->
unserialize:(Project_skeleton.project -> state_on_disk -> unit) ->
unique_name:string -> name:string -> t
Since Carbon-20101201
Change in Nitrogen-20111001: add the on_update
argument
val delete : t -> unit
Since Carbon-20101201