-
Notifications
You must be signed in to change notification settings - Fork 0
/
VendingMachine.h
31 lines (28 loc) · 911 Bytes
/
VendingMachine.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
#ifndef VENDINGMACHINE_H
#define VENDINGMACHINE_H
_Monitor Printer;
_Task NameServer;
class WATCard;
_Task VendingMachine {
void main();
public:
enum Flavours { PERFECTION, GOOD, BAD, GARBAGE }; // flavours of soda (YOU DEFINE)
enum Status { BUY, STOCK, FUNDS }; // purchase status: successful buy, out of stock, insufficient funds
VendingMachine( Printer &prt, NameServer &nameServer, unsigned int id, unsigned int sodaCost,
unsigned int maxStockPerFlavour );
~VendingMachine();
Status buy( Flavours flavour, WATCard &card );
unsigned int *inventory();
void restocked();
_Nomutex unsigned int cost();
_Nomutex unsigned int getId();
private:
unsigned int* stock;
Printer* prt;
NameServer* nameServer;
unsigned int id;
unsigned int sodaCost;
unsigned int maxStockPerFlavour;
bool beingStocked;
};
#endif