-
Notifications
You must be signed in to change notification settings - Fork 0
/
materialHead.hpp
79 lines (74 loc) · 2.26 KB
/
materialHead.hpp
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
#include <iostream>
#include <vector>
#include <fstream>
// total number
unsigned int materials_in_stock;
// number of materials that got borrowed
unsigned int materials_borrowed;
std::ifstream ifs;
std::ofstream ofs;
class materials
{
public:
materials();
materials(std::string id, std::string type, std::string name, std::string author, bool state, std::string b_id, unsigned int year, unsigned int month, unsigned int day);
~materials();
// id
void set_id(std::string id);
std::string get_id() const;
// type
void set_type(std::string type);
std::string get_type() const;
// name
std::string get_name() const;
void set_name(std::string name);
// author
std::string get_author() const;
void set_author(std::string author);
// is_in_stock
bool get_state() const;
void set_state(bool b);
// b_id (borrower's id)
std::string get_b_id() const;
void set_b_id(std::string id);
// year
unsigned int get_year() const;
void set_year(unsigned int year);
// month
unsigned int get_month() const;
void set_month(unsigned int month);
// day
unsigned int get_day() const;
void set_day(unsigned int day);
// p_next
materials *get_next() const;
void set_next(materials *p_next);
// print
void print() const;
private:
std::string m_name;
std::string m_author;
bool m_state;
std::string m_id;
std::string m_type;
// borrower's id
std::string m_b_id;
// expected return date for materials
unsigned int m_expReturnYear;
unsigned int m_expReturnMonth;
unsigned int m_expReturnDay;
materials *p_next;
};
class materials_list
{
public:
materials_list();
~materials_list();
materials *get_p_head() const;
void set_p_head(materials *p);
bool not_nullptr() const;
// get id of the temporary holder (borrower) of a material
materials *get_b_id(std::string m) const;
private:
materials *p_head;
};