-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathReader.h
71 lines (60 loc) · 2.01 KB
/
Reader.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
//
// Reader.hpp
//
#ifndef Reader_h
#define Reader_h
#include <iostream>
#include <string>
#include <list>
#include "User.h"
#include "Book.h"
#include "Copy.h"
#include <vector>
using namespace std;
class Reader: public User {
public:
// constructors
Reader();
Reader(string, string);
Reader(char type, string, string, int , list<Copy> , int, list<Book>, int, int);
// accessors and mutators
void addcopyborrowed(Copy tempborrowcopy);
void deletecopyborrowed(Copy tempdeletecopy);
void addbookreserved(Book tempreservebook);
void deletebookreserved(Book& tempdeletebook);
void setmax_copies(int tempmax_copies);
void setnumpenalties(int tempnumpenalties);
void setlistcopiesborrowed(list<Copy>);
void setlistbooksreserved(list<Book>);
void setreadertype(char);
void setnumbooksreserved(int);
void setnumcopiesborrowed(int);
char getreadertype();
int getnumcopiesborrowed();
int getnumbooksreserved();
int getnumpenalties();
int getmaxcopies();
list<Copy> getlistcopiesborrowed();
list<Book> getlistbooksreserved();
// print reader info
void printReader();
void printcopiesborrowed();
void printbooksreserved();
// overloaded operators to input, output, and find reader based on username
void operator>>(list<Reader>& myreaders);
void operator<<(list<Reader>& myreaders);
bool operator==(const Reader& rhs);
// decrease max copies if penalty threshold reached
void decreasemaxcopies();
private:
char readertype;
int numbooksreserved;
int numcopiesborrowed;
int max_copies;
list<Copy> copiesborrowed;
list<Copy>::iterator iter=copiesborrowed.begin();
list<Book> booksreserved;
list<Book>::iterator itera=booksreserved.begin();
int numpenalties;
};
#endif /* Reader_h */