Fix the build script.
[tatoo.git] / src / utils / 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 (*
17   Time-stamp: <Last modified on 2013-01-30 19:06:33 CET by Kim Nguyen>
18 *)
19
20 (** This modules implements unique identifiers represented by integers *)
21
22 type t = private int
23 (** The type of unique identifiers. *)
24
25 exception Overflow
26 (** Raised when the internal counters for IDs overflows. *)
27
28 val make_maker : unit -> (unit -> t)
29 (** Returns an uid generator.
30     [make_maker ()] returns a function that generates unique ids. Raises
31     [Overflow] if the internal counter overflows.
32 *)
33
34 val dummy : t
35 (** A dummy identifier, guaranteed to be distinct from any value
36     returned by a generator.
37 *)
38
39 external to_int : t -> int = "%identity"
40 (** Convert a unique id to an integer *)
41
42 (**/**)
43
44 external of_int : int -> t = "%identity"
45 (** May break the invariant, use with caution *)