Add a bullet symbol.
[tatoo.git] / src / uid.mli
1 (***********************************************************************)
2 (*                                                                     *)
3 (*                               TAToo                                 *)
4 (*                                                                     *)
5 (*                     Kim Nguyen, LRI UMR8623                         *)
6 (*                   Université Paris-Sud & CNRS                       *)
7 (*                                                                     *)
8 (*  Copyright 2010-2012 Université Paris-Sud and Centre National de la *)
9 (*  Recherche Scientifique. All rights reserved.  This file is         *)
10 (*  distributed under the terms of the GNU Lesser General Public       *)
11 (*  License, with the special exception on linking described in file   *)
12 (*  ../LICENSE.                                                        *)
13 (*                                                                     *)
14 (***********************************************************************)
15
16 (** This modules implements unique identifiers represented by integers *)
17
18 type t = private int
19 (** The type of unique identifiers. *)
20
21 exception Overflow
22 (** Raised when the internal counters for IDs overflows. *)
23
24 val make_maker : unit -> (unit -> t)
25 (** Returns an uid generator.
26     [make_maker ()] returns a function that generates unique ids. Raises
27     [Overflow] if the internal counter overflows.
28 *)
29
30 val dummy : t
31 (** A dummy identifier, guaranteed to be distinct from any value
32     returned by a generator.
33 *)
34
35 external to_int : t -> int = "%identity"
36 (** Convert a unique id to an integer *)
37
38 (**/**)
39
40 external of_int : int -> t = "%identity"
41 (** May break the invariant, use with caution *)