Website Summary Files Commits Branches @commit @diff @stats
path: root / Week10 / Exercise03 / Warehouse.h
blob: b71d08c18046b19f53ecd0a4c1ea020095c16277 (plain) (blame)
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
#ifndef _WAREHOUSE
#define _WAREHOUSE

#include "Inventory.h"
#include "Date.h"

struct Delivery {
	Product products[8];
	unsigned productsCount;
	Date date;
	unsigned trackingNumber;
};

class Warehouse : public Inventory {
	Delivery* deliveries;
	unsigned deliveriesCount;
	unsigned deliveriesAlloc;

	void free();
	void copyFrom(const Warehouse& other);

	void resize();

public:
	Warehouse();
	~Warehouse();
	Warehouse(const Warehouse& other);
	Warehouse& operator=(const Warehouse& other);

	Warehouse(Warehouse&& other);
	Warehouse& operator=(Warehouse&& other);

	bool Receive(const Delivery& delivery);
};

#endif /* _WAREHOUSE */