module Register: functor (
Datatype
:
Datatype.S
) ->
functor (
Local_state
:
State.Local
with type t = Datatype.t
) ->
functor (
Info
:
sig
include State_builder.Info
val unique_name : string
end
) ->
S
with module Datatype = Datatype
Register(Datatype)(State)(Info)
registers a new state.
Datatype
represents the datatype of a state,
Local_state
explains how to deal with the client-side state and
Info
are additional
required information.
Consult the Plugin Development Guide for additional details.
Parameters: |
Datatype |
: |
Datatype.S
|
Local_state |
: |
State.Local with type t = Datatype.t
|
Info |
: |
sig include Info val unique_name: string end
|
|
val self : State.t
The kind of the registered state.
val name : string
val mark_as_computed : ?project:Project.t -> unit -> unit
Indicate that the registered state will not change again for the
given project (default is current ()
).
val is_computed : ?project:Project.t -> unit -> bool
Returns true
iff the registered state will not change again for the
given project (default is current ()
).
Exportation of some inputs (easier use of State_builder.Register
).
module Datatype: Datatype.S
val add_hook_on_update : (Datatype.t -> unit) -> unit
Add an hook which is applied each time (just before) the project library
changes the local value of the state.
Since Nitrogen-20111001
val howto_marshal : (Datatype.t -> 'a) -> ('a -> Datatype.t) -> unit
howto_marshal marshal unmarshal
registers a custom couple of
functions (marshal, unmarshal)
to be used for serialization.
Default functions are identities. In particular, this
function must be used if Datatype.t
is not marshallable and
do_not_save
is not called.
Since Boron-20100401