Website Summary Files Commits Branches @commit @diff @stats
path: root / Week10 / Exercise03 / Warehouse.h
diff options
context:
space:
mode:
1 files changed, 36 insertions, 0 deletions
-rw-r--r--Week10/Exercise03/Warehouse.h36
diff --git a/Week10/Exercise03/Warehouse.h b/Week10/Exercise03/Warehouse.h
new file mode 100644
index 0000000..b71d08c
--- /dev/null
+++ b/Week10/Exercise03/Warehouse.h
@@ -0,0 +1,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 */