-
Notifications
You must be signed in to change notification settings - Fork 0
/
printer.h
31 lines (28 loc) · 1.12 KB
/
printer.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
#pragma once
// _Monitor / _Cormonitor Printer {
_Monitor Printer {
unsigned int numStudents, numVendingMachines, numCouriers;
struct Info{
bool filled = false;
char state;
unsigned int value1;
unsigned int value2;
unsigned int numValues;
};
Info* buffer;
void update(unsigned int location, Info newString);
void flush(unsigned int location, Info newString);
public:
enum Kind { Parent, Groupoff, WATCardOffice, NameServer, Truck, BottlingPlant, Student, Vending, Courier };
Printer( unsigned int numStudents, unsigned int numVendingMachines, unsigned int numCouriers );
~Printer();
void print( Kind kind, char state );
void print( Kind kind, char state, unsigned int value1 );
void print( Kind kind, char state, unsigned int value1, unsigned int value2 );
void print( Kind kind, unsigned int lid, char state );
void print( Kind kind, unsigned int lid, char state, unsigned int value1 );
void print( Kind kind, unsigned int lid, char state, unsigned int value1, unsigned int value2 );
private:
// get column in buffer information should be depending on its kind
int getPosition(Kind kind, unsigned int lid);
};