-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdisplayhistory.h
More file actions
63 lines (46 loc) · 1.13 KB
/
displayhistory.h
File metadata and controls
63 lines (46 loc) · 1.13 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
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
/*
* displayhistory.h
*
* @authors Juan Arias & Nick Tibbott
*
*/
#ifndef DISPLAYHISTORY_H
#define DISPLAYHISTORY_H
#include "transaction.h"
/*
* Holds a customer's ID so we can print their history at a specified time
* Subclass of Transaction
*/
class DisplayHistory: public Transaction {
/* Allows factory to call private constructor */
friend class DisplayHistoryFactory;
private:
/* Customer ID number*/
const long customerID;
/*
* Constructs a DisplayHistory object with a given Store and customer ID
*/
DisplayHistory(Store* store, const string& fileName, long customerID);
public:
/*
* Execute the Transaction
*/
void execute() const override;
};
/*
* Factory for creating DisplayHistory Transactions
*/
class DisplayHistoryFactory: public TransactionFactory {
private:
/*
* Creates and returns the right Transaction from the vector of string
*/
Transaction* create(Store* store, const ItemType* itemType,
const string& fileName, const string& line) const override;
public:
/*
* Default constructor to self register in Transaction class
*/
DisplayHistoryFactory();
};
#endif /* DISPLAYHISTORY_H */