-
Notifications
You must be signed in to change notification settings - Fork 0
/
truck.h
44 lines (34 loc) · 1.02 KB
/
truck.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
#ifndef TRUCK_H
#define TRUCK_H
#include "vendingMachine.h"
_Monitor Printer;
_Task NameServer;
_Task BottlingPlant;
_Task Truck {
public:
Truck(Printer &prt, NameServer &nameServer, BottlingPlant &plant,
unsigned int numVendingMachines, unsigned int maxStockPerFlavour);
private:
enum States {
Start = 'S',
PickedUp = 'P',
Begin = 'd',
Unsuccessful = 'U',
Delivered = 'D',
Finish = 'F'
};
Printer &printer;
NameServer &nameServer;
BottlingPlant &plant;
// constants as defined in ConfigParms
unsigned int numVendingMachines;
unsigned int maxStockPerFlavour;
// the number of bottles of each flavour being transported
unsigned int cargo[VendingMachine::NumberOfFlavours];
// the current vending machine that needs to be restocked
unsigned int machineForRestock;
// the total number of bottles (across all flavours) remaining on the truck
unsigned int bottlesLeft();
void main();
};
#endif