summaryrefslogtreecommitdiff
path: root/ACE/apps/drwho/Hash_Table.h
blob: 2d6f8bd758c611cc083dfe06a5a3f03fd614cbb9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/* -*- C++ -*- */

//=============================================================================
/**
 *  @file    Hash_Table.h
 *
 *  $Id$
 *
 *  @author Douglas C. Schmidt
 */
//=============================================================================


#ifndef _HASH_TABLE_H
#define _HASH_TABLE_H

#include "Search_Struct.h"

/**
 * @class Hash_Table
 *
 * @brief Provides a hash function lookup abstraction for friend records.
 */
class Hash_Table : public Search_Struct
{
public:
  Hash_Table (void);
  virtual ~Hash_Table (void);
  virtual Protocol_Record *insert (const char *key_name,
                                   int max_len = MAXUSERIDNAMELEN) = 0;
  virtual Protocol_Record *get_next_entry (void);
  virtual Protocol_Record *get_each_entry (void);

protected:
  enum
  {
    HASH_TABLE_SIZE = 500
  };

  Protocol_Record **hash_table;
  Protocol_Record *current_ptr;
  int current_index;
  int hash_table_size;
};
#endif /* _HASH_TABLE_H */