20 Queue *Queue::readyQueue =
nullptr;
21 Queue *Queue::waitQueue =
nullptr;
33 readyQueue =
new Queue;
40 waitQueue =
new Queue;
52 for (
auto it = queue.begin(); it != queue.end(); it++)
88 std::cout <<
"The queue contains:\n";
89 for (
auto it = queue.begin(); it != queue.end(); it++)
91 std::cout <<
" pid "<<(*it)->getPid()<<
"\n";
101 std::ostringstream stream;
102 for (
auto it = queue.begin(); it != queue.end(); it++)
104 stream << (*it)->getPid();
105 if ((*it)->isRealTime())
106 stream <<
"("<<(*it)->getDeadlineTime()<<
")";
static unsigned long int getMaxNumber()
returns the maximum number of process that can ever be created
This class implements the ready queue and the wait queue. Those queues contain processes ready to run...
void print() const
print a summary of the queue's content
int getMaxSize() const
get the maximum size of the queues
std::string getDisplay() const
get the queue's content as a string, for command-line output
static Queue * getReadyQueue()
get a pointer to the system's ready queue
std::list< std::shared_ptr< Process > >::iterator iterator
static Queue * getWaitQueue()
get a pointer to the system's wait queue
std::shared_ptr< Process > remove(std::shared_ptr< Process > p)
removes the process from the queue. Note: this does not delete the process. Just remove it from queue...
void add(std::shared_ptr< Process > p)
add a process to the queue