-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinventoryCommand.h
58 lines (43 loc) · 1.32 KB
/
inventoryCommand.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
/**
* InventoryCommand.h
* InventoryCommand is a child of Command class.
* Inventory (denoted as ‘I’): outputs the inventory of all the items in the
* store
*
* @author Olga Kuriatnyk
*/
#ifndef INVENTORYCOMMAND_H
#define INVENTORYCOMMAND_H
#include "command.h"
#include "inventory.h"
using namespace std;
class InventoryCommand : public Command {
public:
// explicit constructor
explicit InventoryCommand(const char &commandType);
// destructor
~InventoryCommand() override;
// copy constructor not allowed
InventoryCommand(const InventoryCommand &c) = delete;
// move not allowed
InventoryCommand(InventoryCommand &&other) = delete;
// assignment not allowed
InventoryCommand &operator=(const InventoryCommand &other) = delete;
// move assignment not allowed
InventoryCommand &operator=(InventoryCommand &&other) = delete;
// function for reading inventory commands
void read(istream &is) override;
// process inventory command
void process() override;
private:
};
class InventoryCommandFactory : public CommandFactory {
public:
// register the Inventory Command factory
InventoryCommandFactory() { Command::registerType('I', this); }
// create new Inventory command
Command *create(const char &commandType) const override {
return new InventoryCommand(commandType);
}
};
#endif