-
Notifications
You must be signed in to change notification settings - Fork 0
/
bottlingPlant.h
32 lines (28 loc) · 1.16 KB
/
bottlingPlant.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
#ifndef BOTTLING_PLANT_H_
#define BOTTLING_PLANT_H_
#include "constants.h"
_Task Truck;
_Task NameServer;
_Monitor Printer;
_Task BottlingPlant {
Printer &printer;
NameServer &nameServer;
const unsigned int numVendingMachines;
const unsigned int maxShippedPerFlavour;
const unsigned int maxStockPerFlavour;
const unsigned int timeBetweenShipments;
bool isClosingDown; // True if plant is closed now, false otherwise
Truck* truck;
unsigned int generatedStock[NUM_FLAVOURS]; // Quantity of stock that we generated for each flavour
// States we can print for BottlingPlant
enum States {Starting = 'S', Generating = 'G', PickedUp = 'P', Finished = 'F'};
void main();
public:
BottlingPlant(Printer &prt, NameServer &nameServer, unsigned int numVendingMachines,
unsigned int maxShippedPerFlavour, unsigned int maxStockPerFlavour,
unsigned int timeBetweenShipments);
~BottlingPlant();
bool getShipment(unsigned int cargo[]); // Returns true if plant is closed now. Otherwise,
// it returns false and fills cargo with generatedStock values
}; // BottlingPlant
#endif // BOTTLING_PLANT_H_