module Db:sig..end
Patoline documents can be interactive, allowing for example an audience to connect remotely to a presentation and interact with it, possibly changing some parts of it (such as answering a poll, results being updated on-screen immediately).
This module provides tools for managing user sessions and a storage
space for key/value pairs associated to each session.
type 'a data = {
|
name : |
|
init : |
|
read : |
|
write : |
|
reset : |
|
distribution : |
exception DummyData
Db.dummyData
below.val dummyData : string dataDb.data, which can be used to
initialize data structure, but whose content should never be used
(calling any member function raises Db.DummyData).type 'a coding = {
|
encode : |
(* |
Serializing some value of type
'a to a string which can be
stored in database. | *) |
|
decode : |
(* |
Parsing a string from the database and creating a value of type
'a. This should be the inverse of encode. | *) |
val default_coding : 'a codingMarshal module,
escaped using base64.val string_coding : string codingval bool_coding : bool coding"true" and "false". Any value other
than "true" in the database is decoded as false.module type DbInterface =sig..end
module type DbInstance =sig..end
typedatabase =(module Db.DbInstance)
type db = {
|
db : |
|
create_data : |
|
disconnect : |
val init_db : (module Db.DbInterface with type dbinfo = 'a) -> string -> 'a -> dbval interaction_start_hook : (unit -> unit) list Pervasives.refval read_hook : (string -> Util.visibility -> unit) list Pervasives.refval write_hook : (string -> Util.visibility -> unit) list Pervasives.refval record : ('a -> 'b -> unit) list Pervasives.ref ->
('c -> 'd) -> 'c -> 'd * ('a * 'b) list
val stop_record : 'a list Pervasives.ref -> ('b -> 'c) -> 'b -> 'c
val record_read : ('a -> 'b) -> 'a -> 'b * (string * Util.visibility) list
val record_write : ('a -> 'b) -> 'a -> (string * Util.visibility) list
val stop_record_read : ('a -> 'b) -> 'a -> 'b
val stop_record_write : ('a -> 'b) -> 'a -> 'b
val do_interaction_start_hook : unit -> unitDb.interaction_start_hook.val do_record_read : 'a data -> Util.visibility -> unitDb.read_hook.val do_record_write : 'a data -> Util.visibility -> unitDb.write_hook.val sessid : (string * string * (string * string) list) option Pervasives.ref
val secret : string Pervasives.ref
val make_sessid : unit -> string
val friends_from_string : string -> (string * string) list
val friends_to_string : (string * string) list -> string