OpenIndiana and Solaris port
[oweals/cde.git] / cde / programs / dtinfo / dtinfo / src / Basic / HashTbl.hh
1 /*
2  * $XConsortium: HashTbl.hh /main/3 1996/06/11 16:19:03 cde-hal $
3  *
4  * Copyright (c) 1992 HaL Computer Systems, Inc.  All rights reserved.
5  * UNPUBLISHED -- rights reserved under the Copyright Laws of the United
6  * States.  Use of a copyright notice is precautionary only and does not
7  * imply publication or disclosure.
8  * 
9  * This software contains confidential information and trade secrets of HaL
10  * Computer Systems, Inc.  Use, disclosure, or reproduction is prohibited
11  * without the prior express written permission of HaL Computer Systems, Inc.
12  * 
13  *                         RESTRICTED RIGHTS LEGEND
14  * Use, duplication, or disclosure by the Government is subject to
15  * restrictions as set forth in subparagraph (c)(l)(ii) of the Rights in
16  * Technical Data and Computer Software clause at DFARS 252.227-7013.
17  *                        HaL Computer Systems, Inc.
18  *                  1315 Dell Avenue, Campbell, CA  95008
19  * 
20  */
21 // NOTE: To be renamed to HashTable upon removal of other
22
23 class HashBucket;
24
25 class HashTbl : public FolioObject
26 {
27 public: // functions
28   HashTbl (u_int num_buckets = 256);
29   ~HashTbl();
30
31   void add (Hashable &);
32   void add (Hashable *h)
33     { add (*h); }
34   void remove (Hashable &);
35   void remove_all (bool delete_elements = FALSE);
36   int find (Hashable &) const;
37
38 protected: // variables
39   HashBucket **f_hash_bucket;
40   u_int        f_num_buckets;
41 };