(***********************************************************************)
(*                                                                     *)
(*                                 GALAX                               *)
(*                           XML Query Engine                          *)
(*                                                                     *)
(*  Copyright 2000, Lucent Technologies.                               *)
(*  Distributed only by permission.                                    *)
(*                                                                     *)
(***********************************************************************)

(* $Id: pool.mli,v 1.3 2002/10/27 20:02:51 simeon Exp $ *)

(* Module Pool
   Description:
     This module implements string pools. Those are bidirectional
     mappings from strings to integers, used to save space in the
     representation of XML documents.
*)


(* Signature of the NamePool modules *)

module type NamePool =
  sig
    type name
    type symbol

    type namepool

    val create_pool : unit -> namepool
    val init_pool : namepool -> unit

    val get_name  : namepool -> symbol -> name
    val add_name  : namepool -> name -> symbol

    val exists_name : namepool -> name -> bool
    val symbol_equals : namepool -> symbol -> symbol -> bool

    val pool_size : namepool -> (int * int * int)
  end

(* Functor to create new name pool modules for an given hashed type *)

module MakeNamePool (H: Hashtbl.HashedType) : (NamePool with type name = H.t)

