|
Gator Library
An implementation of the Red-Black Tree and Priority queue data structure in C++.
|
Represents a book in the library. More...
#include <book.hpp>

Public Member Functions | |
| void | AddReservation (reservation newReservation) |
| Adds a new reservation for the book. | |
| void | DeleteReservation (int patronID) |
| Deletes a reservation for the book. | |
| void | PrintBook () |
| Prints the details of the book. | |
| book (int id, string name, string author, string availabilityStatus) | |
| Constructs a book object with the given parameters. | |
| book (int id, string name, string author, BookAvailability available) | |
| Constructs a book object with the given parameters. | |
| ~book () | |
| Destructs the book object. | |
Public Attributes | |
| int | BookId |
| string | BookName |
| string | AuthorName |
| BookAvailability | AvailabilityStatus |
| int | BorrowedBy |
| pq_reservation | ReservationHeap |
Private Member Functions | |
| void | printReservations () |
| Prints the reservations for the book. | |
Represents a book in the library.
This class provides functionality to manage reservations, borrowings, and information about a book. It contains member variables to store the book's ID, name, author, availability status, and borrower. The class also includes a priority queue for managing reservations.
| book::book | ( | int | id, |
| string | name, | ||
| string | author, | ||
| string | availabilityStatus | ||
| ) |
Constructs a book object with the given parameters.
| id | The ID of the book. |
| name | The name of the book. |
| author | The name of the author of the book. |
| availabilityStatus | The availability status of the book as a string. |
| book::book | ( | int | id, |
| string | name, | ||
| string | author, | ||
| BookAvailability | available | ||
| ) |
Constructs a book object with the given parameters.
| id | The ID of the book. |
| name | The name of the book. |
| author | The name of the author of the book. |
| available | The availability status of the book as an enum value. |
| book::~book | ( | ) |
Destructs the book object.
| void book::AddReservation | ( | reservation | newReservation | ) |
Adds a new reservation for the book.
| newReservation | The reservation to be added. |
Add the reservation to the reservation heap. Reservation heap is a min heap based on priority number and time of reservation.

| void book::DeleteReservation | ( | int | patronID | ) |
Deletes a reservation for the book.
| patronID | The ID of the patron whose reservation needs to be deleted. |
| void book::PrintBook | ( | ) |
Prints the details of the book.

|
private |
Prints the reservations for the book.


| string book::AuthorName |
The name of the author of the book.
| BookAvailability book::AvailabilityStatus |
The availability status of the book.
| int book::BookId |
The ID of the book.
| string book::BookName |
The name of the book.
| int book::BorrowedBy |
The ID of the patron who borrowed the book.
| pq_reservation book::ReservationHeap |
The priority queue for managing reservations.