diff --git a/DisplayManager.h b/DisplayManager.h index 828d6e8..6cd73ae 100644 --- a/DisplayManager.h +++ b/DisplayManager.h @@ -1,3 +1,33 @@ +/* +Name: DisplayManager +Written By: Kevin Galvan Serrano +Modified By: +Purpose: Manage the display of CPU information and the binary search tree +Input: HashTable and BinarySearchTree objects +Output: Displayed CPU information and tree structure +Procedure: Uses the HashTable and BinarySearchTree to retrieve and display information +*/ + +/* +Name: displayAll +Written By: Kevin Galvan Serrano +Modified By: +Purpose: Display all CPUs in the database +Input: None +Output: List of all CPUs sorted by their ID +Procedure: Iterates through the HashTable and displays each CPU's information +*/ + +/* +Name: displayTree +Written By: Kevin Galvan Serrano +Modified By: +Purpose: Display the BST as an indented tree +Input: None +Output: Indented representation of the binary search tree +Procedure: Performs an inorder traversal of the BST, displaying each node with appropriate indentation +*/ + #ifndef DISPLAY_MANAGER_H #define DISPLAY_MANAGER_H diff --git a/SearchManager.h b/SearchManager.h index 7111667..cb989bf 100644 --- a/SearchManager.h +++ b/SearchManager.h @@ -1,3 +1,24 @@ +/* +Name: SearchManager +Written By: Kevin Galvan Serrano +Modified By: +Purpose: Manage the search functionality for CPUs +Input: HashTable object +Output: Search results or error messages +Procedure: Prompts user for search criteria, uses the HashTable to find matching CPUs, and displays results +*/ + +/* +Name: searchCPU +Written By: Kevin Galvan Serrano +Modified By: +Purpose: Search for a CPU by its ID +Input: CPU ID (string) +Output: CPU information if found, or a "not found" message +Procedure: Uses the HashTable's search function to find the CPU, then displays its information +*/ + + #ifndef SEARCH_MANAGER_H #define SEARCH_MANAGER_H diff --git a/Stack.h b/Stack.h index 589f6c3..d0950a4 100644 --- a/Stack.h +++ b/Stack.h @@ -1,3 +1,63 @@ +/* +Name: Stack +Written By: Kevin Galvan Serrano +Modified By: +Purpose: Implement a generic stack data structure +Input: Template parameter T for the type of elements stored in the stack +Output: N/A +Procedure: Uses a linked list of StackNodes to store elements in a Last-In-First-Out (LIFO) order +*/ + +/* +Name: push +Written By: Kevin Galvan Serrano +Modified By: +Purpose: Add an element to the top of the stack +Input: Element of type T to be added +Output: None +Procedure: Creates a new StackNode with the input data and adds it to the top of the stack +*/ + +/* +Name: pop +Written By: Kevin Galvan Serrano +Modified By: +Purpose: Remove and return the top element from the stack +Input: None +Output: Element of type T that was at the top of the stack +Procedure: Removes the top StackNode, returns its data, and updates the stack accordingly +*/ + +/* +Name: peek +Written By: Kevin Galvan Serrano +Modified By: +Purpose: Return the top element of the stack without removing it +Input: None +Output: Element of type T that is at the top of the stack +Procedure: Returns the data of the top StackNode without modifying the stack +*/ + +/* +Name: isEmpty +Written By: Kevin Galvan Serrano +Modified By: +Purpose: Check if the stack is empty +Input: None +Output: Boolean indicating whether the stack is empty +Procedure: Returns true if the stack contains no elements, false otherwise +*/ + +/* +Name: getCount +Written By: Kevin Galvan Serrano +Modified By: +Purpose: Get the number of elements in the stack +Input: None +Output: Integer representing the number of elements in the stack +Procedure: Returns the count of elements currently in the stack +*/ + #ifndef INC_08_TEAM_PROJECT_STACK_H #define INC_08_TEAM_PROJECT_STACK_H diff --git a/StackNode.h b/StackNode.h index 50ac216..724dc02 100644 --- a/StackNode.h +++ b/StackNode.h @@ -1,3 +1,13 @@ +/* +Name: StackNode +Written By: Kevin Galvan Serrano +Modified By: +Purpose: Represent a single node in the Stack data structure +Input: Template parameter T for the type of data stored in the node +Output: N/A +Procedure: Stores an element of data and a pointer to the next StackNode in the stack +*/ + #ifndef INC_08_TEAM_PROJECT_STACKNODE_H #define INC_08_TEAM_PROJECT_STACKNODE_H diff --git a/UndoManager.h b/UndoManager.h index b08ca16..374bfd8 100644 --- a/UndoManager.h +++ b/UndoManager.h @@ -1,3 +1,33 @@ +/* +Name: UndoManager +Written By: Kevin Galvan Serrano +Modified By: +Purpose: Manage the undo delete functionality +Input: HashTable, BinarySearchTree, and Stack objects +Output: Messages confirming undo operations +Procedure: Uses a Stack to keep track of deleted CPUs and reinserts them when undoing a deletion +*/ + +/* +Name: addToUndoStack +Written By: Kevin Galvan Serrano +Modified By: +Purpose: Add a deleted CPU to the undo stack +Input: CPU object +Output: None +Procedure: Pushes the deleted CPU onto the undo stack +*/ + +/* +Name: undoDelete +Written By: Kevin Galvan Serrano +Modified By: +Purpose: Undo the most recent CPU deletion +Input: None +Output: Message confirming the undo operation +Procedure: Pops a CPU from the undo stack and reinserts it into the HashTable and BinarySearchTree +*/ + #ifndef UNDO_MANAGER_H #define UNDO_MANAGER_H