Question
#include #include readyqueue.h using namespace std; //You must complete the all parts marked as TODO. Delete TODO after you are done. // Remember to add
#include
#include "readyqueue.h"
using namespace std;
//You must complete the all parts marked as "TODO". Delete "TODO" after you are done.
// Remember to add sufficient comments to your code
/**
* @brief Constructor for the ReadyQueue class.
*/
ReadyQueue::ReadyQueue() {
//TODO: add your code here
}
/**
* @brief Add a PCB representing a process into the ready queue.
*
* @param pcbPtr: the pointer to the PCB to be added
*/
void ReadyQueue::addPCB(PCB *pcbPtr) {
//TODO: add your code here
// When adding a PCB to the queue, you must change its state to READY.
}
/**
* @brief Remove and return the PCB with the highest priority from the queue
*
* @return PCB*: the pointer to the PCB with the highest priority
*/
PCB* ReadyQueue::removePCB() {
//TODO: add your code here
// When removing a PCB from the queue, you must change its state to RUNNING.
}
/**
* @brief Returns the number of elements in the queue.
*
* @return int: the number of PCBs in the queue
*/
int ReadyQueue::size() {
//TODO: add your code here
}
/**
* @brief Display the PCBs in the queue.
*/
void ReadyQueue::displayAll() {
//TODO: add your code here
}
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started