-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBook.cpp
72 lines (58 loc) · 1.03 KB
/
Book.cpp
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
72
#include "Book.h"
//Constructor for a book. Sets the read-only properties
Book::Book(std::string idc, std::string t, std::string a)
{
//It is useful to initialize Requestedby and checkedOutBy to NULL
idCode = idc;
title = t;
author = a;
location = ON_SHELF;
requestedBy = NULL;
checkedOutBy = NULL;
}
//All of the getters for properties
std::string Book::getAuthor()
{
return author;
}
Patron* Book::getCheckedOutBy()
{
return checkedOutBy;
}
int Book::getDateCheckedOut()
{
return dateCheckedOut;
}
std::string Book::getIdCode()
{
return idCode;
}
Locale Book::getLocation()
{
return location;
}
Patron* Book::getRequestedBy()
{
return requestedBy;
}
std::string Book::getTitle()
{
return title;
}
//Setters for non read-only properties
void Book::setCheckedOutBy(Patron *p)
{
checkedOutBy = p;
}
void Book::setDateCheckedOut(int d)
{
dateCheckedOut = d;
}
void Book::setLocation(Locale lo)
{
location = lo;
}
void Book::setRequestedBy(Patron *p)
{
requestedBy = p;
}