-
Notifications
You must be signed in to change notification settings - Fork 0
/
Reader.h
27 lines (22 loc) · 939 Bytes
/
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
#pragma once
#include <algorithm>
#include "User.h"
class BorrowedBook;
class Reader : public User {
std::vector<BorrowedBook*> borrowed_books;
public:
Reader() {};
Reader(string username, string password, string email);
Reader(const Reader& other);
~Reader();
std::vector<BorrowedBook*> get_borrowed_books() const;
void set_borrowed_books(const std::vector<BorrowedBook*> borrowed_books);
std::vector<Book*> search_by_title(const string& title, const std::vector<Book*>& library);
std::vector<Book*> search_by_author(const string& author, const std::vector<Book*>& library);
// Method to borrow a copy and update the borrowed books of a reader
bool borrow_book(Book* book);
// Method to return a copy and update the borrowed books list of a reader
bool return_book(BorrowedBook* borrowed);
void rate_book(BorrowedBook* borrowed);
void display_borrowed_books() const;
};