-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstore.h
113 lines (97 loc) · 3.63 KB
/
store.h
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
#ifndef STORE_H
#define STORE_H
<<<<<<< HEAD
=======
>>>>>>> DEV
#include <string>
#include <vector>
#include <map>
#include "customer.h"
#include "hashtable.h"
<<<<<<< HEAD
#include "action.h"
#include "movie.h"
////////////////////////////////////////////////////////////////////////////////
// STORE - The store class that manages the customers and movies
////////////////////////////////////////////////////////////////////////////////
class Store {
private:
int hashSize;
HashTable<Customer *> customerList;
HashTable<Movie *> moveList;
std::map<std::string, int> movieStock; // key = title, int = stock
public:
Store();
void loadCustList(std::string custDataFile) {
//while(getLine()){
// getLine() - read in the line of input
// parse the line to see the first word in the string = 4 digit customer ID
// (word = first set of characters before a token ' ')
// Create customer object
// read in the rest of the customer properties from the stream & assign to the customer object
// push the customer object to the customer hashtable
// }
}
void loadMovieList(std::string movieDataFile) {
//while(getLine()){
// getLine() - read first line of input
// parse the line to see the first character in the string = Movie type
// Call CreateMovie Factory method and pass in the character MovieType .. returns a pointer
// Movie * m = MovieFactory.createMovie('D');
// set all properties of the movie by parsing the rest of the string from getLine();
// Push the movie to the movie* hashtable
//}
//sortMovieVector(MovieVector, 'D');
}
void readCommands(std::string commandsFile) {
//while(getLine()){
// getLine() - read in first line of input
// parse the string's first character = Action Character (1st token)
// Action * a = ActionFactory.createAction('B');
// std::string remainingProperties = the rest of the command properties after the first token
// Call doAction(remainingProperties)
//}
}
void sortMovieVector(vector<Movie *>, char mType) {
//the movie vector is passed in (Drama, Classical, Comedy)
// along with the Movie type character ('D', 'C', 'F')
//switch(mType){
// case 'D':
//sort movies by Director, then Title
// case 'F':
//sort movies by Title, then year it was released
// case 'C':
//sort movies by Release Date, then Major Actor
//}
}
};
#endif
=======
#include "movieList.h"
#include "movie.h"
//-----------------------------------------------------------------------------
// The store class manages the customers and movies
//-----------------------------------------------------------------------------
class Store {
private:
HashTable customerList;
MovieList movieList;
public:
Store();
virtual ~Store();
void loadCustList(std::string custDataFile);
void loadMovieList(std::string movieDataFile);
void readCommands(std::string commandFile);
void printInventory() const; // I
bool borrowMovie(std::string moveLine, char cType, int custID); // B
bool returnMovie(std::string movieLine, char cType, int custID); //E
bool printCustHistory(int custID); //H
void commander(char type, int custID, std::string commandLine);
bool genreChecker(char mType) const;
bool movieChecker(std::string moveTitle, char type);
//every time a new movie is made..
void showCustomers();
void showMoviesByGenre(char type);
};
#endif
>>>>>>> DEV