-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLibrary.h
executable file
·87 lines (52 loc) · 1.39 KB
/
Library.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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
//
// Created by nikang on 12/22/16.
//
#ifndef AP_LIBRARY_H
#define AP_LIBRARY_H
#include <iostream>
#include <map>
#include "Librarian.h"
#include "Book.h"
#include "Date.h"
#include "Transaction.h"
#include "Member.h"
#include "Writer.h"
#include <random>
class Book;
class Date;
class Librarian;
class Transaction;
class Member;
class Writer;
using namespace std;
class Library {
string name;
string password;
map<long, Librarian *> librarians;
map<long, Member *> members;
map<long, Book *> books;
Date *date;
map<long, Transaction *> transactions;
map<long, Writer *> writers;
public:
Library(const string &name, Date *date);
static long Id_generator();
long add_book(string book_name, long writer_id, string type, string description = "");
void remove_book(long id);
bool borrow_book(long borrowed_book_id, long member_id);
void return_book(long borrowed_book_id);
void show_books();
double Pay(long user_id);
string show_borrowed_books();
long add_writer(string name);
string show_available_books();
long add_librarian(string name, string password);
void show_librarians();
void remove_librarian();
long add_member(string name);
string remove_member(long id);
string show_members();
long find_book(string name);
bool login(long id, string password);
};
#endif //AP_LIBRARY_H