-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHashMapDatabase.h
More file actions
31 lines (29 loc) · 1.12 KB
/
Copy pathHashMapDatabase.h
File metadata and controls
31 lines (29 loc) · 1.12 KB
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
// ------------------------------------------------ HashMapDatabase.h --------------------------------------------------------
// Jayden Stipek Nihal CSS 343 B
// Creation: 10/25/19
// Modified: 12/2/19
// -----------------------------------------------------------------------------------------------------------------
// Purpose - Encapsulate customer data
// -----------------------------------------------------------------------------------------------------------------
// Notes:
// Uses a hashmap implemented as a vector
// Hash perfect hashing due to their being unique ID's
// Able to add customers, remove, and other information as needed
// -----------------------------------------------------------------------------------------------------------------
#pragma once
#include "Customers.h"
class HashMapDatabase
{
public:
HashMapDatabase();
~HashMapDatabase();
bool add(Customer* C);
bool remove(int ID);
Customer* getCustomer(int ID);
bool clear();
void printAllCustomers();
vector<Customer*> Customers; // Hashtable of customer pointers
private:
const int HASHSIZE = 10000;
int getHash(int ID); //hashing the int
};