2 * CDE - Common Desktop Environment
4 * Copyright (c) 1993-2012, The Open Group. All rights reserved.
6 * These libraries and programs are free software; you can
7 * redistribute them and/or modify them under the terms of the GNU
8 * Lesser General Public License as published by the Free Software
9 * Foundation; either version 2 of the License, or (at your option)
12 * These libraries and programs are distributed in the hope that
13 * they will be useful, but WITHOUT ANY WARRANTY; without even the
14 * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU Lesser General Public License for more
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with these librararies and programs; if not, write
20 * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21 * Floor, Boston, MA 02110-1301 USA
24 * $XConsortium: buckets.h /main/3 1996/06/11 17:19:58 cde-hal $
26 * Copyright (c) 1993 HAL Computer Systems International, Ltd.
27 * All rights reserved. Unpublished -- rights reserved under
28 * the Copyright Laws of the United States. USE OF A COPYRIGHT
29 * NOTICE IS PRECAUTIONARY ONLY AND DOES NOT IMPLY PUBLICATION
32 * THIS SOFTWARE CONTAINS CONFIDENTIAL INFORMATION AND TRADE
33 * SECRETS OF HAL COMPUTER SYSTEMS INTERNATIONAL, LTD. USE,
34 * DISCLOSURE, OR REPRODUCTION IS PROHIBITED WITHOUT THE
35 * PRIOR EXPRESS WRITTEN PERMISSION OF HAL COMPUTER SYSTEMS
38 * RESTRICTED RIGHTS LEGEND
39 * Use, duplication, or disclosure by the Government is subject
40 * to the restrictions as set forth in subparagraph (c)(l)(ii)
41 * of the Rights in Technical Data and Computer Software clause
42 * at DFARS 252.227-7013.
44 * HAL COMPUTER SYSTEMS INTERNATIONAL, LTD.
56 #include "utility/atoi_pearson.h"
57 #include "dstr/slist_void_ptr_cell.h"
58 #include "hmphf/params.h"
59 #include "hmphf/pattern.h"
65 bucket(char*, int orig_pos = 0, Boolean copy = true);
67 int add_key(char*, Boolean copy = true);
69 short no_keys() { return v_no_keys; };
70 int g_value() { return v_g_value; };
71 int control_bit() { return v_control_bit; };
72 int orig_pos() { return v_orig_pos; };
74 void set_count(int i) { v_count = i; };
75 void set_control_bit(int cb) { v_control_bit = cb; };
76 void set_g_value(int gv) { v_g_value = gv; };
78 friend ostream& operator<<(ostream&, bucket&);
86 slist_void_ptr_cell* key_ptr;
92 typedef bucket* bucketPtr;
98 //buckets(char* key_file, params& params);
99 buckets(char** keys, params& params);
102 void set_control_bit(int cb);
104 int get_pattern(int i, int_pattern&, params&);
105 int use_current_params(int i, int_pattern&, params& pms,
106 Boolean use_g_value = false);
108 int no_buckets() { return v_no_buckets; };
109 int max_bucket_sz() { return v_max_bucket_sz; };
111 bucket* operator[](int i) { return v_bucket_array[i]; };
113 friend ostream& operator<<(ostream&, buckets&);
117 int bucket_num(char* k, params& pms);
119 inline int hash_value(char* k, int offset, int range)
121 return h_convertor.atoi(k, strlen(k), offset+1, range);
125 bucket** v_bucket_array;
130 atoi_pearson b_convertor;
131 atoi_pearson h_convertor;