Gator Library
An implementation of the Red-Black Tree and Priority queue data structure in C++.
Loading...
Searching...
No Matches
gator_library.hpp
Go to the documentation of this file.
1
10#pragma once
11
12#include <string>
13#include <set>
14#include <unordered_map>
15
16#include "book.hpp"
17#include "redblack_tree.hpp"
18
19using namespace std;
20
22{
23private:
25
26public:
27
28 // print functions
29 void PrintBook(int bookID);
30 void PrintBooks(int bookID1, int bookID2);
31
32 // operations
33 void InsertBook(int bookID, string bookName, string authorName, string availabilityStatus);
34 bool BorrowBook(int patronID, int bookID, int patronPriority);
35 void ReturnBook(int patronID, int bookID);
36 void DeleteBook(int bookID);
37
38 // info functions
39 void ColorFlipCount();
40 void FindClosestBook(int targetId);
41};
The GatorLibrary class represents a library system.This class provides functionality to manage books ...
Definition gator_library.hpp:22
void DeleteBook(int bookID)
Delete a book from the library.
Definition gator_library.cpp:137
void PrintBook(int bookID)
Display the book details.
Definition gator_library.cpp:19
bool BorrowBook(int patronID, int bookID, int patronPriority)
Borrow a book from the library.
Definition gator_library.cpp:71
rbtree rbtBooks
Definition gator_library.hpp:24
void PrintBooks(int bookID1, int bookID2)
Display the book details for all books in the range.
Definition gator_library.cpp:33
void ReturnBook(int patronID, int bookID)
Return a book to the library.
Definition gator_library.cpp:105
void FindClosestBook(int targetId)
Find the book Id closest to the targetId.
Definition gator_library.cpp:43
void ColorFlipCount()
Display the number of color flips in the red black tree.
Definition gator_library.cpp:180
void InsertBook(int bookID, string bookName, string authorName, string availabilityStatus)
Insert a new book into the library.
Definition gator_library.cpp:58
#define rbtree
Red-black tree type.
Definition redblack_tree.hpp:18