-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLibrary.h
More file actions
67 lines (50 loc) · 1.81 KB
/
Copy pathLibrary.h
File metadata and controls
67 lines (50 loc) · 1.81 KB
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
//---------------------------------------------------------------------------
// library.h
//---------------------------------------------------------------------------
// Library class acts as interface between data files and storage / functions
//
// Assumptions:
// -- correctly formatted input from file
// -- each book item is uniquely identified by its srting criteria
// -- each command is uniquely and correctly identified by command char
// Implementation:
// -- holds a book factory, command factory, patron container, and bookcase
// -- Library reads input from data files
//---------------------------------------------------------------------------
#ifndef LIBRARY_H
#define LIBRARY_H
#include "commandmanager.h"
#include "patroncontainer.h"
#include "shelf.h"
#include <iostream>
using namespace std;
class Library {
public:
// default constructor
Library();
// default destructor
~Library();
// adds patron to patron container
bool buildPatrons(istream &);
// interface between data file and command execution
bool performCommands(istream &);
// interface between data file and book addition
bool buildLibrary(istream &);
// displays books by category, sorted within the category
void displayItems() const;
// displays all patrons in the library by order of ID
void displayPatrons() const;
// Finds and returns a patron within the library system. Assigns
// desired patron to a pointer to be used by calling function.
bool getPatron(int userID,Patron *&);
// retrieves an item from the library
bool getItem(Item &target, Item *&toReturn);
private:
// contents of the library
Shelf shelf;
// holds patrons of the library
PatronContainer patContainer;
// interface with command objects
CommandManager commManager;
};
#endif