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

#include <scheduler.hpp>

Inheritance diagram for FCFS:
[legend]
Collaboration diagram for FCFS:
[legend]

Public Member Functions

 FCFS ()
 A First Come First Serve (FCFS) scheduler.
 
 ~FCFS ()
 
std::vector< std::unique_ptr< Process > > schedule (time_unit &currentTime, std::shared_ptr< Logger > logger, time_unit quantum=-1)
 This function represents moving forward by a single unit in time.
 
bool addToReadyQueue (std::unique_ptr< Process > &process, time_unit _currentTime=-1)
 This function represents the addition of a newly arrived process to the ready queue.
 

Constructor & Destructor Documentation

◆ FCFS()

FCFS::FCFS ( )

A First Come First Serve (FCFS) scheduler.

◆ ~FCFS()

FCFS::~FCFS ( )

Member Function Documentation

◆ addToReadyQueue()

bool FCFS::addToReadyQueue ( std::unique_ptr< Process > &  process,
time_unit  currentTime = -1 
)
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

Implements Scheduler.

◆ schedule()

std::vector< std::unique_ptr< Process > > FCFS::schedule ( time_unit currentTime,
std::shared_ptr< Logger logger,
time_unit  quantum = -1 
)
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

Implements Scheduler.


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