-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhistoryCommand.h
57 lines (43 loc) · 1.29 KB
/
historyCommand.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
/**
* HistoryCommand.h
* HistoryCommand is a child of Command class.
* History (denoted as ‘H’): outputs all the transactions of a customer
*
* @author Olga Kuriatnyk
*/
#ifndef HISTORYCOMMAND_H
#define HISTORYCOMMAND_H
#include "command.h"
#include "customerContainer.h"
using namespace std;
class HistoryCommand : public Command {
public:
// explicit constructor
explicit HistoryCommand(const char &commandType);
// destructor
~HistoryCommand() override;
// copy constructor not allowed
HistoryCommand(const HistoryCommand &c) = delete;
// move not allowed
HistoryCommand(HistoryCommand &&other) = delete;
// assignment not allowed
HistoryCommand &operator=(const HistoryCommand &other) = delete;
// move assignment not allowed
HistoryCommand &operator=(HistoryCommand &&other) = delete;
// function for reading history commands
void read(istream &is) override;
// process history command
void process() override;
private:
int customerID;
};
class HistoryCommandFactory : public CommandFactory {
public:
// register the History Command factory
HistoryCommandFactory() { Command::registerType('H', this); }
// create new history command
Command *create(const char &commandType) const override {
return new HistoryCommand(commandType);
}
};
#endif