Scheduler Sim
A CPU Scheduling Algorithm Simulator in C++.
Loading...
Searching...
No Matches
Scheduler Class Referenceabstract

Abstract class for all scheduler types. More...

#include <scheduler.hpp>

Inheritance diagram for Scheduler:
[legend]

Public Member Functions

virtual std::vector< std::unique_ptr< Process > > schedule (time_unit &currentTime, std::shared_ptr< Logger > logger, time_unit quantum)=0
 This function represents moving forward by a single unit in time.
 
virtual bool addToReadyQueue (std::unique_ptr< Process > &process, time_unit currentTime)=0
 This function represents the addition of a newly arrived process to the ready queue.
 

Detailed Description

Abstract class for all scheduler types.

Member Function Documentation

◆ addToReadyQueue()

virtual bool Scheduler::addToReadyQueue ( std::unique_ptr< Process > &  process,
time_unit  currentTime 
)
pure virtual

This function represents the addition of a newly arrived process to the ready queue.

Parameters
processThe process to add
currentTimeThe simulation time when the process arrived, i.e., now

Implemented in FCFS, CFS, and RR.

◆ schedule()

virtual std::vector< std::unique_ptr< Process > > Scheduler::schedule ( time_unit currentTime,
std::shared_ptr< Logger logger,
time_unit  quantum 
)
pure virtual

This function represents moving forward by a single unit in time.

Parameters
currentTimeThe current simulation time
loggerThe Logger instance to use for event logging
quantumThe time quantum (if required by the scheduler)
Returns
std::vector<std::unique_ptr<Process>> The list of scheduled processes till now

Implemented in RR, CFS, and FCFS.


The documentation for this class was generated from the following file: